Advertisement
CiceroCalls

boot w/ nfs mounted

Mar 27th, 2022
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. Automatically Mounting NFS File Systems with /etc/fstab
  3.  
  4. include the hostname or the IP address of the NFS server, the exported directory, and the mount point on the local machine.
  5.  
  6. sudo nano /etc/fstab
  7.  
  8. Add the following line to the file:
  9. /etc/fstab
  10.  
  11. # <file system> <dir> <type> <options> <dump> <pass>
  12. 10.10.0.10:/backups /var/backups nfs defaults 0 0
  13.  
  14. Where 10.10.0.10 the NFS server IP address, /backup is the exported directory and /var/backups is the local mount point.
  15.  
  16. Run the mount command in one of the following forms to mount the NFS share:
  17.  
  18. mount /var/backups
  19. mount 10.10.0.10:/backups
  20.  
  21. The mount command, will read the content of the /etc/fstab and mount the share.
  22.  
  23. Next time you reboot the system the NFS share will be mounted automatically.
  24.  
  25. Unmounting NFS File Systems
  26.  
  27. umount followed by either the directory where it has been mounted or remote share:
  28.  
  29. umount 10.10.0.10:/backups
  30. umount /var/backups
  31.  
  32. If the NFS mount have an entry in the fstab file, remove it.
  33.  
  34. The umount command will fail to detach the share when the mounted volume is in use. To find out which processes are accessing the NFS share, use the fuser command:
  35.  
  36. fuser -m MOUNT_POINT
  37.  
  38. Once you find the processes you can stop them with the kill command and unmount the NFS share.
  39.  
  40. If you still have problems unmounting the share use the -l (--lazy) option which allows you to unmount a busy file system as soon as it is not busy anymore.
  41.  
  42. umount -l MOUNT_POINT
  43.  
  44. If the remote NFS system is unreachable, use the -f (--force) option to force an unmount.
  45.  
  46. umount -f MOUNT_POINT
  47.  
  48.  
  49. How to Mount Windows Share on Linux using CIFS
  50. How to use SSHFS to Mount Remote Directories over SSH
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement