0

I have two Linux/Ubuntu boxes.

  • Box A (192.168.1.10): works as a file server, with Samba installed. It's always switched on.
  • Box B: workstation with my office tools, which I reboot each time I need to work with it.

In Box B, I have '/etc/fstab' modified:

//192.168.1.10/SambaSharedDirectory /mnt/SambaFiles cifs username=tom,password=foo,rw,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

However, each time I reboot Box B, I have to do 'sudo mount -a' to mount the file directory of Box A.

Is it possible to automate it to avoid mounting it with every reboot? Thank you very much.

0

See if systemd can get you out of this problem.

Change this:

//192.168.1.10/SambaSharedDirectory /mnt/SambaFiles cifs username=tom,password=foo,rw,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

To this:

//192.168.1.10/SambaSharedDirectory /mnt/SambaFiles cifs username=tom,password=foo,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,noauto,x-systemd.automount 0 0

By adding noauto,x-systemd.automount to your list of options.

0

You have to be sure that the network is available when you try to mount the cifs share. So you should use the _netdev option in your fstab file.

From the man-pages of the mount command:

_netdev: The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.