Intro¶
Hello Folks, Today We're going to learn one of the cool things in Linux and that is mounting an external Network share.
Setting up the Share¶
Provided you have the share already. I'll be showing here how to mount the share.
CLI¶
First, you'll want to make sure you have NFS Client installed.
- Debian/Ubuntu:
- CentOS/RHEL:
Once that is done we'll need to make a Mount Point for this.
- That can be done like this
mount -t nfs- Issues the mount command with the type ofnfs.nfs_server_ip- The IP of the server./path/to/nfs_share- Path on the target server./mnt/nfs_share- Where the Share will be mounted on the server.
Once that is done we can test to make sure the share is mounted correctly by running a
If all looks good then we have mounted the share at least for this session. But we want this to happen on every boot. That can be done by adding a simple line to the/etc/fstab.
Running that snippet will add it to that file but please change the variables as most likely you're mount is not the exact same as the example.
After that is done go ahead and run a tail /etc/fstab to make sure the line has been added to the file. If you see the line you added you're all set then just issue a mount -a and you'll be all set. If you have any lines that you don't want re mounted make sure they are commented out or just run sudo mount /mnt/nfs_share to mount that specific entry.
After that is all done the mount should stay persistent even after reboots.
Cockpit¶
I've shared this video here found on YouTube to better show how it'd done. While it is old the only difference is instead of the + in storage there is a hamburger menu instead.
Epilogue
With all that being said, this is how you can mount shares in Linux. I hope you learned something here, and make sure to come back for more tutorials.