5

Here's my partition setup. I've shortened the UUIDs for readability, and, before anyone asks, I've carefully checked that I copied the correct UUIDs into /etc/fstab.

me@ubuntu:/$ sudo blkid
/dev/sda1: UUID="a6205dda..." TYPE="ext3" 
/dev/sda2: UUID="99397b94..." TYPE="ext3" LABEL="DATA1" SEC_TYPE="ext2"  
/dev/sda3: UUID="135523f8..." TYPE="ext3" LABEL="DATA2" SEC_TYPE="ext2" 
/dev/sda4: UUID="a1e4d70f..." TYPE="swap"

Here's how my fstab is configured:

me@ubuntu:/media/DATA2$ cat /etc/fstab
# <file system>     <mount point>   <type>  <options>               <dump>  <pass>
proc                /proc           proc    nodev,noexec,nosuid     0   0
UUID=a6205dda...    /               ext3    errors=remount-ro       0   1
UUID=99397b94...    /media/DATA1    ext3    rw,nosuid,nodev,user    0   0
UUID=135523f8...    /media/DATA2    ext3    rw,nosuid,nodev,user    0   0
UUID=a1e4d70f...    none            swap    sw                      0   0

(Does whitespace matter in fstab? For example, does each field have to be separated by a single tab? Or any number of tabs?)

I've set up the mount points for the partitions in the /media directory:

me@ubuntu:/media$ ls -al
drwxr-xr-x  4 root root 4096 Feb 18 09:17 .
drwxr-xr-x 23 me   me   4096 Feb 13 10:08 ..
drwxr-xr-x  2 me   me   4096 Feb 13 16:03 DATA1
drwxr-xr-x  2 me   me   4096 Feb 13 16:03 DATA2

Thanks to the entries in the fstab, I can mount the partitions as an ordinary user, without any problems:

me@ubuntu:/media$ mount DATA1
me@ubuntu:/media$ mount DATA2
me@ubuntu:/media$ mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
/dev/sda2 on /media/DATA1 type ext3 (rw,noexec,nosuid,nodev,user=me)
/dev/sda3 on /media/DATA2 type ext3 (rw,noexec,nosuid,nodev,user=me)

But here's the problem: DATA2 is mounted as root, which means I don't have write permissions for it. Why the difference, and what can I do to ensure DATA2 is mounted with the same permissions as DATA1?

me@ubuntu:/media$ ls -al
drwxr-xr-x  4 root root 4096 Feb 18 09:17 .
drwxr-xr-x 23 me   me   4096 Feb 13 10:08 ..
drwxrwxrwx 10 me   me   4096 Feb 18 09:20 DATA1
drwxr-xr-x  3 root root 4096 Feb 13 13:57 DATA2

For reference, I'm using Ubuntu 12.04.2 LTS. Also, the order in which I mount the partitions has no effect on their permissions; they always have the permissions shown above.

1 Answer 1

1

As the ext3 file system supports Unix style permissions the permissions stored on the file system are used, just like on your / partition.

If you want all the files in DATA2 and its subfolders to belong to the user and group me you can use

chown -R me:me /media/DATA2

to change the owner.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .