27.6. nfsdown
If you have nfs on your system you might find this script handy. I look after several machines and periodically I may have to reboot one of them during normal working hours. This usually has to be done as quickly as possible.
As I have remote directories mounted all over the place, I do not want to have to rely on the rebooting process to take care of the nfs unmounting. I would rather do it myself; besides it’s faster than letting the machine do it.
I just run the script (which is on all the machines) and all the nfs mounts get unmounted, allowing me to do a faster reboot.
The script holds a list of machines that I have nfs mounts on. A for loop loops around this list, doing a grep of each host through the df command. The nfs ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access