FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-04-2008, 08:19 AM
Brad Rogers
 
Default USB HD permissions query

Hello All,

I'm curious as to why, when I change the filesystem type to ext3 on a
USB hard drive, I cannot write to the drive from normal user space,
only root access is allowed.

Changing the filesystem back to VFAT allows the writes to proceed
without problem. A bit of investigating shows that as ext3 the drive
gets mounted root/root, but as VFAT it gets mounted as
<username>/root. So, that explains the read only status, but it does
beg the question; Why the difference in UID/GID when changing
filesystems?

--
Regards _
/ ) "The blindingly obvious is
/ _)rad never immediately apparent"

It's your life so go your own way
Questions And Answers - Sham 69
 
Old 02-04-2008, 08:53 AM
Magnus Therning
 
Default USB HD permissions query

Brad Rogers wrote:
> Hello All,
>
> I'm curious as to why, when I change the filesystem type to ext3 on a
> USB hard drive, I cannot write to the drive from normal user space,
> only root access is allowed.
>
> Changing the filesystem back to VFAT allows the writes to proceed
> without problem. A bit of investigating shows that as ext3 the drive
> gets mounted root/root, but as VFAT it gets mounted as
> <username>/root. So, that explains the read only status, but it does
> beg the question; Why the difference in UID/GID when changing
> filesystems?

With ext3 on the USB HD you end up having to treat it just like a
“static HD”, i.e. you have to make sure that the permissions on the
directory allows your user to write. In short, use chmod or chown :-)

VFAT doesn't have permissions in the Unix sense (in any sense really).
instead the permissions are set disk-wide at mount time. You can
influence that through 'mount' options; -o uid=<user>,gid=<group>. See
the “fat” portion of mount(8) for more details.

/M

--
Magnus Therning (OpenPGP: 0xAB4DFBA4)
magnus*therning.org Jabber: magnus.therning*gmail.com
http://therning.org/magnus

What if I don't want to obey the laws? Do they throw me in jail with
the other bad monads?
-- Daveman
 
Old 02-04-2008, 09:10 AM
Jochen Schulz
 
Default USB HD permissions query

Brad Rogers:
>
> I'm curious as to why, when I change the filesystem type to ext3 on a
> USB hard drive, I cannot write to the drive from normal user space,
> only root access is allowed.

When mounting a filesystem on a directory, say, /mnt/test, the
filesystem's root directory "covers" the old directory /mnt/test, which
probably lives on your root filesystem. That means you're dealing with
two directories with distinct permissions. When you are using ext2/3 (or
any other UNIX file system), these permissions are stored inside the
filesystem you mount and can only be changed after mounting. When using
FAT, you have to give permissions as a mount option (if you don't want
everything to be owned root:root) because FAT doesn't know the concept
of file ownership.

J.
--
I am getting worse rather than better.
[Agree] [Disagree]
<http://www.slowlydownward.com/NODATA/data_enter2.html>
 
Old 02-04-2008, 09:16 AM
Brad Rogers
 
Default USB HD permissions query

On Mon, 04 Feb 2008 09:53:44 +0000
Magnus Therning <magnus@therning.org> wrote:

Hello Magnus,

> With ext3 on the USB HD you end up having to treat it just like a
> “static HD”, i.e. you have to make sure that the permissions on the

I wasn't aware of that. I don't know why it should be the case, but
given the above....

> directory allows your user to write. In short, use chmod or chown :-)

...this makes sense.

> VFAT doesn't have permissions in the Unix sense (in any sense really).

Yes, I was aware of that, but didn't fully understand the implications.

> instead the permissions are set disk-wide at mount time. You can
> influence that through 'mount' options; -o uid=<user>,gid=<group>.
> See the “fat” portion of mount(8) for more details.

Thanks for all the information, and references, Magnus. Hopefully, my
reading the relevant parts of the mount manual will help. Thanks also,
for the quick response.

--
Regards _
/ ) "The blindingly obvious is
/ _)rad never immediately apparent"

I'll be the paint on the side if you'll be the tin
Love Song - The Damned
 
Old 02-04-2008, 10:23 AM
Brad Rogers
 
Default USB HD permissions query

On Mon, 4 Feb 2008 11:10:53 +0100
Jochen Schulz <ml@well-adjusted.de> wrote:

Hello Jochen,

> any other UNIX file system), these permissions are stored inside the
> filesystem you mount and can only be changed after mounting. When

Ah, that's now a lot clearer. I sort of understood what Magnus wrote,
but your explanation clarifies the situation.

> using FAT, you have to give permissions as a mount option (if you
> don't want everything to be owned root:root) because FAT doesn't know
> the concept of file ownership.

As I said to Magnus, I knew that, but didn't fully comprehend the
implications.

Thanks for your help. It's greatly appreciated.

--
Regards _
/ ) "The blindingly obvious is
/ _)rad never immediately apparent"

You're the psychotic daughter of a psychotic mother
Pure Mania - The Vibrators
 

Thread Tools




All times are GMT. The time now is 05:49 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org