To use your NAS and make it accessible over your entire network, you will have to configure it properly so it can be added and mounted in various systems around your home network.
We’re not going to talk about NAS configurations but we are going to go through how to mount your NAS to a Linux OS permanently.
Add an entry to the /etc/fstab file. This file contains information about the file systems that are mounted at boot time. Here are the steps to add an entry for your NAS device:
- Open the /etc/fstab file in a text editor with root privileges:
sudo nano /etc/fstab
- Add a new line to the file with the following syntax:
//<NAS_IP_address>/<share_name> <mount_point> cifs username=<username>,password=<password> 0 0
- Replace
<NAS_IP_address>
,<share_name>
,<mount_point>
,<username>
, and<password>
with the same values you used in the mount command in the previous answer. For example:
//192.168.1.100/backup /home/user/nas_mount cifs username=user,password=password 0 0
- Save the file and exit the text editor.
- Test the fstab entry by running the following command:
sudo mount -a
After completing these steps, your NAS device should be mounted automatically every time you boot your Linux system.
I’m getting
sudo umount -a
umount: /run/user/1000: target is busy.
umount: /snap/snapd/19457: target is busy.
umount: /sys/fs/cgroup: target is busy.
umount: /: target is busy.
umount: /run: target is busy.
umount: /dev: target is busy.
try – mount -a.