Encountering USB Permission Issues After Cloning Jetson NVMe Drive

Hello everyone,

JetPack SDK 5.1.1

I’ve recently been attempting to use thel4t_backup_restore.shtool to clone my Orin NX NVMe drive onto another NVMe drive. The cloning process itself went rather smoothly, but upon booting from the new NVMe drive, I’ve encountered permission issues with my USB flash drive (Transcend).

When I try to access the Transcend USB flash drive, the system prompts: “You do not have the necessary permissions to view the contents of ‘Transcend’.”

I know this issue can be resolved by adjusting the permissions. However, it’s not practical for batch production where each device would require individual permission adjustments.

I want to inquire if there is a solution or alternative method available to resolve this issue.

thanks

additional:
I use this command to perform a backup:

sudo ./tools/backup_restore/l4t_backup_restore.sh -b jetson-orin-nano-devkit

restore:

sudo ./tools/backup_restore/l4t_backup_restore.sh -r jetson-orin-nano-devkit

Hi,

so the issue is not present before backup/restore?
I don’t think cloning the storage device is going to change the permission setting.

Hi DaveYYY,
Thank you for your reply.

Yes, that’s correct. On the NVMe drive that was backed up (Drive A), there were no USB Transcend access permission issues, whether before or after the backup.

When I cloned from Drive A to Drive B, Drive B began encountering USB Transcend access permission issues.

I’m also puzzled as to why this issue is occurring.

Then will it happen when cloning and restoring is done on the same drive?

Hi DaveYYY,

I’ll give it a try and let you know how it goes.

thanks

Hi DaveYYY,

I attempted to backup and restore the same device and NVMe drive, and still encountered the issue with USB Transcend access permissions.

thanks

Then is the situation the same for all USB drives you have?

Hi DaveYYY,

Yes, all of my usb drivers has the same situation,including Transcend SanDiskorKingSton.

Thanks

Hi,

Can you still access the USB drive inside terminal?
Or you cannot even mount it?
What do you have with ls -l inside the partition before and after backup/restore?

Hi DaveYYY,

I cannot directly access the USB driver via the terminal without the necessary permissions.

before backup:

nx@nx-desktop:~$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0          7:0    0    16M  1 loop /media/nx/L4T-README
sda            8:0    1  57.3G  0 disk 
└─sda1         8:1    1  57.3G  0 part /media/nx/030E54D2519FDEE1
zram0        251:0    0   1.9G  0 disk [SWAP]
zram1        251:1    0   1.9G  0 disk [SWAP]
zram2        251:2    0   1.9G  0 disk [SWAP]
zram3        251:3    0   1.9G  0 disk [SWAP]
nvme0n1      259:0    0 894.3G  0 disk 
├─nvme0n1p1  259:1    0 893.5G  0 part /
├─nvme0n1p2  259:2    0    64M  0 part 
├─nvme0n1p3  259:3    0   448K  0 part 
├─nvme0n1p4  259:4    0    32M  0 part 
├─nvme0n1p5  259:5    0    64M  0 part 
├─nvme0n1p6  259:6    0   448K  0 part 
├─nvme0n1p7  259:7    0    32M  0 part 
├─nvme0n1p8  259:8    0    80M  0 part 
├─nvme0n1p9  259:9    0   512K  0 part 
├─nvme0n1p10 259:10   0   300M  0 part 
├─nvme0n1p11 259:11   0    64M  0 part 
├─nvme0n1p12 259:12   0    80M  0 part 
├─nvme0n1p13 259:13   0   512K  0 part 
└─nvme0n1p14 259:14   0    64M  0 part 
nx@nx-desktop:~$ cd /media/nx/
nx@nx-desktop:/media/nx$ ls -l
total 40
drwxrwxrwx 1 nx nx 24576  七  31  2023 030E54D2519FDEE1
drwxr-xr-x 3 nx nx 16384  一   1  1970 L4T-README

after restore :

nx@nx-desktop:~$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0          7:0    0    16M  1 loop 
sda            8:0    1 115.6G  0 disk 
└─sda1         8:1    1 115.5G  0 part /media/nx/030E54D2519FDEE1
zram0        251:0    0   1.9G  0 disk [SWAP]
zram1        251:1    0   1.9G  0 disk [SWAP]
zram2        251:2    0   1.9G  0 disk [SWAP]
zram3        251:3    0   1.9G  0 disk [SWAP]
nvme0n1      259:0    0 894.3G  0 disk 
├─nvme0n1p1  259:1    0 893.5G  0 part /
├─nvme0n1p2  259:2    0    64M  0 part 
├─nvme0n1p3  259:3    0   448K  0 part 
├─nvme0n1p4  259:4    0    32M  0 part 
├─nvme0n1p5  259:5    0    64M  0 part 
├─nvme0n1p6  259:6    0   448K  0 part 
├─nvme0n1p7  259:7    0    32M  0 part 
├─nvme0n1p8  259:8    0    80M  0 part 
├─nvme0n1p9  259:9    0   512K  0 part 
├─nvme0n1p10 259:10   0   300M  0 part 
├─nvme0n1p11 259:11   0    64M  0 part 
├─nvme0n1p12 259:12   0    80M  0 part 
├─nvme0n1p13 259:13   0   512K  0 part 
└─nvme0n1p14 259:14   0    64M  0 part 

nx@nx-desktop:~$ cd /media/nx/030E54D2519FDEE1
-bash: cd: /media/nx/030E54D2519FDEE1: Permission denied

nx@nx-desktop:~$ ls -l /media/nx/
ls: cannot open directory '/media/nx/': Permission denied
nx@nx-desktop:~$ sudo ls -l /media/nx/
total 24
drwxrwxrwx 1 nx nx 24576  九   8 18:01 030E54D2519FDEE1

this is restore log:
restoreLog.txt (98.5 KB)

thanks

Hi,

what if you mount the USB drive under a different path?
It can be configured via GNOME Disks.

Or check if both /media/ and /media/nx/ are owned by you.

Can you give an exact command example which fails? For example, “cd” to some location, or “ls” of a location? Or is the command one of executing content on the drive?

I believe that after recovery, the NVMe drive missing permissions for /media and /media/nx.

These are owned by root.
Screenshot from 2022-09-08 18-16-40

I know I can change the owners using sudo chown , but my question is, why do the permissions change after recovering from a cloned image?

Changing to another path is workable and can access the PATH.

thanks

Hi,

Insert the USB flash drive:

Screenshot from 2022-09-08 18-47-32

thanks

So this is entirely because “other” permission does not exist, while group and owner are root. On the original system, what do you see from:
sudo ls -ld /media
sudo ls -ld /media/nx/

Normally “/media” is used for hot-plug SD card and thumb drives, and mount is automatic under the user’s name or UID. If the automount system is involved, then it might be misbehaving when a preexisting location exists. Is your user name “nx”? Is that what you see when you run the command “whoami”?

You can mount a raw clone and examine it. Similar to what I asked above for ls -ld of “/media” and “/media/nx”, can you do the same thing with the clone? I don’t know if this is a raw clone or a sparse clone, but if it is raw, then you can do this from the PC you flash from at the location of the clone. I’ll pretend the clone is named system.img.raw, but adjust for it; if it is only a sparse clone, and you don’t have the raw clone still (the original clone command creates an image of “somename.img” and “somename.img.raw” (using the name in your clone command instead of “somename”). An example of examining the raw clone:

sudo mount -o loop somename.img.raw /mnt
cd /mnt
ls -ld ./media
sudo ls -ld ./media/nx
cd -
sudo umount /mnt

What I’m doing is looking for the exact permissions on the recipient of the clone. Then the exact permissions on the original system. And finally, the exact permissions which the clone recorded. Either permissions diverge or the user diverges.

Hi,
Thank you for your reply.
In the original NVMe, the permissions for /media and /media/nx are owned by root.
Screenshot from 2022-09-08 20-02-58

Whether it’s the original NVMe or the cloned NVMe, when I run whoami, the owner is nx.

I’m sorry, I’m not sure what you mean by system.img.raw.
The only system.img.raw I have was built using $JETPACK/source/public/nvbuild.sh -o $KERNEL_OUT.
I don’t have a system.img.raw from the clone.
I only have these files that were cloned using /tools/backup_restore/l4t_backup_restore.sh.

thanks

Is the “nx/” part of “/media/nx” something that is part of a pre-created subdirectory, and the device mounts onto that point, or is the mount point instead /media, whereby the “nx/” is created by the device being mounted? The base /media always exists with Ubuntu, and those permissions are valid. The part which is preventing access is the “nx/” subdirectory. Thus, we need to figure out where the “nx/” is from…either (A) mount point, or (B), the mounted device.

What is the exact size of the clone file? For example, “ls -ld system.img”? I ask because both sparse and raw clones work for flash, but you need the raw clone for loopback mount. A raw clone is the exact byte size of the partition, whereas the sparse clone is smaller, and its size increases and approaches the raw clone size as the filesystem fills up. I’m hoping to find out the permissions present on the clone itself. In theory the permissions are right somewhere in the chain of source to destination, but changes somewhere and loses the “other” permission for r-x. If we can loopback mount a clone (by any name), then we can find out.

Hi,

I’ve solved the issue, thanks for your help.

Based on your reply, I found that /media/nx is automatically created when I plug in a USB flash drive. When I clone the system with /media/nx present, and then restore it to another NVMe drive, I encounter permission issues.

I deleted /nx before cloning, and after restoring and plugging in the USB flash drive again, the system automatically creates /nx without any permission issues.

Thanks again for your assistance.

Regards,

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.