I'm running Puppy (1.0.8) from a 1 gig USB key. I let Puppy do the USB install for me. I noticed that shutdown took a long time "writing back to the pupxxx file on the Flash drive from ramdisk", making the USB access light flash the entire time. I found the responsible code in /etc/rc.d/rc.reboot:
Code: Select all
rm -fr $PUPMNTPOINT/*
#...heh, heh, this leaves behind hidden files/dirs, so do this...
rm -fr $PUPMNTPOINT/.[a-zA-Z0-9]*
sync
cp -af /root/. $PUPMNTPOINT
sync
It's really only necessary to copy files that have changed. rsync is a standard Linux program that excels at doing exactly that. This HOWTO describes installing rsync and changing Puppy's startup and shutdown scripts to use it instead of cp to save the changes to /root.
rsync is not part of the standard Puppy installation. It isn't even available, yet, as a dotpup.
To build it, you need to get usr_devx.sfs, put it in your HOME directory (the same place as the pupxxx file), and reboot. Then download the rsync source from http://www.samba.org/rsync/. The latest stable version at this writing is rsync-2.6.7.tar.gz. Put that file somewhere, e.g. /root/my-documents. Then do the following:
Code: Select all
cd /root/my-documents
tar -xzf rsync*.gz
cd rsync*
./configure
make
make install
Alternatively, you can download the attached rsync.gz, gunzip it, and mv it to /usr/local/bin. That should work for 1.0.8, where I compiled it, but may not work for other versions of Puppy.
Once you have rsync installed, you can back up /root with the following commands:
Code: Select all
rsync -a --delete /root/ /mnt/pupxxx
sync
To change Puppy's startup and shutdown scripts to use rsync for the copy:
Code: Select all
cd /root
cp /etc/rc.d/rc.reboot rc.reboot.rsync
Code: Select all
# rm -fr $PUPMNTPOINT/*
#...heh, heh, this leaves behind hidden files/dirs, so do this...
# rm -fr $PUPMNTPOINT/.[a-zA-Z0-9]*
sync
# cp -af /root/. $PUPMNTPOINT
/usr/local/bin/rsync -a --delete /root/ $PUPMNTPOINT
sync
Code: Select all
# Use rsync to copy /root/ to /mnt/pupxxx
cp -f /root/rc.reboot.rsync /etc/rc.d/rc.reboot
cp -f /root/rc.reboot.rsync /tmp/rc.reboot
The first shutdown after making these changes will do the copy as usual. Subsequent shutdowns will be much quicker and will write much less to your USB key.