Unmounting network shares

Not my area of expertise! Recently, Forum member ldolse posted a patch for /etc/rc.d/rc.shutdown to properly unmount network shares. You will find that in Wary/Racy 5.2.2.

However, Forum member zekebaby reports that does not work for him:
http://murga-linux.com/puppy/viewtopic.php?p=605451#605451

I have thought about it, and patched rc.shutdown, inserted zekebaby's code just below ldolse's code:

#111107 ldolse: unmount network shares before taking down the network

#(see 111106, need to do it sooner, but 111106 will remount read-only if failed to umount here)
for MOUNTPOINT in `mount | grep '^//' | cut -d ' ' -f 3 | tr '\n' ' '`
do
umount -f $MOUNTPOINT
done
#120219 hmmm, zekebaby reports above does not work for him. i looked up an ex: mount -t nfs boffo.clowns.org:/home/bozo /mnt/bozo
#so this is zekebaby's patch: (see http://murga-linux.com/puppy/viewtopic.php?p=605451#605451)
for MOUNTPOINT in `mount | grep ':' | cut -d ' ' -f 3 | tr '\n' ' '`
do
umount -f $MOUNTPOINT
done



Posted on 19 Feb 2012, 8:30


Comments:

Posted on 19 Feb 2012, 10:37 by shinobar
Re: Unmounting network shares
I would like to propose another solution
#120203 pemasu and shinobar: space in smb or cifs share causes hanging in shutdown

for T in cifs smbfs nfs sshfs; do
umount -a -t $T
done




Posted on 19 Feb 2012, 14:38 by ttuuxxx
TuxOnIce
Hi Barry have you heard of TuxOnIce? Its a kernel patch kind of like a pupsave but a bit better and faster. Quote" TuxOnIce is most easily described as the Linux equivalent of Windows' hibernate functionality, but better. It saves the contents of memory to disk and powers down. When the computer is started up again, it reloads the contents and the user can continue from where they left off. No documents need to be reloaded or applications reopened and the process is much faster than a normal shutdown and start up. "
http://tuxonice.net/
I stumbled across this when reading of a linux kernel fork http://pf.natalenko.name/
ttuuxxx


Posted on 19 Feb 2012, 15:04 by BarryK
Re network shares
shinobar,
that looks like a good solution. I just looked in the umount docs, this also will work:

umount -a -t cifs,smbfs,nfs,sshfs

However, this requires the full umount. In Woof, umount is a script that currently only calls the busybox umount I think, which does not allow the -t option.



Posted on 19 Feb 2012, 17:21 by pemasu
umount -t not supported
When I originally tried to find a solution to network share with space in name, I also noticed that -t was not documented. In Exprimo...I have implemented little simpler command without loop:
#120203 pemasu: space in smb or cifs share causes hanging in shutdown

umount -a -t cifs #120203

Shinobar used that idea to include all network shares. Mine solution was targeted to jrb`s Pupserver to unmount it at shutdown.

In my tests anyway...the command works and I have used it in several builds now.
I knew that -t is not documented, but since it worked, I didnt care, lol.


Posted on 19 Feb 2012, 17:31 by pemasu
TuxonIce
TuxonIce is just hibernation functionality. It is already in kernels, when you enable it. In my kernels you can hibernate already. No need for TuxonIce. You just need to give kernel boot time parameter: resume=/dev/sdXX

But...hibernating writes to the swap partition and locks it. It is not in use until you boot again that hibernated Puppy. When you hibernate, you can power off computer and you need to boot the hibernated puppy until swap is usable.
Also hibernating ie saving to the swap the running snapshot of puppy is slow process. It is much faster to save your stuff and be happy. Puppy boots much faster than loading hibernated puppy.
Of course if you dont want to create savefile, you can install pets, open documents and do what you want....hibernate...shut down comp....and boot the hibernated puppy which starts from where you left..continue to where you left.
It works....I have used it several times....
But no need for TuxOnIce. Just compile kernel with hibernating enabled.


Posted on 19 Feb 2012, 17:46 by pemasu
Hibernate with acpitool -S
Sorry...I forgot to tell how you hibernate. Use acpitool: #acpitool -S
It launches the saving to the swap partition and shuts down the computer, real shutdown, power off.
And you need to have that resume=/dev/sdXX kernel boot parameter in kernel row to have target which resumed partition will be writed back. resume=/dev/sdXX need to be pointed to your swap partition.
Fluppies, all my builds and Saluki has natively support in kernel for hibernating and they have acpitool preinstalled.

Have fun !



Posted on 20 Feb 2012, 8:06 by BarryK
Network shares umount
Ok, I have put this into rc.shutdown:

umount -a -t cifs,smbfs,nfs,sshfs

...although you guys haven't told me if the busybox umount accepts the comma delimiter.



Posted on 20 Feb 2012, 8:29 by BarryK
Re comma delimiter
I tested with the comma, works ok.