1

I have a hard drive disk with one sector:

Disk /dev/sdc: 160.0 GB, 160041885696 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63   312581807   156290872+  83  Linux

I read about ext4 mount options here.

I try execute command:

sudo mount /dev/sdc1 first/ -o resuid=1000

1000 it is uid of my profile, but owner of directory is root.

ll first/
total 8
drwxr-xr-x  2 root root 4096 янв.  30 21:17 ./
drwxr-x---+ 4 root root 4096 янв.  30 21:17 ../

Logs, last line:

[ 1516.665370] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: resuid=1000
1

Unlike e.g. NTFS or FAT ext4 supports Unix style permissions so the UIDs are stored in the file system and can't be changed by mount options.

If your disk is mounted on first/ use

sudo chown 1000 --recursive first/ 

to make UID 1000 the owner of all files and folders on that partition.

By default 5% of a ext4 file system are reserved for root. With the resuid option you can specify another user instead of root who is allowed to use this 5%. It doesn't affect the ownership of the files on the partition.

  • And repeat it after every start Ubuntu? – Rokker Ruslan Jan 30 '15 at 18:01
  • No, you need to do it just once, just like the files on your system partition or in your home folder. New files will belong the the users who created them, just as usual. – Florian Diesch Jan 30 '15 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.