Page 1 of 1

drives need unmounting on poweroff/reboot?

Posted: Tue 25 Oct 2011, 15:14
by darkcity
I put a couple of line of script in a file in

/root/Startup

to mount extra drives after xwin starts
#!/bin/sh
#vfat
mount /dev/sda1 /mnt/sda1
#nfts - needs filesystem declaring to make writable
mount /dev/sda2 /mnt/sda2 ntfs

my question is whether I need to add some code somewhere to unmount these drive on poweroff/reboot? or will puppy automatically unmount?

Posted: Tue 25 Oct 2011, 17:34
by Aitch
http://www.murga-linux.com/puppy/viewtopic.php?t=55823

Also
Puppian wrote: You can write a script to auto-unmount too, e.g,

Code: Select all

#!/bin/sh
#  Command to shutdown the system
umount /mnt/dos
umount /mnt/linux2
umount /mnt/linux3
icewmpoweroff
save it as 'shutdownIce' and make it executable.
http://www.murga-linux.com/puppy/viewtopic.php?t=2996

Aitch :)

Posted: Tue 25 Oct 2011, 22:52
by Karl Godt
The /etc/rc.d/rc.shutdown script called by /bin/poweroff || reboot does in the very end a simple

Code: Select all

busybox umount -ar > /dev/null 2>&1
This might not be enough , though .

There is also 2 times code above about STRAYPART[ITION]S :
01micko reported that in Slacko, when poweroff was chosen, a reboot happened instead. This only happened when a partition was left mounted.
http://www.bkhome.org/blog/?viewDetailed=02505

Lupu 52+ has got the ^ bug ^ about passing the -n option to ntfs-3g using the puppy /bin/mount script .
I had a similar problem with new2dir calling installwatch which splitted 'make install' into 'make -i -n -s -t -a' >ERROR :make unknown option '-a' ....
Installing a newer checkinstall.deb fixed that .

I for myself have written several different scripts in different places like /etc/rc.d/rc.shutdown.local
and had put code like that into it :

Code: Select all

M=`mount | grep -v -E 'root|union|*tmpfs|devtmpfs|sysfs|none|initrd'`
SFSdev=`echo "$M" | grep '\.sfs' | tr -s ' ' | cut -f 1 -d ' '`
for i in $SFSdev ; do
echo "unmounting `mount | grep $i` "
umount $i
done
and similar for dotISO , dot2-4fs and normalPartitions .
Since I am using 95% linux fs and only one partition with ntfs and none with vfat it works for me , to ease busybox umount and STRAYPARTS much .

Posted: Wed 26 Oct 2011, 03:25
by Flash
To the question of whether drives even need to be unmounted before the power is turned off, it may depend on what kind of media and what you're using it for. I keep a USB flash drive plugged in and mounted so I can quickly move images to it from camera (CF and SD) cards. Mostly Puppy just sits there waiting, which I presume gives it plenty of time to keep the filesystem of the USB flash drive up to date. Anyway, I don't bother unmounting the drive before switching off the power, and nothing bad has happened. I run Puppy from a multisession DVD in a computer without a hard disk drive but with 512 MB of RAM.

Posted: Thu 05 Jan 2012, 02:24
by darkcity
thanks for help, just added unmount for addtitional (non pup files) drive to top of rc.shutdown