we have flashed SD card for Jetson Nano with JetPack image and installed libraries to it. I have taken the image using dd command. The goal is to have an image ready for production so that each device would have to install libraries but have already tested image instead.
We are aware of risks with passwords and other private data.
We’d like the image to expand itself on the first boot on the SD card.
I have added nvresizefs.sh back to /etc/systemd and added the service
cat <<EOT > nvresizefs.service [Unit] Description=Resize SD Card root partition and filesystem Before=nvfb.service [Service] Type=oneshot ExecStart=/etc/systemd/nvresizefs.sh [Install] WantedBy=multi-user.target EOT cp nvresizefs.service /etc/systemd/system systemctl enable nvresizefs.service
Now, the last command of nvresize script: resize2fs /dev/mmcblk0p1 fails with message:
Filesystem at /dev/mmcblk0p1 is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 4
What did I forget to do?
when I try to run the script when I ssh on as root then I get extra error line
resize2fs: Permission denied to resize filesystem
dmesg commad revealed this:
[ 5.055347] EXT4-fs (mmcblk0p1): warning: mounting fs with errors, running e2fsck is recommended [ 5.071447] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null) [ 5.081440] VFS: Mounted root (ext4 filesystem) on device 179:1. [ 11.008690] tegradc tegradc.0: unblank [ 11.008924] tegradc tegradc.1: blank - powerdown [ 11.512106] EXT4-fs warning (device mmcblk0p1): ext4_resize_begin:45: There are errors in the filesystem, so online resizing is not allowed [ 12.776063] wlan0: authenticate with a0:04:60:94:37:25
ubuntu@ubuntu-VirtualBox:/media/ubuntu$ sudo e2fsck -f /dev/sdb [sudo] password for ubuntu: e2fsck 1.44.1 (24-Mar-2018) ext2fs_open2: Bad magic number in super-block e2fsck: Superblock invalid, trying backup blocks... e2fsck: Bad magic number in super-block while trying to open /dev/sdb The superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem. If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device> or e2fsck -b 32768 <device> Found a gpt partition table in /dev/sdb
so did I take the image wrong? Did I flash it wrong? Why are there errors on the card to start with? Is there a way to fix them automatically when nano boots?