PTrenholme |
12-10-2010 04:15 PM |
mount ignores all lines with "noauto" in the option portion except for a specific mount. The "auto" in the type field. (But, if you change it to "auto" as w1k0 suggested, your system will fail to boot unless you have disks in both your drives when you boot.)
Here's a little code to illustrate the way to use "noauto":
Code:
# grep -w cifs /etc/fstab # List the samba shares in fstab"
//192.168.0.4/Books /home/Peter/TRENHOLME/Books cifs noauto,uid=Peter,gid=Peter,credentials=/home/Peter/.smb_credentials,rw 0 0
//192.168.0.4/Documents /home/Peter/TRENHOLME/Documents cifs noauto,uid=Peter,gid=Peter,credentials=/home/Peter/.smb_credentials,rw 0 0
//192.168.0.4/FEBE /home/Peter/TRENHOLME/FEBE cifs noauto,uid=Peter,gid=Peter,credentials=/home/Peter/.smb_credentials,rw 0 0
//192.168.0.4/Public /home/Peter/TRENHOLME/Public cifs noauto,uid=Peter,gid=Peter,credentials=/home/Peter/.smb_credentials,rw 0 0
//192.168.0.4/S /home/Peter/TRENHOLME/S cifs noauto,uid=Peter,gid=Peter,credentials=/home/Peter/.smb_credentials,rw 0 0
//192.168.0.4/U /home/Peter/TRENHOLME/U cifs noauto,uid=Peter,gid=Peter,credentials=/home/Peter/.smb_credentials,rw 0 0
//192.168.0.4/Users /home/Peter/TRENHOLME/Users cifs noauto,uid=Peter,gid=Peter,credentials=/home/Peter/.smb_credentials,rw 0 0
# umount -al -t cifs #Unmount all of them
# mount | grep -w cifs # Show that they're all unmounted
# mount -a # Try to mount everything
nothing was mounted
# mount | grep -w cifs # Show that the shares are still not mounted
# for mp in $(ls -d /home/Peter/TRENHOLME/*);do mount $mp; done # Mount each one specifically
# mount | grep -w cifs # Verify that they are now mounted
//192.168.0.4/Books on /home/Peter/TRENHOLME/Books type cifs (rw)
//192.168.0.4/Documents on /home/Peter/TRENHOLME/Documents type cifs (rw)
//192.168.0.4/FEBE on /home/Peter/TRENHOLME/FEBE type cifs (rw)
//192.168.0.4/Public on /home/Peter/TRENHOLME/Public type cifs (rw)
//192.168.0.4/S on /home/Peter/TRENHOLME/S type cifs (rw)
//192.168.0.4/U on /home/Peter/TRENHOLME/U type cifs (rw)
//192.168.0.4/Users on /home/Peter/TRENHOLME/Users type cifs (rw)
Note that the GNOME virtual file system should automatically mount your optical, removable, media when you insert it. (Fixed optical devices should, of course, be in fstab without the "noauto" option, but I suspect that you aren't using that type of disk.)
|