How to mount partitions on user login
Hello folks,
I have recently purchased a new hard disk. I have earmarked one partition (NTFS) each for my kids. These are NTFS since my objective is that these partitions should be accesible from windows too. I have put appropriate entries in the fstab so that when the linux starts the two partitions are mounted with correct ownerships and permissions. No problem - it is working fine. But I was thinking that I should delay the mounting till the kids log in. In addition , the correct partition only should mount (and not both the partitions) depending upon who is logging in. Is there any way by which it could somehow be done. Thanks in advance. Prabhat Soni |
You could put the commands to mount the partition(s) in user shell startup script(s), such as .bashrc. You will then need to put in code to test whether the partition is already mounted, but then how will you handle automatic unmounting? Messy. Let us know if you come up with something that works well.
--- rod. |
Why not go ahead and mount it but use groups to set the permissions to rw to the drives? Kid A (a member of group One) can see partition One but not partition Two. Kid B (a member of group Two) can see partition Two but not partition One.
|
Quote:
|
Quote:
--- rod. |
Quote:
--- rod. |
Quote:
Does NTFS support UNIX style permissions? I'd also test to see how setting the owning group/user and modifying the permissions of a file ultimately effects Windows. |
It does not effect NTFS but it does effect the mount point. Access to the mount point can be treated just like any other FS.
|
Hello folks,
For the present I am using the fstab entry as below: Code:
/dev/sda9 /mnt/sda9 ntfs uid=500,gid=500,umask=077 0 0 mount -t ntfs -o uid=500,gid=500,umask=077 /dev/sda9 /mnt/sda9 But this can be done only by the root. Thus executing this command from the bash start up script of a user is not possible. But that gives me an idea. Can I make the user the owner of the device /dev/sda9 (which is presently owned by root). And by incorporating this change would this ordinary user be able to mount the partition. Will have to check out. Will changing the ownership of a disk device from root to an ordinary user have any serious side-effects ? Any more ideas ? Thanks Prabhat Soni |
All times are GMT -5. The time now is 06:07 PM. |