# Ext3 filesystem options. [SOLVED]

## Aquiles

Hello everybody,

I was trying to mount an ext3 filesystem and, since I want it to be readable and writable by my user, I tried something like

```
 mount -t ext3 uid=1000,gid=1000 /dev/hda1 /home/user/mnt
```

After not working I've checked the man page of mount, and I've been surprised to see that the ext3 filesystem does not support the gid= and uid= options that ext2 does.

So my question is: how do I get to make the mounted ext3 filesystem user-readable/writable? Oh, and I want to mount it as root (i.e, mounting it as a user with the "user" option is not what I want; what I want is to mount it as root, but making it readable/writable to a specific user and to no one else).

Thank you all!

----------

## BradN

Hmm, I've always specified the uid= and gid= by name, not number.  Not sure that would matter.  I can't see why ext3 wouldn't support it though... it seems like a kinda basic function.  Then again, ext3 supports actual permissions in the filesystem, so maybe you could handle it like that?  I always thought the uid=, etc options were more useful for filesystems that didn't otherwise support unix permissions.

----------

## mottmar

if the partition is mounted with rw (which is the default AFAIK, anyway you can check in /etc/mtab) you'll only have to adjust permissions for the files/directories you want the user(s) to be able to write. e.g. if you mount /mnt/foo and want user baz to write in it, just 

```
# chown -R baz /mnt/foo
```

or else create a group, let's say foowriters, and

```
# chgrp -R foowriters /mnt/foo
```

then add the users to the foowriters group.

----------

## Aquiles

Ok my falut. I read too fast through the man page. The ext3 filesystem supports the options of ext2 plus several others. So now my question is why the hell this is not working. I'll go through it...

----------

## jcat

If the purpose of you using this option is to allow a particular user to read and write to this partition, don't bother.  Just use the rw option!

Cheers,

jcat

----------

## Aquiles

Well, the truth is that I didn't explain the problem in its context. I am not actually trying to mount just an ext3 filesystem. What I am trying to do is mounting a truecrypt (www.truecrypt.org) volume that holds an ext3 filesystem inside. When I enter

```
truecrypt --filesystem ext3 -M uid=1000,gid=1000 /dev/hda1 secure/
```

I get the following error

```

mount: wrong fs type, bad option, bad superblock on /dev/mapper/truecrypt0,

       missing codepage or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so

Mount failed

```

If I look at the output of dmesg I see:

```

EXT3-fs: Unrecognized mount option "uid=1000" or missing value

device-mapper: ioctl: unable to remove open device truecrypt0

```

That's why I assumed the problem was the option "uid=1000" that I was passing to mount (the -M option of truecrypt passes its arguments to mount through the -o option).

So, this is the whole thing. Now I am not so sure about wether the problem comes from mount or from truecrypt.

----------

## BradN

But still, can't you just set the directory/file permissions inside the filesystems and have it work?

----------

## Aquiles

Yeah, but the thing goes as follows. Inside /home/joan I have four folders, namely "data", "downloads", "Desktop" and "secure". I want everybody to be able to access my "downloads" directory, so I make my home directory readable and then restrict the access to the "data", "Desktop" and "secure" folders.

"secure" is the folder where I mount my truecrypt volume. When I mount it without setting its ownership to my user, the folder "secure" automatically belongs to root-root. So if I want to be able to read/write inside it with my user, I have to set permissions for everyone. And it is an inconvenience since everyone can access my home folder, and thus also my "secure" folder when it is mounted.

I know I could just put the "secure" folder inside "data" or just create a "fake" folder under /home/user, put "secure" inside "fake", and mount the truecrypt volume on "secure". Then I could restrict access to "fake", so only I could enter it, and the permissions of "secure" would no longer be a problem. But still, I guess I prefer to know why the hell I get the error when trying to set the ownership properly.

----------

## jcat

Why not just chown the secure folder?

Cheers,

jcat

----------

## Aquiles

Yeah, actually the secure folder belongs to my user. But as soon as I mount the truecrypt volume on it, the ownership changes to root-root, since I mount the volume as root. That is why I was trying to use the uid= and gid= options to mount the volume.

----------

## mottmar

you have to chown the folder when it's mounted: permissions on the mountpoint directory are substituted when you mount...

then if you chmod -R 600 only your user will be able to look into it.

----------

## jcat

Yup, do it after the mount.

Are you saying this get's over-written after each mount??

Seems weird, but I guess you could always script a chown after mount.

Cheers,

jcat

----------

## Aquiles

Ok now it works!!! I changed the ownership of the secure folder once mounted. After a remount it was still mine, so now I got it. It's weird because I could have sworn that I already tried this...

Anyway, thank you so much for your point!

----------

## jcat

Hehe, glad it's sorted.

Cheers,

jcat

----------

