[PLUG] fstab hell(p)
Michael M.
nixlists at writemoore.net
Mon May 15 18:55:03 UTC 2006
Paul Mullen wrote:
> On Mon, May 15, 2006 at 11:01:10AM -0700, Michael M. wrote:
>
>
>> There has to be a way to do this, yes? Or is the only way to change
>> the ownership? One reference I have says that you should *not*
>> change the ownership of /mnt or any top-level partitions. But how do
>> I write to the damn partition then?
>>
>
> I think you're getting your terminology a bit confused. You're trying
> to mount a file system (that lives on a hard disk partition). The
> file system gets mounted to a mount point, which is just another
> directory on an already mounted file system.
>
> Have you looked at the permissions set on the file system you're
> trying to mount? Not the permissions of the mount point (those get
> overridden once the file system is mounted), but the permissions of
> the file system itself.
>
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.
The mount point is /mnt/library. The fstab entry, currently, is:
/dev/sdb1 /mnt/library ext3 defaults,users,rw,noauto 0 2
It is one primary partition on my second hard drive (sdb). I added the
"noauto" option just to see if I could write to it when I mounted it
from my user account. I would prefer, however, that it be mounted at
boot. "Users" has no effect except letting me mount it; "rw" I think is
that default anyway, so that's probably redundant. But at this point I'm
getting desperate.
This is what I get after mounting it:
mcubed at debathlon:~$ ls -al /mnt
total 12
drwxr-xr-x 3 root root 4096 2006-04-15 14:40 .
drwxr-xr-x 22 root root 4096 2006-05-15 03:12 ..
drwxr-xr-x 3 root root 4096 2006-05-15 10:21 library
mcubed at debathlon:~$ cd /mnt/library
mcubed at debathlon:/mnt/library$ ls -al
total 24
drwxr-xr-x 3 root root 4096 2006-05-15 10:21 .
drwxr-xr-x 3 root root 4096 2006-04-15 14:40 ..
drwx------ 2 root root 16384 2006-05-15 10:21 lost+found
I can write to it as root:
mcubed at debathlon:/mnt/library$ sudo touch testfile
Password:
mcubed at debathlon:/mnt/library$ ls -al
total 24
drwxr-xr-x 3 root root 4096 2006-05-15 11:48 .
drwxr-xr-x 3 root root 4096 2006-04-15 14:40 ..
drwx------ 2 root root 16384 2006-05-15 10:21 lost+found
-rw-r--r-- 1 root root 0 2006-05-15 11:48 testfile
But when I try to create a file as a user, I get 'permission denied.'
> There's probably no need to change the ownership of the root of the
> file system itself (that would be the mount point /mnt/whatever
> *after* you've mounted the file system). It might be the easiest
> route, though. I can't think of any fundamental security concern
> beyond allowing everyone else on the system to read your files.
>
>
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? Because I thought I tried that before,
and it didn't work without also changing the ownership of /mnt itself.
And that's what I thought you weren't supposed to do.
--
Michael M. ++ Portland, OR ++ USA
"No live organism can continue for long to exist sanely under conditions of absolute reality; even larks and katydids are supposed, by some, to dream." --S. Jackson
More information about the PLUG
mailing list