Feb 13, 2012

Mounting filesystems automatically on Unix

The /etc/vfstab file will be having some sample entries typically for easier understanding. Keep your entries in here. Make sure you have the folder setup where you want to mount.
Once the entries are in there, on Solaris you might have to run the following command

svcadm -v enable -r network/nfs/client

After that if you have not enabled mounting on bootstrap, you can simply mount by issuing the mount command followed by the directory.

eg: mount /{dirname}
umount /{dirname}

A typical vfstab file should look like this..
# cat /etc/vfstab
#device          device          mount           FS      fsck    mount          mount
#to mount       to fsck         point            type    pass    at boot          options
#
fd                     -                  /dev/fd         fd         -       no                  -
/proc                -                  /proc            proc      -       no                  -
/dev/zvol/dsk/rpool/swap  - -                  swap     -       no                  -
swap                -                   /tmp            tmpfs    -       yes                 -
100.100.100.100:/vol/test -  /testing       nfs       no      yes                 -
172.31.9.205:/vol/test2  -      /testing2    nfs       no      no                  -

In the example above you can see that /testing will be mounted automatically after a restart and /testing2 will be mounted manually.

Whatsapp Button works on Mobile Device only

Start typing and press Enter to search