Automatic partition mounting on login?
Hi All I`m sure it`s very simple but I seem to be unable to crack it as I`m not very familiar with shell and its syntaxes. Problem: I`d like to get a specific partition mounted automatically upon login of an user with that user`s read/write permissions(it`s a vfat partition) I was able to get the mount command executed thanks to bashrc but every time I started xterm or other I`ll get complaint from the shell that partition is already mounted according to /etc/fstab. Question: What is the command/syntax/option to pass to the shell in the bashrc that if the partition is already mounted ,don`t try to mounting it and other way if it`s not just mount that partiiton.Any help appreciated,no programing experience here at all. Thanks Alan
Hello ally, First of all be sure you defined the "user" option in your fstab allowing users to mount and umount this partition. And if you don't want the partitions to be mounted at boot time (you want to mount them at user login right?) then include the option "noauto" (do man fstab). Special warning: a partition mounted by a user normally must be umounted by the same user. Consider the options "users" in fstab instead "user" to allow other users umounting your partitions after you logout... You can check the partitions that are mounted in /etc/mtab and /proc/mounts. Also you may get this file by calling mount with no arguments (do man mount). I don't think it makes any damage trying to remount a partition that is already mounted. I mean... If the error message doesn't disturb you... If the error message disturbs you... change your bashrc to look like this: mount .... &> /dev/null And if you want to capture the return value of mount (is there a return value?) you just use the variable $? after calling mount: echo Return value was: $? Hope this helps, Pep Serrano On Friday 05 April 2002 11:19, Alan wrote:
Hi All I`m sure it`s very simple but I seem to be unable to crack it as I`m not very familiar with shell and its syntaxes. Problem: I`d like to get a specific partition mounted automatically upon login of an user with that user`s read/write permissions(it`s a vfat partition) I was able to get the mount command executed thanks to bashrc but every time I started xterm or other I`ll get complaint from the shell that partition is already mounted according to /etc/fstab. Question: What is the command/syntax/option to pass to the shell in the bashrc that if the partition is already mounted ,don`t try to mounting it and other way if it`s not just mount that partiiton.Any help appreciated,no programing experience here at all.
On Friday 05 April 2002 02:40 am, Pep Serrano wrote:
Hello ally,
First of all be sure you defined the "user" option in your fstab allowing users to mount and umount this partition. And if you don't want the partitions to be mounted at boot time (you want to mount them at user login right?) then include the option "noauto" (do man fstab).
If I could jump in here. I've tried this (noauto) but the partitions don't automatically mount, they just mount when I click on my desktop icon (kde). If I use the "auto" option instead then the partitions are mounted (which I desire for my xmms playlist) but I cannot copy anything to the partition as a user (the partition is mounted read only for users?) I want the best of both worlds Thanks -- dh
On Fri, Apr 05, 2002 at 10:27:48AM -0800, David Herman wrote:
On Friday 05 April 2002 02:40 am, Pep Serrano wrote:
Hello ally,
First of all be sure you defined the "user" option in your fstab allowing users to mount and umount this partition. And if you don't want the partitions to be mounted at boot time (you want to mount them at user login right?) then include the option "noauto" (do man fstab).
If I could jump in here.
I've tried this (noauto) but the partitions don't automatically mount, they just mount when I click on my desktop icon (kde). If I use the "auto" option instead then the partitions are mounted (which I desire for my xmms playlist) but I cannot copy anything to the partition as a user (the partition is mounted read only for users?) I want the best of both worlds
Thanks
Ok, I may be butting in here as I don't have all of the thread... Is it NFS you are mounting ? Then check out automount... edit /etc/auto.misc if directory /home/humbug on server_y is exported to you, then you would do either: humbug server_y:/home:& if the user "humbug" is a local user or whatever server_y:/home/humbug which would add the /misc/whatever automatically whenever accessed Automount unmounts after 5 minutes of inactivity -tosi -- Veni, vidi, vici Mostly every great man in history I came, I saw, I got lost. About every other tourist.
On Friday 05 April 2002 12:04 pm, Tor Sigurdsson wrote:
On Fri, Apr 05, 2002 at 10:27:48AM -0800, David Herman wrote:
On Friday 05 April 2002 02:40 am, Pep Serrano wrote:
Hello ally,
First of all be sure you defined the "user" option in your fstab allowing users to mount and umount this partition. And if you don't want the partitions to be mounted at boot time (you want to mount them at user login right?) then include the option "noauto" (do man fstab).
If I could jump in here.
I've tried this (noauto) but the partitions don't automatically mount, they just mount when I click on my desktop icon (kde). If I use the "auto" option instead then the partitions are mounted (which I desire for my xmms playlist) but I cannot copy anything to the partition as a user (the partition is mounted read only for users?) I want the best of both worlds
Thanks
Ok, I may be butting in here as I don't have all of the thread...
Is it NFS you are mounting ?
No just vfat on another partition, same machine heres a snip from my fstab, /dev/hda5 /windows/E vfat noauto,user 0 0 /dev/hda6 /windows/F vfat noauto,user 0 0 /dev/hda7 /windows/G vfat auto,user 0 0 /dev/hdb5 /windows/H vfat noauto,user 0 0 I can't write to /windows/G but after clicking my desktop icon for /windows/H (mounting it) I can write to H, and so on. -- dh
David, To quote from the excellent book Linux, Installation, Configuration, Use by Michale Kofler "The options gid=n, uid=n, and umask=m can be used to preset access priviliges for files. This makes sense for files sytems in which this information cannot be stored or cannot be evaluated by Linux (DOS, Windows, OS/2). Without the use of this option, DOS files are owned by root; the files can be read by all users, but only modified by root. The three options allow more liberal access." Back when I had a dual boot system, I had the following entry in my fstab /dev/hda8 /windows/D vfat uid=500,user 0 0 This automatically mounted my vfat D drive and let me modify it. Mike
No just vfat on another partition, same machine
heres a snip from my fstab,
/dev/hda5 /windows/E vfat noauto,user 0 0 /dev/hda6 /windows/F vfat noauto,user 0 0 /dev/hda7 /windows/G vfat auto,user 0 0 /dev/hdb5 /windows/H vfat noauto,user 0 0
I can't write to /windows/G but after clicking my desktop icon for /windows/H (mounting it) I can write to H, and so on.
-- Michael A. Coan Woodlawn Foundation 524 North Avenue New Rochelle, NY 10801-3410 tel 914-632-3778 fax 914-632-5502
On Friday 05 April 2002 02:02 pm, Mike Coan wrote:
David,
To quote from the excellent book Linux, Installation, Configuration, Use by Michale Kofler
"The options gid=n, uid=n, and umask=m can be used to preset access priviliges for files. This makes sense for files sytems in which this information cannot be stored or cannot be evaluated by Linux (DOS, Windows, OS/2). Without the use of this option, DOS files are owned by root; the files can be read by all users, but only modified by root. The three options allow more liberal access."
Back when I had a dual boot system, I had the following entry in my fstab
/dev/hda8 /windows/D vfat uid=500,user 0 0
This automatically mounted my vfat D drive and let me modify it.
Mike
Sounds like what I'm looking for, thanks alot! -- dh
On Fri, 5 Apr 2002 20:10, Pep Serrano wrote:
Hello ally,
First of all be sure you defined the "user" option in your fstab allowing users to mount and umount this partition. And if you don't want the partitions to be mounted at boot time (you want to mount them at user login right?) then include the option "noauto" (do man fstab).
snip Thanks forall the tips ,I was hoping for some script type procedure,but this will do Thanks Alan
participants (5)
-
Alan
-
David Herman
-
Mike Coan
-
Pep Serrano
-
Tor Sigurdsson