kanotix.com

Hardware - what permissions for a mount point?

ryancw - 01.01.2009, 15:37 Uhr
Titel: what permissions for a mount point?
I have two 500-G hard-drives inside my computer. The only one I'm currently using is sda.
sda1: windows XP
sda2: Kanotix
sda3: home

I want to use the other hard drive, sdb, to back up my /home. Originally it contained a single ntfs partition, occupying the entire 500G. I repartitioned it to two 250G sections, with sdb1 the ntfs part, and sdb2 formatted as ext3. The sdb1 already had a mount point in fstab, called /media/sdb1, and it would mount OK. So I created a mount point in fstab for /dev/sdb2, called it /media/sdb2, and made it rw,users,noauto. I created that as root.

sdb2 now mounts OK, but users cannot write to sdb2, I guess because root is the owner of /media/sdb2? How should I make the permissions such that users can read and write to sdb2, my new backup place? Or is this inadvisable?

Thanks.
Kano - 01.01.2009, 16:42 Uhr
Titel: what permissions for a mount point?
its not the problem of the mountpoint, but the ext3 partition stores the owner, so you can do for example:

chown 1000:1000 -R /media/sdb2

when you only use the default user.
ryancw - 01.01.2009, 17:07 Uhr
Titel: Re: what permissions for a mount point?
Let me see if I understand correctly. This command will change the ownership of all files on /media/sdb2 to whatever user is currently logged on (and being a home computer, there is only one user at a time).

If I have that right, are those changes permanent? Meaning, say I backup my entire /home to sdb2. A lot of files. From 4 different users. From now on, whoever logs on and mounts /media/sdb2 can act like the owner of all those files?

Kano hat folgendes geschrieben::
its not the problem of the mountpoint, but the ext3 partition stores the owner, so you can do for example:

chown 1000:1000 -R /media/sdb2

when you only use the default user.

Kano - 01.01.2009, 17:40 Uhr
Titel: Re: what permissions for a mount point?
You should not do that with different users, thats the way for one user, for differnet ones you do

chmod 777 -R /media/sdb5
find /media/sdb5 -type f -exec chmod 666 {} \;

That makes all files world writeable, the 2nd command removes the execute flag - as that is not usefull for data files. I do not like that variant much however.
ryancw - 02.01.2009, 17:41 Uhr
Titel: Re: what permissions for a mount point?
Thanks Kano. In the end, I just left things as they were: only root can copy /home (which contains 5 users' home files) to /media/sdb2. That should be sufficient, and maybe better, since the individual users probably don't need to be messing with backups anyway. I backed it up last night as root, and it worked fine.

Kano hat folgendes geschrieben::
You should not do that with different users, thats the way for one user, for differnet ones you do

chmod 777 -R /media/sdb5
find /media/sdb5 -type f -exec chmod 666 {} \;

That makes all files world writeable, the 2nd command removes the execute flag - as that is not usefull for data files. I do not like that variant much however.

Kano - 02.01.2009, 20:28 Uhr
Titel: Re: what permissions for a mount point?
Usually you mount that then to /home, maybe renameing /home as /home.old and creating a new /home dir. Don't do that while you are in KDE, logout and do that as root in a text console. Then you can change /etc/fstab.
Alle Zeiten sind GMT + 1 Stunde
PNphpBB2 © 2003-2007