ophub / amlogic-s9xxx-armbian

Support for Armbian in Amlogic, Rockchip and Allwinner boxes. Support a311d, s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, s905l, rk3588, rk3568, rk3399, rk3328, h6, etc.
GNU General Public License v2.0
5.92k stars 1.9k forks source link

[t95z-plus] Cannot install to emmc: Failed to mount BOOTFS partition #567

Closed ajboni closed 2 years ago

ajboni commented 2 years ago

Describe the bug Installation fails with


armbian:/boot:# lsblk                
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
mmcblk1      179:0    0 14.5G  0 disk 
├─mmcblk1p1  179:1    0  255M  0 part /boot
└─mmcblk1p2  179:2    0  2.5G  0 part /var/log.hdd
                                      /
mmcblk2      179:32   0 14.5G  0 disk 
├─mmcblk2p1  179:33   0  511M  0 part 
└─mmcblk2p2  179:34   0 13.7G  0 part 
mmcblk2boot0 179:64   0    4M  1 disk 
mmcblk2boot1 179:96   0    4M  1 disk 
zram0        254:0    0  905M  0 disk [SWAP]
zram1        254:1    0   50M  0 disk /var/log
zram2        254:2    0  905M  0 disk /var/tmp

=========

[ STEPS ] Start install armbian to emmc...
[ STEPS ] Start initializing the environment...
[ INFO ] DEV_EMMC: [ /dev/mmcblk2 ]
[ STEPS ] Start selecting device...
--------------------------------------------------------------------------------------
ID    SOC        MODEL                          DTB                                               
--------------------------------------------------------------------------------------
101   s905d      Phicomm-N1                     meson-gxl-s905d-phicomm-n1.dtb                    
102   s905d      Phicomm-N1-(DMA-thresh)        meson-gxl-s905d-phicomm-n1-thresh.dtb             
103   s905x      HG680P                         meson-gxl-s905x-p212.dtb                          
104   s905w      X96-Mini-&-TX3-Mini            meson-gxl-s905w-tx3-mini.dtb                      
105   s905d      MECOOL-KI-Pro                  meson-gxl-s905d-mecool-ki-pro.dtb                 
106   s905x      T95                            meson-gxl-s905x-p212.dtb                          
107   s905x      B860H                          meson-gxl-s905x-b860h.dtb                         
108   s905x      TBee                           meson-gxl-s905x-tbee.dtb                          
201   s912       Octopus-Planet                 meson-gxm-octopus-planet.dtb                      
202   s912       Octopus-Planet-(FAKE)          meson-gxm-octopus-planet.dtb                      
203   s912       H96-Pro-Plus                   meson-gxm-octopus-planet.dtb                      
204   s912       Tanix-TX92                     meson-gxm-octopus-planet.dtb                      
205   s912       VORKE-Z6-Plus                  meson-gxm-octopus-planet.dtb                      
206   s912       MECOOL-M8S-Pro-L               meson-gxm-q201.dtb                                
207   s912       T95Z-Plus                      meson-gxm-t95z-plus.dtb                           
208   s912       TX9-Pro                        meson-gxm-tx9-pro.dtb                             
209   s912       Nexbox-A1-&-A95X               meson-gxm-nexbox-a1.dtb                           
210   s912       Nexbox-A95X-A2                 meson-gxm-nexbox-a2.dtb                           
211   s912       Tanix-TX8-MAX                  meson-gxm-tx8-max.dtb                             
212   s912       Vontar-X92                     meson-gxm-x92.dtb                                 
301   s905x2     X96-Max-4GB                    meson-g12a-x96-max.dtb                            
302   s905x2     X96-Max-2GB                    meson-g12a-x96-max-rmii.dtb                       
303   s905x2     MECOOL-KM3-4G                  meson-g12a-sei510.dtb                             
304   s905l3a    E900V22C-D                     meson-g12a-s905l3a-e900v22c.dtb                   
305   s905l3a    CM311-1a-YST                   meson-g12a-s905l3a-cm311.dtb                      
401   s922x      Beelink-GT-King                meson-g12b-gtking.dtb                             
402   s922x      Beelink-GT-King-Pro            meson-g12b-gtking-pro.dtb                         
403   s922x      Beelink-GT-King-Pro-H          meson-g12b-gtking-pro-h.dtb                       
404   s922x      Beelink-GT-King-Pro-Rev_A      meson-g12b-gtking-pro.dtb                         
405   s922x      Hardkernel-ODroid-N2           meson-g12b-odroid-n2.dtb                          
406   s922x      UGOOS-AM6-Plus                 meson-g12b-ugoos-am6.dtb                          
407   a311d      Khadas-VIM3                    meson-g12b-a311d-khadas-vim3.dtb                  
501   s905x3     X96-Max+                       meson-sm1-x96-max-plus.dtb                        
502   s905x3     X96-Max+-(OverClock)           meson-sm1-x96-max-plus-oc.dtb                     
503   s905x3     X96-Max+-(IP1001M-phy)         meson-sm1-x96-max-plus-ip1001m.dtb                
504   s905x3     X96-Max+-Q2                    meson-sm1-x96-max-plus-q2.dtb                     
505   s905x3     X96-Max+-100Mb                 meson-sm1-x96-air.dtb                             
506   s905x3     HK1-Box                        meson-sm1-hk1box-vontar-x3.dtb                    
507   s905x3     HK1-Box-(OverClock)            meson-sm1-hk1box-vontar-x3-oc.dtb                 
508   s905x3     H96-Max-X3                     meson-sm1-h96-max-x3.dtb                          
509   s905x3     H96-Max-X3-(OverClock)         meson-sm1-h96-max-x3-oc.dtb                       
510   s905x3     Ugoos-X3                       meson-sm1-ugoos-x3.dtb                            
511   s905x3     Ugoos-X3-(OverClock)           meson-sm1-ugoos-x3-oc.dtb                         
512   s905x3     TX3-1Gb                        meson-sm1-tx3-qz.dtb                              
513   s905x3     TX3-1Gb-(OverClock)            meson-sm1-tx3-qz-oc.dtb                           
514   s905x3     TX3-100Mb                      meson-sm1-tx3-bz.dtb                              
515   s905x3     TX3-100Mb-(OverClock)          meson-sm1-tx3-bz-oc.dtb                           
516   s905x3     X96-Air-1Gb                    meson-sm1-x96-air-gbit.dtb                        
517   s905x3     X96-Air-100Mb                  meson-sm1-x96-air.dtb                             
518   s905x3     X96-Air-Q1000                  meson-sm1-x96-max-plus-q2.dtb                     
519   s905x3     A95XF3-Air-1Gb                 meson-sm1-a95xf3-air-gbit.dtb                     
520   s905x3     A95XF3-Air-100Mb               meson-sm1-a95xf3-air.dtb                          
521   s905x3     Tencent-Aurora-3Pro            meson-sm1-skyworth-lb2004-a4091.dtb               
0     Other      Customize                      Enter-custom-dtb-name                             
--------------------------------------------------------------------------------------
[ OPTIONS ] Please Input ID: 207
[ INFO ] Input Box ID: [ 207 ]
[ INFO ] FDTFILE: [ meson-gxm-t95z-plus.dtb ]
[ INFO ] UBOOT_OVERLOAD: [ u-boot-s905x-s912.bin ]
[ INFO ] K510: [ 0 ]
[ STEPS ] Start selecting file system type...
-----------------------------------------------
ID  TYPE
-----------------------------------------------
1   ext4
2   btrfs
-----------------------------------------------
[ OPTIONS ] Please Input ID: 1
[ INFO ] Input Type ID: [ 1 ]
[ INFO ] The type of file system: [ ext4 ]
[ STEPS ] Start creating eMMC partition...
1+0 records in
1+0 records out
512 bytes copied, 0.00360797 s, 142 kB/s
[ INFO ] Start create MBR and partittion.
[ INFO ] Restore the mybox bootloader: [ /usr/lib/u-boot/mybox-bootloader.img ]
444+0 records in
444+0 records out
444 bytes copied, 0.00632934 s, 70.1 kB/s
8191+0 records in
8191+0 records out
4193792 bytes (4.2 MB, 4.0 MiB) copied, 0.266605 s, 15.7 MB/s
[ STEPS ] Start processing the bootfs partition...
[ INFO ] Formatting BOOTFS partition.
mkfs.fat 4.2 (2021-01-31)
mkfs.vfat: unable to open /dev/mmcblk2p1: No such file or directory
mount: /ddbr/install: special device /dev/mmcblk2p1 does not exist.
[ ERROR ] Failed to mount BOOTFS partition

=======
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
mmcblk1      179:0    0 14.5G  0 disk 
├─mmcblk1p1  179:1    0  255M  0 part /boot
└─mmcblk1p2  179:2    0  2.5G  0 part /var/log.hdd
                                      /
mmcblk2      179:32   0 14.5G  0 disk 
mmcblk2boot0 179:64   0    4M  1 disk 
mmcblk2boot1 179:96   0    4M  1 disk 
zram0        254:0    0  905M  0 disk [SWAP]
zram1        254:1    0   50M  0 disk /var/log
zram2        254:2    0  905M  0 disk /var/tmp

Armbian Version

Device (please complete the following information): Device: 207 s912 T95Z-Plus meson-gxm-t95z-plus.dtb

ophub commented 2 years ago

try again

ajboni commented 2 years ago

what do you mean?

ophub commented 2 years ago

When the installation fails, execute armbian-install again and try again

try btrfs

Matrix-Chen commented 2 years ago

@ophub Octopus-planet(S912) cannot boot from SD card with the newest 5.15.68 firmware

ophub commented 2 years ago

use usb

ajboni commented 2 years ago

I managed to install it using btrfs, but after succesfully booting, it fails and system becomes read-only. Getting some input-output errors

ophub commented 2 years ago

https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/build-armbian/armbian-docs#126-selection-of-bootstrap-file

12.6

In general, just use /boot/uEnv.txt. The /boot/extlinux/extlinux.conf file is required for individual devices, such as T95 (s905x) / T95Z-Plus (s912) etc. If necessary, delete the .bak in the /boot/extlinux/extlinux.conf.bak file name that comes with the firmware to use it. armbian-install automatically checks when writing to eMMC and creates an extlinux.conf file if it exists.

Modify the files in usb and rewrite emmc

ajboni commented 2 years ago

still getting bad tree blocks: dmesg output:

[  193.964320] mmc_erase: erase error -110, status 0x0
[  193.970033] mmc2: cache flush error -110
[  195.144274] mmc_erase: erase error -110, status 0x0
[  195.150036] mmc2: cache flush error -110
[  196.344281] mmc_erase: erase error -110, status 0x0
[  196.349996] mmc2: cache flush error -110
[  198.327178] BTRFS: device label rootfs devid 1 transid 6 /dev/mmcblk2p2 scanned by mkfs.btrfs (2224)
[  222.217470]  mmcblk2: p2
[  222.470780]  mmcblk2:
[  222.635953]  mmcblk2:
[  222.846231]  mmcblk2: p1
[  223.184993]  mmcblk2: p1 p2
[  223.248243]  mmcblk2: p1 p2
[  223.776571]  mmcblk2: p1 p2
[  238.328281] mmc_erase: erase error -110, status 0x0
[  238.334079] mmc2: cache flush error -110
[  238.993468] BTRFS: device label ROOTFS_EMMC devid 1 transid 6 /dev/mmcblk2p2 scanned by mkfs.btrfs (2397)
[  242.026355] BTRFS info (device mmcblk2p2): setting incompat feature flag for COMPRESS_ZSTD (0x10)
[  242.035636] BTRFS info (device mmcblk2p2): use zstd compression, level 6
[  242.045632] BTRFS info (device mmcblk2p2): using free space tree
[  242.052039] BTRFS info (device mmcblk2p2): has skinny extents
[  242.057945] BTRFS info (device mmcblk2p2): flagging fs with big metadata feature
[  242.072307] BTRFS info (device mmcblk2p2): enabling ssd optimizations
[  242.078720] BTRFS info (device mmcblk2p2): checking UUID tree
[  392.898582] BTRFS warning (device mmcblk2p2): checksum verify failed on 1145405440 wanted 0x2bc3b58d found 0xaa432fd4 level 0
[  392.905402] BTRFS error (device mmcblk2p2): bad tree block start, want 1145405440 have 281539401285647
[  392.934388] BTRFS error (device mmcblk2p2): bad tree block start, want 1145405440 have 281539401285647
[  392.952803] BTRFS error (device mmcblk2p2): bad tree block start, want 1145405440 have 281539401285647
[  392.962984] BTRFS error (device mmcblk2p2): bad tree block start, want 1145405440 have 281539401285647
[  392.976666] BTRFS error (device mmcblk2p2): bad tree block start, want 1144176640 have 281539401285647
[  392.988904] BTRFS error (device mmcblk2p2): bad tree block start, want 1145405440 have 281539401285647
[  393.001212] BTRFS error (device mmcblk2p2): bad tree block start, want 1144176640 have 281539401285647
[  393.011723] BTRFS error (device mmcblk2p2): bad tree block start, want 1145405440 have 281539401285647
[  393.012617] BTRFS error (device mmcblk2p2): bad tree block start, want 1144176640 have 281539401285647
[  393.013280] BTRFS error (device mmcblk2p2): bad tree block start, want 1145405440 have 281539401285647
[  393.037693] BTRFS: error (device mmcblk2p2) in __btrfs_update_delayed_inode:995: errno=-5 IO failure
[  393.051910] BTRFS info (device mmcblk2p2): forced readonly
[  393.058435] BTRFS warning (device mmcblk2p2): checksum verify failed on 1132773376 wanted 0xad2c3640 found 0xf618d6f1 level 0
[  393.064348] BTRFS warning (device mmcblk2p2): checksum verify failed on 1130151936 wanted 0x18c8221a found 0xa70a94b2 level 0
[  393.130105] BTRFS warning (device mmcblk2p2): checksum verify failed on 1114472448 wanted 0x3089e820 found 0xaad662b3 level 0
[  393.142221] BTRFS warning (device mmcblk2p2): checksum verify failed on 1113243648 wanted 0x97cfe982 found 0x951ce221 level 0
[  393.206249] BTRFS warning (device mmcblk2p2): checksum verify failed on 1111392256 wanted 0x46a9f0e3 found 0x0695680a level 0
[  393.217708] BTRFS warning (device mmcblk2p2): checksum verify failed on 1110048768 wanted 0x5dddb5a2 found 0xbd67a480 level 0
[  397.907257] validate_extent_buffer: 3013 callbacks suppressed
[  397.907282] BTRFS error (device mmcblk2p2): bad tree block start, want 10207232 have 281539401285647
[  397.921377] BTRFS error (device mmcblk2p2): bad tree block start, want 10207232 have 281539401285647
[  397.930590] BTRFS error (device mmcblk2p2): bad tree block start, want 10207232 have 281539401285647
[  397.939615] BTRFS error (device mmcblk2p2): bad tree block start, want 10207232 have 281539401285647
[  397.948858] BTRFS error (device mmcblk2p2): bad tree block start, want 10207232 have 281539401285647
[  397.957961] BTRFS error (device mmcblk2p2): bad tree block start, want 10207232 have 281539401285647
[  397.967036] BTRFS error (device mmcblk2p2): bad tree block start, want 10207232 have 281539401285647
[  397.979577] BTRFS error (device mmcblk2p2): bad tree block start, want 10207232 have 281539401285647
[  397.989183] BTRFS error (device mmcblk2p2): bad tree block start, want 10207232 have 281539401285647
[  397.998738] BTRFS error (device mmcblk2p2): bad tree block start, want 10207232 have 281539401285647
armbian:~:% cat /boot/extlinux/extlinux.conf
label Armbian
    kernel /zImage
    initrd /uInitrd
    fdt /dtb/amlogic/meson-gxm-t95z-plus.dtb
    append root=UUID=1cfcc7b1-5f24-4058-b42f-8c127c9d1d95 rootflags=data=writeback rw rootfstype=btrfs console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 loglevel=1 voutmode=hdmi disablehpd=false overscan=100 sdrmode=auto
armbian:~:% 
ophub commented 2 years ago

The log prompts that your emmc has bad blocks and cannot be used normally

ophub commented 2 years ago

https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/build-armbian/armbian-docs#1210-how-to-make-an-android-system-partition-table

You can restore the emmc system to the original Android system first, and then look at his partition table. Made according to this tutorial.

ajboni commented 2 years ago

Well, I managed to lost my backup 🥲 . I guess I will keep running it on the sd card, performance has been great so far anyways. Thanks for the support and for this awesome project!!