I have a 2 TB hardisk connected to my router which is network mounted through fstab onto my Arch Linux PC.

#External Drive LABEL=Crate

//IPaddress/Crate   /media/Crate    cifs    credentials=/home/user/sambacreds,rw,uid=1000,gid=0,noauto,nofail,x-systemd.automount,x-systemd.device-timeout=90           0    0

#External Drive LABEL=Chest

//IPaddress/Chest   /media/Chest    cifs    credentials=/home/user/sambacreds,rw,uid=1000,gid=0,noauto,nofail,x-systemd.automount,x-systemd.device-timeout=90           0    0

Due to frequent power cuts the server gets switched off.

Everytime this happens the file explorer Nemo (I am running Cinnamon over Arch Linux) gets stuck.

I want the network drives to be smoothly unmounted or force unmounted when network crashes or powers down. Is this possible?


This is not something that can be solved with software alone. You need to buy a UPS with a USB or serial port that uses a protocol known to Network UPS Tools (aka NUT)

Configure NUT to shut the system down cleanly 10 minutes before the UPS battery is exhausted when mains power gets cut off.

If your power outages are typically short (say, half an hour or less) or if just want the computer to shut down cleanly and don't need it to keep running through the outage, then you only need a UPS with battery capacity of an hour or so for the load you are attaching to it.

Both your PC and your router with the 2TB drive (and the 2TB drive itself if it has an external power supply) need to be plugged in to the UPS. If the PC and router are not physically close to each other, this may mean you have to buy two UPSes, one for the PC and one for the router.

If the PC shuts down on power-failure or if they have their own dedicated UPS, the router and drive could stay up and running for hours on a reasonably-sized UPS because they will use far less power than the PC.

Otherwise, if your router can be shutdown remotely (e.g. via ssh or an admin web interface) then write a script to shut it down and call that script as part of the UPS-triggered shutdown procedure on the PC (i.e. the PC should unmount the network drive, shutdown the router, and then shut itself down).

| improve this answer | |
  • Hi, I have no problem with computer. Programs other than memo runs without any problem. So I guess only connecting it to UPS will give the solution – One Face Apr 9 '16 at 15:16

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.