mount privileges...what the heck?
Hello, Discovered something odd today, trying to get the procedures down to help someone who wanted to mount a second drive to a mount point in their home directory. Running FreeBSD5.5p2 * 2nd drive device/partition: /dev/ad1s1d * /etc/sysctl.conf: vfs.usermount=1 * /etc/devfs.conf: perm ad1s1d 0666 Created a directory home homedir: # mkdir /usr/home/dude/drive2 Ownership on mount point: dude:dude /usr/home/dude/drive2 Now when I do: # mount /dev/da1s1d /usr/home/dude/drive2 Ownership shows: root:wheel /usr/home/dude/drive2 This is not acceptable! should be dude:dude /usr/home/dude/drive2 So I try: # sudo chown -R dude:dude /usr/home/dude/drive2 ok, now it looks ok, but I don't expect it stick, but check it out: # umount /usr/home/dude/drive2 # mount /dev/da1s1d /usr/home/dude/drive2 ownership still shows dude:dude ! I try to reboot, mount again, and ownership still is what I want, dude:dude I add line to /etc/fstab, reboot, everything still looks good! So any ideas on why I need to do a chown -R dude:dude after the first mount?? Am I missing something, going insane, or is something buggy here Cheers, DW ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: mount privileges...what the heck?
DW wrote: So any ideas on why I need to do a chown -R dude:dude after the first mount?? Am I missing something, going insane, or is something buggy here You created the directory as root: # mkdir /usr/home/dude/drive2 ...so it belongs to root. I can only assume that... 'Ownership on mount point: dude:dude /usr/home/dude/drive2' ...does not mean that you actually did a # chown dude:dude /usr/home/dude/drive2 ...which is necessary, after root creates a directory. Why didn't you just log in as dude to create the directory that was going to serve as the mount point, as in: % mkdir /usr/home/dude/drive2 ...or $ mkdir /usr/home/dude/drive2 Just yesterday I did exactly this on my PC-BSD (FreeBSD 6.1, basically) First I created, logged in an my 'dude' identity (as opposed to my root identity), and created 4 directories in /home/dude, for mounting four data partitions that exist on a data hard drive that is accessed by PC-BSD, Red Hat Enterprise 3, or Windows XP SP2 (depending on which front-loading, swappable hard drive cage with operating system, I have plugged into the machine. the partitions are Samba shares, when *nix is plugged into the machine, so they are always accessible to other Windows boxes on the LAN. Then, I wrote a shell script called 'mountall', which is the BSD equivalent to the script I have in Red Hat, for mounting the partitions. Then I ran the script, and voila... my Windows 2000 graphics workstation could read and write to the Samba shares as per usual. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: mount privileges...what the heck?
Robert C Wittig wrote: DW wrote: So any ideas on why I need to do a chown -R dude:dude after the first mount?? Am I missing something, going insane, or is something buggy here You created the directory as root: # mkdir /usr/home/dude/drive2 ...so it belongs to root. no, the first time this was my thought too, I've been known to do stuff like this, especially since so much activity is done with 'sudo', but we went back (each of us on our respective machines), and did it again, making sure we were doing it as 'dude', not sudo or 'root', and it happened every time. I can only assume that... 'Ownership on mount point: dude:dude /usr/home/dude/drive2' ...does not mean that you actually did a # chown dude:dude /usr/home/dude/drive2 ...which is necessary, after root creates a directory. Why didn't you just log in as dude to create the directory that was going to serve as the mount point, as in: % mkdir /usr/home/dude/drive2 ...or $ mkdir /usr/home/dude/drive2 I swear, that's what we did :) Maybe I'm losing it?, but we went back and verified and verified, and still scratching our heads. Just yesterday I did exactly this on my PC-BSD (FreeBSD 6.1, basically) First I created, logged in an my 'dude' identity (as opposed to my root identity), and created 4 directories in /home/dude, for mounting four data partitions that exist on a data hard drive that is accessed by PC-BSD, Red Hat Enterprise 3, or Windows XP SP2 (depending on which front-loading, swappable hard drive cage with operating system, I have plugged into the machine. the partitions are Samba shares, when *nix is plugged into the machine, so they are always accessible to other Windows boxes on the LAN. Then, I wrote a shell script called 'mountall', which is the BSD equivalent to the script I have in Red Hat, for mounting the partitions. Then I ran the script, and voila... my Windows 2000 graphics workstation could read and write to the Samba shares as per usual. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: mount privileges...what the heck?
DW wrote: no, the first time this was my thought too, I've been known to do stuff like this, especially since so much activity is done with 'sudo', but we went back (each of us on our respective machines), and did it again, making sure we were doing it as 'dude', not sudo or 'root', and it happened every time. snip % mkdir /usr/home/dude/drive2 ...or $ mkdir /usr/home/dude/drive2 I swear, that's what we did :) Maybe I'm losing it?, but we went back and verified and verified, and still scratching our heads. Well... I was responding precisely to your post, where you used the '#' prompt in your example, which is the root prompt. The '%' and '$' prompts traditionally indicate non-root users. -- -wittig http://www.robertwittig.com/ . http://robertwittig.net/ ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: mount privileges...what the heck?
DW wrote: Discovered something odd today, trying to get the procedures down to help someone who wanted to mount a second drive to a mount point in their home directory. : Ownership on mount point: dude:dude /usr/home/dude/drive2 Now when I do: # mount /dev/da1s1d /usr/home/dude/drive2 Ownership shows: root:wheel /usr/home/dude/drive2 This is not acceptable! should be dude:dude /usr/home/dude/drive2 This is probably because the root directory on the mounted file system has a different ownership than the mount point. I might be way off here, but could this be something like the mount point assuming the role of the mounted file system root, when mounted? Then after mounting, your chmod command was issued on the mounted fs, not the mount point. This way it stuck. Could you maybe unmount the fs, chgrp the mountpoint, and remount and see if the mountpoint still has the dude group? Svein Halvor signature.asc Description: OpenPGP digital signature