[PLUG] fstab hell(p)

Paul Mullen pm at nellump.ath.cx
Mon May 15 19:27:23 UTC 2006


On Mon, May 15, 2006 at 11:55:03AM -0700, Michael M. wrote:

> How do I look at the permissions set on the file system? I don't 
> understand the distinction between the permissions of a mount point, a 
> directory, a file, and a file system.

A mount point is just a directory on another file system (any file
system that isn't the one you're trying to mount). Typically, mount
points live on the root file system. The mount point, being just
another directory, has its own permissions settings, but these don't
have any effect on what you can and cannot do to a file system once
it's been mounted there. Once you've actually mounted a file system to
a mount point, the permissions that used to be set on the mount point
(when it was just a lonely directory) magically disappear, and the
permissions of the root level of the mounted file system take their
place. The mounted file system effectively "masks off" the original
directory being used as the mount point.

> The fstab entry, currently, is:
> /dev/sdb1 /mnt/library ext3 defaults,users,rw,noauto 0 2

Unless you want to be able to mount and unmount the "library" file
system as a normal (non-root) user, then you don't neet the "user"
option in your fstab (it's "user", not "users"). And if you want the
file system automatically mounted when the system starts up, then
remove the "noauto" option. Finally, "defaults" implies "rw", so it's
not necessary to include. But it looks like you may know all this
already.

> But when I try to create a file as a user, I get 'permission denied.'

That's because only root has write permissions to the filesystem. If
you don't have a firm grasp on *nix file system permissions, the LDP
has decent overview in their intro guide:
<http://www.tldp.org/LDP/intro-linux/html/sect_03_04.html>

> So if I change the ownership of /mnt/library to my own user and group, I 
> would be able to write to the directory or partition or filesystem or 
> however you want to phrase it?

Yes, that would work, *if* you make those changes after the file
system has been mounted.

Try this, as root, with the file system mounted:
1) cd /mnt/library
2) mkdir mikes_stuff
3) chown mcubed. mikes_stuff

Your normal user account should be able to read and write to the new
"mikes_stuff" directory.

-- 
Paul



More information about the PLUG mailing list