Thursday 17 April 2008

How to mount and un-mount file system (Solaris)

Identifying Mounted File Systems
The mount command : show content of /etc/mnttab file (Don't be edited)

Mounting File System
The /usr/sbin/mount command
Format : mount [dev_name] [mount_point]
ex. mount /dev/dsk/c0t0d0s7 /export/home
note : /mnt is default mount point that create by system

Automatic Mounting of File Systems
On Solaris add the file system(s) to the /etc/vfstab file(On RHEL use /etc/fstab file).The file format includes seven fields per line entry, each field is separated by a TAB.A - (dash) character and empty field.

Un-mount File System
The /usr/sbin/umount command
Format : umount [mount_point]
note : umount -f mount_point is force option with umount.The file system is unmounted even if there are open files.

Step to mount file system from Remote host

Step 1 configure domain name.
# domainname DOMAIN

Step 2 Add host of server to /etc/hosts.
# vi /etc/hosts
Add this list to file:
#ip_address hostname
192.168.1.1 NFS_SERVER

Step 3 Add line to /etc/vfstab.
# vi /etc/vfstab
Add this list to file:
NFS_SERVER:/export/home - /export/home nfs - yes rw,soft,bg
note : RHEL use /etc/fstab
NFS_SERVER:/export/home /export/home nfs auto 0 0

Step 4 Create directory /export/home (mount_point).
# mkdir -p /export/home

Step 5 Mount directory for NFS.
# mount /export/home

Step 6 Check mount.
# df –k

Step 7 Reboot.
# init 6

Step 8 Check mount again.

No comments: