drives need unmounting on poweroff/reboot?

Booting, installing, newbie
Post Reply
Message
Author
User avatar
darkcity
Posts: 2534
Joined: Sun 23 May 2010, 19:16
Location: near here
Contact:

drives need unmounting on poweroff/reboot?

#1 Post 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?

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#2 Post 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 :)

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#3 Post 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 .

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#4 Post 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.

User avatar
darkcity
Posts: 2534
Joined: Sun 23 May 2010, 19:16
Location: near here
Contact:

#5 Post by darkcity »

thanks for help, just added unmount for addtitional (non pup files) drive to top of rc.shutdown

Post Reply