Complete Life-cycle of
mounting drive in Unix
1.
Login with root user in source machine and check
if drive is ready to be shared
root@localhost:/u01#
share
Output: - it will show all
shared drive. If there is no drive to be shared then cursor will move to next
line
2.
Run below command to share drive to mount on
destination machine
root@localhost:/u01#
share -F nfs /u01/SBA_81
Output: - It will share drive
on source machine
3.
Check if drive is available to mount
root@localhost:/u01#
share
Output: - it will show shared
device as below:-
u01_SBA_81
/u01/SBA_81 nfs sec=sys,rw
4.
Login with root user in destination machine and
create directory to mount
root@localhost:/u01#
mkdir mount_point
Output: It will create directory
in folder /u01
5.
Mount source directory on destination machine as
below:-
root@localhost:/u01#
mount -F nfs Source_IP:/u01/SBA_81 /u01/mount_point
Output: - it will mount
required drive to destination server. Check if all folders and files are
visible in mounted directory.
6.
To Un-Mount any mounted directory use below
command
root@localhost:/u01#
umount /u01/mount_point
Output: - It will un-mount
drive and you can’t use shared directory anymore.
7.
To Remove created directory use below command
root@localhost:/u01#
rmdir /u01/mount_point
Output: - It will delete
previously created directory
8.
To un-share any shared directory use below
command
root@localhost:/u01#
unshare -F nfs /u01/SBA_81
Output: - It will un-share drive
on source machine
9.
Finally crosscheck if directory is not
accessible anymore
root@localhost:/u01#
share
Output: - If there is no drive
to be shared then cursor will move to next line
Note: Please find complete
screenshot of command execution for reference
root@localhost:/u01#
share
Output: - it will show all
shared drive. If there is no drive to be shared then cursor will move to next
line
2.
Run below command to share drive to mount on
destination machine
root@localhost:/u01#
share -F nfs /u01/SBA_81
Output: - It will share drive
on source machine
3.
Check if drive is available to mount
root@localhost:/u01#
share
Output: - it will show shared
device as below:-
u01_SBA_81
/u01/SBA_81 nfs sec=sys,rw
4.
Login with root user in destination machine and
create directory to mount
root@localhost:/u01#
mkdir mount_point
Output: It will create directory
in folder /u01
5.
Mount source directory on destination machine as
below:-
root@localhost:/u01#
mount -F nfs Source_IP:/u01/SBA_81 /u01/mount_point
Output: - it will mount
required drive to destination server. Check if all folders and files are
visible in mounted directory.
6.
To Un-Mount any mounted directory use below
command
root@localhost:/u01#
umount /u01/mount_point
Output: - It will un-mount
drive and you can’t use shared directory anymore.
7.
To Remove created directory use below command
root@localhost:/u01#
rmdir /u01/mount_point
Output: - It will delete
previously created directory
8.
To un-share any shared directory use below
command
root@localhost:/u01#
unshare -F nfs /u01/SBA_81
Output: - It will un-share drive
on source machine
9.
Finally crosscheck if directory is not
accessible anymore
root@localhost:/u01#
share
Output: - If there is no drive
to be shared then cursor will move to next line
Note: Please find complete screenshot of command execution for reference
Best of Luck
No comments:
Post a Comment