0

we have a ubuntu 22.04 server. we are mounting network drives from a windows server. The drives are mounted correctly but don't get mounted back when we reboot the Ubuntu server.

below are the contents of the /etc/fstab file

//192.168.88.110/g /mnt/nl-dev-g cifs username=user,password=password,rw 0 0
//192.168.88.110/v /mnt/nl-dev-v cifs username=user,password=password,rw 0 0

but when we reboot the Ubuntu server, the drives do not get mounted on startup.

any help on what could be going wrong here would be really helpful.

waltinator
  • 36,399

1 Answers1

1

Network mounted drives vanish when the Windows server goes down.

When the Windows server becomes visible on the network, no notification is sent to Ubuntu (Windows doesn't remember what network mounts it was serving last time, so doesn't know who to notify).

Ubuntu doesn't want to simply resume the mountedness, because the filesystem being mounted (or the rules governing sharing on Windows) may have changed.

You could, for each of the mountpoints (in the background), loop on using the mountpoint command to check the status of the mount, then loop on "is Windows up?" (I'd ping -c3 Windows and check $STATUS), then remount (mount -o remount ...) the network drive.

man mountpoint ping bash mount sleep

There are probably better answers out there.

waltinator
  • 36,399