Error when installing SSD on nvidia jetson nano

Hi,

When I try installing SSD on jetson nano I always comes accross this error when initiating this ./copyRootToUSB.sh -p /dev/sda1

Error:

" libqt5positioning5 libqt5printsupport5 libqt5qml5 libqt5quick5
libqt5quickwidgets5 libqt5sensors5 libqt5sql5 libqt5test5 libqt5webchannel5
libqt5webkit5 libxcb-composite0 libxcb-cursor0 libxcb-damage0 libxss1
os-prober python3-dbus.mainloop.pyqt5 python3-icu python3-pam python3-pyqt5
python3-pyqt5.qtsvg python3-pyqt5.qtwebkit python3-sip
qml-module-org-kde-kquickcontrolsaddons qml-module-qtmultimedia
qml-module-qtquick2 rdate tasksel tasksel-data
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
699,660,196 35% 9.05MB/s 0:01:13 (xfr#8366, ir-chk=1108/11791)
rsync: write failed on “/media/moon/SSD/home/moon/.local/share/Trash/files/rootOnUSB.2/.git/objects/8d/9bf1994688e0f8c844712fc9cd6ee2abfef3ca”: Read-only file system (30)
rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.2]"

Need help in solving this error

You need to mount the partition with write enabled. What do you see from:
grep sda1 /etc/mtab

This is what I see;

/dev/sda1 /media/5c3f4328-d1d1-43d0-b844-7b5f48532a92 ext4 rw,relatime,stripe=8191,data=ordered 0 0

That is odd. It is already read-write.[quote=“bvgohmslf, post:1, topic:158422”]
/media/moon/SSD/home/moon/.local/share/Trash/files/rootOnUSB.2/.git/objects/8d/9bf1994688e0f8c844712fc9cd6ee2abfef3ca
[/quote]

It seems that the mount point itself may be read-only. What do you see from:

ls -ld /media/moon/SSD/home/moon/.local/share/Trash/files/rootOnUSB.2/.git/objects/8d/9bf1994688e0f8c844712fc9cd6ee2abfef3ca

Also, is that point owned by a different user? If so, does sudo help?

Sudo doesn’t help. I attached a photo of what I did and where the error arises while applying what you suggested.

There we go: “No such file or directory”. Btw, you can copy and paste rather than taking a snapshot. Text is easier to work with.

I don’t use the copyRoorToUSB.sh, but it is assuming there is a directory there. However, as it turns out, this time I see it naming this location as read-only, so the other location may not matter, or may be a moving temporary target:

/media/moon/SSD/home/moon/src/protobuf-3.8.0/src/google/protobuf/util/internal/.libs/datapiece.o

So let’s look at this most recent file location, as this should be constant. Can you (with or without sudo):

cd /media/moon/SSD/home/moon/src/protobuf-3.8.0/src/google/protobuf/util/internal/.libs/

If you can, then what do you see from:

ls -ld .
ls -ld datapiece.o
df -H -T .
touch deleteme.txt
rm deleteme.txt

I’d like to find out where this is read-only. You could drop down one directory and try again if the above directory is read-only. Each time you step back with one less subdirectory you might hit a location you can write to. The first writable subdirectory, and the beginning of an unwritable subdirectory needs to be discovered.

What do you use?

I use rsync and/or recursive copy with preservation of all permissions and numeric IDs. This won’t help if the directory does not exist.

Kindly show me how?
I continue to get errors when using the script from jetsonhacks quite frankly. and I really want my system to run from an SSD.

Building dependency tree
Reading state information… Done
rsync is already the newest version (3.1.2-2.1ubuntu1.1).
The following packages were automatically installed and are no longer required:
apt-clone archdetect-deb bogl-bterm cryptsetup-bin dpkg-repack
gir1.2-timezonemap-1.0 gir1.2-xkl-1.0 grub-common kde-window-manager kinit
kio kpackagetool5 kwayland-data kwin-common kwin-data kwin-x11
libdebian-installer4 libkdecorations2-5v5 libkdecorations2private5v5
libkf5activities5 libkf5attica5 libkf5completion-data libkf5completion5
libkf5declarative-data libkf5declarative5 libkf5doctools5
libkf5globalaccel-data libkf5globalaccel5 libkf5globalaccelprivate5
libkf5idletime5 libkf5jobwidgets-data libkf5jobwidgets5 libkf5kcmutils-data
libkf5kcmutils5 libkf5kiocore5 libkf5kiontlm5 libkf5kiowidgets5
libkf5newstuff-data libkf5newstuff5 libkf5newstuffcore5 libkf5package-data
libkf5package5 libkf5plasma5 libkf5quickaddons5 libkf5solid5
libkf5solid5-data libkf5sonnet5-data libkf5sonnetcore5 libkf5sonnetui5
libkf5textwidgets-data libkf5textwidgets5 libkf5waylandclient5
libkf5waylandserver5 libkf5xmlgui-bin libkf5xmlgui-data libkf5xmlgui5
libkscreenlocker5 libkwin4-effect-builtins1 libkwineffects11
libkwinglutils11 libkwinxrenderutils11 libqgsttools-p1 libqt5designer5
libqt5help5 libqt5multimedia5 libqt5multimedia5-plugins
libqt5multimediaquick-p5 libqt5multimediawidgets5 libqt5opengl5
libqt5positioning5 libqt5printsupport5 libqt5qml5 libqt5quick5
libqt5quickwidgets5 libqt5sensors5 libqt5sql5 libqt5test5 libqt5webchannel5
libqt5webkit5 libxcb-composite0 libxcb-cursor0 libxcb-damage0 os-prober
python3-dbus.mainloop.pyqt5 python3-icu python3-pam python3-pyqt5
python3-pyqt5.qtsvg python3-pyqt5.qtwebkit python3-sip
qml-module-org-kde-kquickcontrolsaddons qml-module-qtmultimedia
qml-module-qtquick2 rdate tasksel tasksel-data
Use ‘sudo apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 45 not upgraded.
10,588,268,150 95% 27.02MB/s 0:06:13 (xfr#37366, ir-chk=1946/46023)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.comicsdocument.evince-backend.YQ0V29” failed: Bad message (74)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.djvudocument.evince-backend.gwkVpi” failed: Bad message (74)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.dvidocument.evince-backend.2K6vLM” failed: Bad message (74)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.libcomicsdocument.so.cUjreM” failed: Bad message (74)
10,591,940,237 95% 27.02MB/s 0:06:13 (xfr#37509, ir-chk=1009/46167)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.libdjvudocument.so.jx0vW2” failed: Bad message (74)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.libdvidocument.so.QnBxQr” failed: Bad message (74)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.libpdfdocument.so.lr7IoT” failed: Bad message (74)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.libpsdocument.so.2Y71fj” failed: Bad message (74)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.libtiffdocument.so.DPjxNJ” failed: Bad message (74)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.libxpsdocument.so.0IgAld” failed: Bad message (74)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.pdfdocument.evince-backend.PiEjAH” failed: Bad message (74)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.psdocument.evince-backend.AMhKaa” failed: Bad message (74)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.tiffdocument.evince-backend.1JHtrD” failed: Bad message (74)
rsync: mkstemp “/media/19230ebf-0616-4f4a-89a5-54e2e11f5576/usr/lib/aarch64-linux-gnu/evince/4/backends/.xpsdocument.evince-backend.84med6” failed: Bad message (74)
19,533,465,942 97% 24.93MB/s 0:12:27 (xfr#157366, to-chk=0/214212)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]

Even when it finishes it shows the above errors

I am not familiar with the script. If you can provide a URL to it, then it might help, but I’ll give some general information.

First, when you use rsync, then I highly recommend using the option “do not cross filesystems”. Let’s say in a naive case you were to use rsync to back up all of “/media” to the SSD, and the SSD is itself mounted there…you could have a bit of a recursive logic error there. This option is the “-x” (or “--one-file-system”) option. If you need to back up multiple mount points where one mount point is inside the other, then you could do this with two rsync commands (at least while building up your rsync command options I recommend not combining two filesystems in a single command).

Next, always back up with “numeric” IDs. There are times when two separate systems are involved, and their user names and IDs differ. In theory, if you ignore numeric IDs on the local system, then there is not an issue. But what happens if your local system itself held backup content for some other system, and that backup used numeric IDs and names which don’t exist on the current system? There would be a translation which breaks some restore abilities. It is just safer to always rysnc with numeric IDs. The one exception is if the rsync must be without sudo since only root can preserve numeric IDs and the IDs of other users (but you are using sudo anyway). The option for rsync to preserve numeric IDs is the “--numeric-ids” option.

If you are performing an rsync over a network, then you might want to use compression. You probably don’t need compression locally. The result will be the same, only time will change so long as you have enough RAM.

I tend to use rsync over ssh, but I’ll pretend this is with an SSD mounted on a Jetson.

Most of “/dev” is generated at run time via udev and will not be an actual file, and you should not back up udev dynamic files. However, during boot, prior to udev running, there might be some static nodes. You can get that from the host PC’s directory which you used for flashing. Your host PC will have a directory “~/nvidia/nvidia_sdk/JetPack...version.../Linux_for_Tegra”, and a subdirectory to that, “rootfs/”. The “Linux_for_Tegra/rootfs/dev” content can be used to create what is needed after the rest of the SSD content is added.

The “/proc” and “/sys” directories are not real directories, and contain only metadata generated by the kernel. These do not get backed up. The “--one-file-system” (or “-x”) option will prevent this from being picked up by accident.

Symbolic links must be preserved, and has a couple of ways to do this. The “archive” mode is recommended for this (option “-a” or “--archive”). It does not hurt to also include other options for preserving symbolic links, and in case I forget something, I usually use this option as well (the “-l” or “--links” option). Either would do the job, but I choose redundancy in case I forget something.

Some parts of “/var” are mandatory, e.g., the dpkg database of installed packages. It is easier to just copy everything there. You don’t need all of the log files, and that content is significant, but compared to the SSD size this is not usually a problem. If it were a problem, then you’d want to manually exclude the log files. You can check out the man page for rsync, and you’d want to check out these options:

  • --exclude=PATTERN
  • --exclude-from=FILE
  • --include=PATTERN
  • --include-from=FILE

A special case of exclude which I want to mention is related to these directories and/or content:

  • --exclude '.gvfs'
    The ‘.gvfs’ content is a special method of GUI desktop apps talking to each other, e.g., via the copy and paste mechanism. This cannot be read, even by root, unless the security mechanism is happy with the operation. This is also not a “real” file and should always be ignored.
  • --exclude 'lost+found'
    This is part of the filesystem metadata, and is specific to that one exact partition. Content here only occurs if part of the filesystem is lost from corruption which the journal cannot handle. Never back this up for restore to another disk/partition.

Note that you can create a list of files to exclude or include (think of it as something you refine over time), and use the files instead of naming the include/exclude on command line for every file.

One of the most valuable options to rsync is to tell rsync to do nothing and just echo what it would do if it were really doing something: “--dry-run”. Don’t be afraid to experiment so long as you use “--dry-run”.

I use the option for verbose, “-v”. You can eliminate this if you want.

Larger/longer rsync commands might make you curious about status as it goes through the rsync. If you like to have information as you go, then you might use option “--info=progress2,stats2”.

If your destination hard drive already has content, then the normal rsync method would be to copy replacement content in prior to removing old content (in case it fails). This could also cause the command to fail when running low on space. I am not worried about old content, and so I use the option “--delete-before”. I will ignore this option, but feel free to add it if you want to minimize required resources during the rsync.

The option “-P” is useful if the rsync might get interrupted. Large “partial” files can be used to continue after restarting rsync. A good example is that if you have a file which is 16GB in size, then there is an interruption, you would need to start over on that file (imagine doing this over an unreliable WiFi to a remote host, or a case where electric power might interrupt). It doesn’t hurt to include “-P” (and I like copy and paste), so I just add it in.

I won’t cover ssh options since I think you are mounting the drive locally. I actually use ssh keys for my logins, and can log in directly to root without sudo (allowed only by keys), and this greatly simplifies rsync to remote hosts. This does take a bit of setup, though it isn’t actually all that bad. Working directly from the Jetson prevents needing this.

You won’t be using SElinux ACLs on the Jetson, but if you were to back up to a remote host PC (which probably does have some ACL content even if not enforcing), then you’d use the “-A” (or “--acls”) option. Just ignore this if using rsync to a drive locally mounted to the Jetson. Similar for the related “extended attributes”, “-X” (or “--xattrs”). However, keep in mind that if the filesystem has no such attributes or ACL, then there is no harm in enabling these options. You can enable them, and if they don’t apply, it won’t matter. I tend to always use them because I can quickly copy and paste and the command will be correct regardless of whether I am working directly on a Jetson or if I am using rsync to/from a remote host which does pay attention to those options.

If your SSD partition is empty and mounted on “/media/ssd” (I’m simplifying to type this out, but substitute where you actually have this mounted at), then this would be the first command you might be interested in (I drop into a root shell since everything should be via sudo):

sudo -s
rsync --dry-run -avcrltxAP --info=progress2,stats2 --numeric-ids --exclude '.gvfs' --exclude 'lost+found' '/' /media/ssd
# If --dry-run looks ok:
rsync -avcrltxAP --info=progress2,stats2 --numeric-ids --exclude '.gvfs' --exclude 'lost+found' '/' /media/ssd
# ...do what you need to to recursively copy (with preservation of ownership and permissions) the "`Linux_for_Tegra/rootfs/dev/`" content to "`/media/ssd/dev`". You need to be root (`sudo`) before you can copy or create this type of file.

FYI, before starting you might look at the output of “df -H -T”. Only the content listed as “ext4” would be of interest. “/dev” shows as a pseudo filesystem, and should not be copied. What the command won’t tell you is that if you were to umount the “/dev” mount point, then there would be some actual device special files still there (the mount of the udev content hides what is under this, but if you were to umount, then what would show up is the host PC’s “Linux_for_Tegra/rootfs/dev/”).

Ran into this error while trying to boot to SSD after transferring all files to the SSD.

It was waiting for the root filesystem. Meaning the partition was not found. Do keep in mind that the rootfs is usually specified via the extlinux.conf file, within the “APPEND” key/value pair. There would be a “rootfs=...something...”. If the extlinux.conf is not found, then you would have this problem, or if the extlinux.conf named the wrong partition. What people often don’t realize is that with alternate boot media you probably have two relevant extlinux.conf files. Don’t know for sure, but make sure that the extlinux.conf of both the original filesystem and the SSD point to the right place.

One extlinux.conf on one device might be read even though the rest of the content is from the other device. By far the safest way to do this is to add alternate boot entries on both of the devices’ extlinux.conf, and then use serial console to pick the right one. Make the labels of each such that you know which boot device extlinux.conf is being read.

Be sure you get your rootfs partition UUID with:

lsblk -o NAME,PARTUUID

The UUID used for automount in /media may be different.

will try them out

Hey @Honey_Patouceul, @linuxdev,

This what I see when check the UUID, which is the right one.
I want to be sure I’m doing the right thing

Not 100% sure for your case I haven’t tried, but if you want to boot with sda1 rootfs, you would adjust in your extlinux.conf a config with rootfs partition UUID as shown by lsblk:

APPEND ${cbootargs} root=PARTUUID=e52db...

Applied the change in extlinux of both the sdcard and SSD. this worked for me thanks