LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   mount directory ownership (https://www.linuxquestions.org/questions/slackware-14/mount-directory-ownership-522214/)

shakezilla 01-23-2007 09:28 PM

mount directory ownership
 
Working right now on getting bsd and slack running on one box, so I want to share my home directory between the two. I want to do this by having a ~60GB ext2 partition and mounting that from each OS.

My home dir in slack is /home/myname, and (before mounting) I've set it to have the following permissions, ownership:
Code:

r-x --- ---  root root
After mounting /dev/hda4 to /home/myname, I need it to have the following permissions so I can use it as my normal user:
Code:

rwx --- ---  myname users(or_whatever)
So how do you go about doing that? Do you have to do something in fstab, or am I just going to have add a line in rc.d?

Here is my fstab (yeah, I'm shameful for not divvying up / :D):
Code:

/dev/hda5        swap            swap        defaults        0  0
/dev/hda6        /                ext2        defaults        1  1
/dev/hda4        /home/myname    ext2        defaults        1  2
/dev/hda3        /win            vfat        defaults        1  0
/dev/cdrom      /mnt/cdrom      iso9660    noauto,owner,ro  0  0
/dev/fd0        /mnt/floppy      auto        noauto,owner    0  0
devpts          /dev/pts        devpts      gid=5,mode=620  0  0
proc            /proc            proc        defaults        0  0

Thanks for your help.

nikm 01-23-2007 10:34 PM

I think this will create uid and gid problems. Is the uid and gid the same across the platforms?

shakezilla 01-23-2007 10:57 PM

Yes, I'm going to make them consistent. AFAIK, it should just be changing the uids and gids in BSD. In any event, I'm going to hold off on BSD until I get my slack in a stable condition.

shakezilla 01-23-2007 11:39 PM

Well for now I added this to /etc/rc.d/rc.M:
Code:

# mount the home partition
echo "Mounting home partition"
if mount -t ext2 /dev/hda4 /home/myname 2>>/root/homeMountLog
        then chown myname.users /home/myname; chmod 700 /home/myname;
        else date >>/root/homeMountLog; echo >>/root/homeMountLog; echo >>/root/homeMountLog;
fi

Ugly hack but it works. If anyone knows how to get fstab to do it, I'd appreciate it. nikm & everyone, thanks again.


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