accessing files on an external ext3 formatted hard drive that were created by a different installation of ubuntu

Asked by asu on 2008-07-16

Months ago I took an external HDD and formatted it as ext3. The idea being if I have it as ext3 instead of FAT32 (it's original format) I could protect my files from unauthorised users accessing and seeing them. The computer was an old PC which I installed Ubuntu (Gusty) on. I backed up all my important documents on to this external drive.
 Since then, the computer has died and I've replaced it with another. The new one has Ubuntu (Hardy) installed, but unfotunately when I plug in the external HDD I can't access some of the directories or open files. If I do an ls -l it shows the ower of the directory/files as "1000".

I have the same username as the user who created the files in the first place.

How can I recoved the files and take ownership of them ?

- Thanks in advance for your help -
I hope to respond to any suggestions before the end of the week (long story).

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Solved by:
Tobias Wolf
Last query:
Last reply:
Tobias Wolf (towolf) said : #1

On the filesystem the username is not used for ownership. The numerical uid is used for ownership.
The first user is normally uid 1000, second user 1001, and so on.
You curreent user has a different uid than 1000, so the files don’t bleong to your user.

You can re-own all the files on the disk to you with sudo.

sudo chown -R asu:asu /media/disk-1

Best Tobias Wolf (towolf) said : #2

BTW. The protection in this is laughable and ineffective.

asu (sayed-uddin) said : #3

Hi Tobias, thanks for your reply it was very useful. I also found that when I create a new user, I can select the user id number to be anything I want it to be.