LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Mounting With Permission Problems (https://www.linuxquestions.org/questions/linux-software-2/mounting-with-permission-problems-566968/)

gacl 07-05-2007 07:13 PM

Mounting With Permission Problems
 
Hello,

I'm trying to back up all my documents to a USB flash drive, which is encrypted with truecrypt. I decrypt the partition as root and i mount the partition as a user with fstab, since i can't do it directly. But, i'm getting permission errors with rsync. I've tried many options like umask and uid, but. . .

/dev/mapper/truecrypt0 /mnt/sda1 reiserfs ??? 0 0

How can i make this work?

Thanks.

Gus

gacl 07-06-2007 06:17 PM

Bump!

I can mount this partition as a user OK but i can't write to it. I tried umask, user, users, uid, chmod. . .

Hern_28 07-06-2007 06:44 PM

Not sure if it works on that os.
 
Have you tried adding rw to owner,users...

gacl 07-06-2007 11:30 PM

These two give me "permission denied" if i try to copy a file:

/dev/mapper/truecrypt0 /mnt/sda1 reiserfs rw,user 0 0
/dev/mapper/truecrypt0 /mnt/sda1 reiserfs rw,users 0 0

This one i can't mount with fstab:

/dev/mapper/truecrypt0 /mnt/sda1 reiserfs rw,owner 0 0

i have to mount it as root:

mount -o rw,owner /dev/mapper/truecrypt0 /dev/sda1

which kind of defeats the purpose.

gacl 07-06-2007 11:38 PM

This:

/dev/mapper/truecrypt0 /mnt/sda1 reiserfs rw,uid=gus 0 0

won't mount with fstab either.

If i try that with root i get:

root:# mount -o rw,uid=gus /dev/mapper/truecrypt0 /mnt/sda1
mount: wrong fs type, bad option, bad superblock on /dev/mapper/truecrypt0,
missing codepage or other error

and dmesg gives me:

ReiserFS: dm-0: warning: unknown mount option "uid=1000"


/dev/mapper/truecrypt0 /mnt/sda1 reiserfs rw,umask=0000 0 0

won't mount with fstab either. If i do:

mount -o rw,umask=0000 /dev/mapper/truecrypt0 /dev/sda1

i get the same errors as with uid.

gacl 07-06-2007 11:45 PM

I also tried to chown the mount point but it changes as you mount and dismount. And i also tried to chown the . folder inside the mount point. . . no luck.

I'm trying these on two different, brand-new, UFDs . . . i doubt they're broken.

jschiwal 07-06-2007 11:53 PM

The uid, gid & umask options are for a vfat partition. As root, use chown and chmod to change permissions on a mounted partition. After that you should be able to mount it as a normal user if the fstab entry has the "user" option. I'm not sure how using truecrypt effects whether you can mount as a normal user or not.

The mount program has its suid bit set, but only allows a normal user to perform a mount if the user option is present in the fstab entry.

gacl 07-07-2007 12:06 AM

It works!

I didn't know directories could have such identity problems. . . more like multiple personalities.

Thank you so much jschiwal, i'd been sweating over this for days.

Hern_28 07-07-2007 10:16 AM

If you don't mind.
 
Thanks for letting everyone (especially jschiwal) know it works. Could you post a specific how you did it in case someone else has the same problem in the future :).

gacl 07-07-2007 11:43 AM

Well, what i've found out is that if i have mount point /mnt/sda, owned by "root", i can chown to "user" ( in other words, whatever your user name is ) and i'll be the owner of the directory. But, if i mount /dev/sda to it, the permissions change and the directory is owned by "root" again! Now, if you unmount, the directory will be owned by you again, but you need to be the owner when it's _mounted_! So, you have to chown the directory when the partition is mounted. Everytime you mount that partition it will automatically switch its permissions. In other words, the permissions for a mounted directory ( such as /mnt/sda ) are not the same as the permissions for an unmounted directory ( such as /mnt/sda ), even when they are one and the same!

Cheers.

Gus


All times are GMT -5. The time now is 05:30 AM.