# External USB hard drive formatted E2fs/E3fs permissions

I am using Ubuntu 12.04 on a laptop computer. I have an external USB disk drive formatted E2fs/E3fs by another linux system (specifically a Linksys NSLU2 running stock Linksys firmware). From the command line as a root user, I have used 'chmod 777' on the mount point to allow me to write around 400Gb of files to this disk. When I move this USB disk drive back to the normal system the new files are visible in a directory listing, but not readable. This is because the file permissions have been screwed up (My background is simple Windows systems, so I know very little about Linux file permissions). The files newly written by the laptop show the owner as 'username'. Older files written by the NSLU2 (the normal intended host for the disk drive) and accessed correctly show the file owner as '501','1000', '2000' etc.

I have tried to use Nautilus to change the file permissions to those expected, but Nautilus will only allow me to select owner names from a pre-defined list, not including the ones that I want. When I try to add a user to the Ubuntu system with the desired user name (to allow Nautilus to offer the correct choice) I get an error message I do not understand - I suspect that Ubuntu does not like these numeric usernames because a bit of research suggests that they are used for special purposes in other Linux systems.

How do I fix the file permissions on this external disk - specifically owner and group names?

Thanks, Peter

The NSLU2 has its own users. These do not match the Ubuntu system, so you have to use the UID's and GID's of the NSLU2 (501, 1000, 2000, as you wrote). Using names when you change ownership of the files will not work. You could have copied the files over the network to prevent it, but that would have been a much slower process.

Plug the disk that belongs on the NSLU2 into your Ubuntu computer. Locate the files you copied to the NSLU2's disk. Change the owner and group to the numeric UID and GID appropriate for the NSLU2. For example...

chown 1000:1000 filename.ext

If you know the right UID and GID for the NSLU2 files, and if you copied those files to the NSLU2 with Ubuntu, then you may be able to find your copied files and change ownership in one line:

find /media/nslu2 -user peter -exec chown 1000:1000 {} \;

The mount point is /media/nslu2; the Ubuntu username that was used to copy the files was peter; the correct UID and GID for the NSLU2 files is 1000.

Caution

You might want to see what that find command actually finds first before passing the "-exec" switch.

find /media/nslu2 -user peter

Better Firmware

There is a firmware replacement for the NSLU2 (unslung) that can provide SSH access to the NSLU2.

• Thank you for your prompt and useful reply. I've learned something new and useful today. Peter – Peter Miller Dec 31 '12 at 11:59