Build basic rootfs success but mount failed

I use the cmd to build a basic rootfs, then decompress and replace the original Linux_for_tegra/rootfs; build linux rt kernel, generate image and flash is also successful, but failed to boot in the initramfs mount file system, is this my error? I can boot it normally with sample fs.
boot_failed.txt (60.2 KB)
I changed to use / dev/nvme0n1p1 mount, also reported mount error, is using basic file system need other settings?
Thank you

 sudo ./nv_build_samplefs.sh --abi aarch64 --distro ubuntu --flavor basic --version focal
[    5.610106] nvme nvme0: Shutdown timeout set to 8 seconds
[    5.631564] nvme nvme0: 6/0/0 default/read/poll queues
[    5.641545]  nvme0n1: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14
[    5.645647] Freeing unused kernel memory: 3904K
[    5.678858] Run /init as init process
[    5.739528] Root device found: PARTUUID=b9067440-90ee-483c-a9a9-447a38dfb179
[    6.156620] exFAT-fs (nvme0n1p1): invalid boot record signature
[    6.156633] exFAT-fs (nvme0n1p1): failed to read boot sector
[    6.156637] exFAT-fs (nvme0n1p1): failed to recognize exfat type
✔︎ bootloader (master) ✗ catboot/extlinux/extlinux.conf
TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      FDT /boot/dtb/kernel_tegra194-p3668-0000-p3509-0000.dtb
      INITRD /boot/initrd
      APPEND ${cbootargs} root=PARTUUID=b9067440-90ee-483c-a9a9-447a38dfb179 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 video=efifb:off nospectre_bhb 
[    5.517965] Found dev node: /dev/nvme0n1p1
[    5.541260] exFAT-fs (nvme0n1p1): invalid boot record signature
[    5.541272] exFAT-fs (nvme0n1p1): failed to read boot sector
[    5.541275] exFAT-fs (nvme0n1p1): failed to recognize exfat type
[    5.633359] ERROR: nvme0n1p1 mount fail...
ÿᖁRNING: clock_disable: clk_power_ungate on gated domain 27 

Be sure to use the partition UUID, not the FS UUID, and that the filesystem is ext4:

lsblk /dev/nvme0n1p1 -o NAME,PARTUUID,FSTYPE

Hi Honey_Patouceul
In initramfs, it gets stuck after mount failed ; I can’t exec this command to check it; is there any other way to confirm? Thank you

If you can’t boot the Jetson from SD card, you may plug the NVME disk into a Linux host and check from there.

For the NVMe device, can you try with ext4?

Hi linuxdev:
I haven’t changed the init script of initramfs, so it should be a single mount command, The mount command doesn’t add any other options, but report exFAT-fs error.I don’t know if I’m using basic’s rootfs;. Do I need another configuration?

Hi Honey_Patouceul
I tested in x86host that bootload/system.img.raw can be mounted normally, but bootload/system.img mount failed.

I don’t know if exFAT is supported in this case (I don’t have external drives so I don’t experiment). However, ext4 is pretty much always supported. If you have a clone of the NVMe, then you could rsync that clone to a matching size file formatted in ext4 via loopback.

Incidentally, system.img.raw is a raw file and is intended for use with loopback and other more direct access methods. This would be formatted as ext4. system.img is a sparse format, and is designed to save space and speed up flash; the tradeoff is that you cannot loopback mount it or use it directly the way a raw file can be used. It is very unlikely the current NVMe comes from a system.img or system.img.raw due to the NVMe not being ext4.

Hi linuxdev
If I dump nvme and find that I can’t mount dump data, what should I do next?
I didn’t set the nvme format to exFAT;It seems that there is a problem with the image flash to nvme.
Thank you

What was the full workflow you did to generate the rootfs and then flash?
Have you tried the minimal flavor or the desktop flavor?

Hi Dave
After I generated basic rootfs, I extracted and replaced the rootfs, then regenerated image with-- noflash, and then-- flash-only flash to nvme. After boot, I reported an error.
It is success to use sample fs, the else rootfs are not tested.
thank you

Did you get any error during generating the rootfs package or flashing?
I just don’t feel like the issue is about the rootfs.

Hi Dave
I write this cmd in script, and set ‘set -e’, did not see the script exit, should be success;
I’ll try to test it on sd card. Thank you.

Hi Dave:
I change nvme to an SD card, after Flash, I still couldn’t boot; I plugged sd card into x86 linux, and this disk couldn’t be mount.

Disk /dev/sdc: 57.95 GiB, 62201528320 bytes, 121487360 sectors
Disk model: MassStorageClass
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2DBDFF6D-ED25-4C12-BE63-A60F1D876640

Device       Start      End  Sectors  Size Type
/dev/sdc1  1472512 30832639 29360128   14G Microsoft basic data
/dev/sdc2       40   131111   131072   64M Microsoft basic data
/dev/sdc3   131112   132007      896  448K Microsoft basic data
/dev/sdc4   132008   198655    66648 32.6M Microsoft basic data
/dev/sdc5   198656   203775     5120  2.5M Microsoft basic data
/dev/sdc6   203776   203903      128   64K Microsoft basic data
/dev/sdc7   203904   205951     2048    1M Microsoft basic data
/dev/sdc8   205952   207999     2048    1M Microsoft basic data
/dev/sdc9   208000   210047     2048    1M Microsoft basic data
/dev/sdc10  210048   213119     3072  1.5M Microsoft basic data
/dev/sdc11  213120   215167     2048    1M Microsoft basic data
/dev/sdc12  215168   346239   131072   64M Microsoft basic data
/dev/sdc13  346240   347135      896  448K Microsoft basic data
/dev/sdc14  347136   413695    66560 32.5M Microsoft basic data
/dev/sdc15  413696   577535   163840   80M Microsoft basic data
/dev/sdc16  577536   578559     1024  512K Microsoft basic data
/dev/sdc17  578560   783359   204800  100M Microsoft basic data
/dev/sdc18  783360   914431   131072   64M EFI System
/dev/sdc19  914432  1078271   163840   80M Microsoft basic data
/dev/sdc20 1078272  1079295     1024  512K Microsoft basic data
/dev/sdc21 1079296  1210367   131072   64M Microsoft basic data
/dev/sdc22 1210368  1472511   262144  128M Microsoft basic data

Partition table entries are not in disk order.
✔︎ jetson_dev (master) ✗ sudo mount /dev/sdc1 tmp/
mount: /home/lw/Workspace/jetson/jetson_dev/tmp: wrong fs type, bad option, bad superblock on /dev/sdc1, missing codepage or helper program, or other error.
✗ jetson_dev (master) ✗ ls Linux_for_Tegra/rootfs/ -l
total 68
lrwxrwxrwx  1 root root     7 2月  22  2022 bin -> usr/bin/
drwxr-xr-x  3 root root 12288 9月  23 19:27 boot/
drwxr-xr-x  2 root root  4096 9月  23 19:08 dev/
drwxrwxr-x 79 root root  4096 9月  26 20:57 etc/
drwxrwxr-x  3 root root  4096 9月  23 10:55 home/
lrwxrwxrwx  1 root root     7 2月  22  2022 lib -> usr/lib/
drwxr-xr-x  2 root root  4096 2月  22  2022 media/
drwxr-xr-x  2 root root  4096 2月  22  2022 mnt/
drwxr-xr-x  4 root root  4096 9月  23 19:07 opt/
drwxr-xr-x  2 root root  4096 4月  15  2020 proc/
drwx------  2 root root  4096 2月  22  2022 root/
drwxr-xr-x  9 root root  4096 9月  23 16:58 run/
lrwxrwxrwx  1 root root     8 2月  22  2022 sbin -> usr/sbin/
drwxr-xr-x  2 root root  4096 2月  22  2022 srv/
drwxr-xr-x  2 root root  4096 4月  15  2020 sys/
drwxrwxrwt 11 root root  4096 9月  26 21:16 tmp/
drwxr-xr-x 11 root root  4096 9月  23 16:26 usr/
drwxr-xr-x 13 root root  4096 9月  23 19:19 var/

build_img.txt (130.0 KB)
flash_sd.txt (34.2 KB)

Hi,

Then after switching to SD cards, would it work with MB2 flashing (flash.sh) instead of initrd flash?

How about this?
I mean re-generating the rootfs yourself, but not re-using the sample one.

Also want to confirm that if you are using the latest 35.4.1?

yes, sdk version is R35.4.1

Hi Dave
I didn’t use flash.sh to flash sd card. I tried to dump out sd card image and found that the image I was flash was not system.img.raw.

✔︎ jetson_dev (master) ✗ sudo dd if=/dev/sdc1 of=./img.bak 
29360128+0 records in
29360128+0 records out
15032385536 bytes (15 GB, 14 GiB) copied, 796.885 s, 18.9 MB/s
The last command took 796.896 seconds.

✗ jetson_dev (master) ✗ head img.bak | xxd
00000000: 2e2f 5061 7848 6561 6465 7273 2e32 3233  ./PaxHeaders.223
00000010: 3035 392f 2e00 0000 0000 0000 0000 0000  059/............
00000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000050: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000060: 0000 0000 3030 3030 3634 3400 3030 3030  ....0000644.0000
00000070: 3030 3000 3030 3030 3030 3000 3030 3030  000.0000000.0000
00000080: 3030 3030 3133 3100 3134 3530 3435 3532  0000131.14504552
00000090: 3236 3200 3031 3131 3230 0020 7800 0000  262.011120. x...
000000a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000000b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000000d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000000f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000100: 0075 7374 6172 0030 3000 0000 0000 0000  .ustar.00.......
00000110: 0000 0000 0000 0000 0000 0000 0000 0000  ................

✔︎ jetson_dev (master) ✗ head Linux_for_Tegra/bootloader/system.img.raw | xxd
00000000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000050: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000070: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000080: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000090: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000000a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000000b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000000d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000000f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000100: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000110: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000120: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000130: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000140: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000150: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000160: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000170: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000190: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000001a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000001b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000001c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000001d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000001f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000220: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000230: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000240: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000250: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000260: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000270: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000280: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000290: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000002a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000002b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000002c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000002d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000002e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000002f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000300: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000310: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000320: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000330: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000340: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000350: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000360: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000370: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000380: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000390: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000003a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000003b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000003c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000003d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000003e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000003f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000400: 0000 0e00 0000 3800 cccc 0200 3ee5 2000  ......8.....>. .
00000410: 0907 0d00 0000 0000 0200 0000 0200 0000  ................
00000420: 0080 0000 0080 0000 0020 0000 94ec 1265  ......... .....e
00000430: 9bec 1265 0300 ffff 53ef 0100 0100 0000  ...e....S.......
00000440: d3e5 1265 0000 0000 0000 0000 0100 0000  ...e............
00000450: 0000 0000 0b00 0000 0001 0000 3c00 0000  ............<...
00000460: c202 0000 6b04 0000 39a4 dd33 aa20 4ec3  ....k...9..3. N.
00000470: bb78 1966 63b6 0495 0000 0000 0000 0000  .x.fc...........
00000480: 0000 0000 0000 0000 2f74 6d70 2f63 692d  ......../tmp/ci-
00000490: 5342 6151 4b6d 7369 6f59 0000 0000 0000  SBaQKmsioY......
000004a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000004b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
000004c0: 0000 0000 0000 0000 0000 0000 0000 0004  ................

Was this entirely created on Linux? Was there ever a VM used? If some part of this was created on a Windows partition, then it would explain the exFAT. Even if the o/s was native Linux, use of a Windows partition would also explain the exFAT. SD cards formatted in a Windows scheme would also explain this.

Hi Dave
I use flash.sh to usb flash, which is successful; I can enter rootfs normally, but there is a problem with using initrd for flash; thank you

lw@lw:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1   32G  5.5G   25G  19% /
none            3.4G     0  3.4G   0% /dev
tmpfs           3.4G     0  3.4G   0% /dev/shm
tmpfs           686M  9.9M  676M   2% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.4G     0  3.4G   0% /sys/fs/cgroup
tmpfs           686M     0  686M   0% /run/user/1000
lw@lw:~$