I'm working on a project called "School Key" (www.schoolkey.org). The idea is to give each student in a school a USB key with a linux system which they can boot at any computer in the school and use at home.
One issue with this approach is we know kids are going to take out the USB key and walk away without waiting for the system to properly shut down. The bell will ring, a friend will ask them to come outside and play, and they will grab the USB and go.
Currently, I'm having problems with the USB going into "boot error" mode when its not treated with respect. Does anyone have any ideas on how to make the process more robust and/or self repairing?
One thought I have is that I don't actually want to save any state around any boot configuration. Can I make the files needed for boot read only?
One possible solution is to partition the usb key into two sections.
Partition 1: Slax boot files
Partition 2: Changes directory and other storage
The Linux Live scripts in intrd could then be modified to always mount partition 1 read only, and when it goes to mount partition 2 it could check for errors (currently it is able to detect errors on partitions and mount them read only, so it should not be too difficult to add functionality). If it detects errors on the second partition it could start up fsck (with the needed options) on that partition. After the children corrupt the second partition a few times and have to wait through a mandatory fsck to boot, they might remove the usb prematurely less (While the fsck is running you should be able to display a message on why the filesystem might be corrupt).
one other solution is to make a whole root drive into a .lzm module and not use changes(always fresh mode) and make the students store what they need or make into a folder.
that way u will still be easily booting slax without the worry of a corrupted drive(works for me :) )
I am working with Caroline. I created the two parition USB key.
Does anyone know of an efficient way to duplicate the key? I have used dd and that works pretty well but its difficult to distribute the image and explain how to create it to another person. Especially compared to the simple process to create a default slax usb key.
Is there any way to write a shell script for linux or batch file for windows to copy the image to a usb key?
Does anyone know of an efficient way to duplicate the key?
Is there any way to write a shell script for linux or batch file for windows to copy the image to a usb key?
YES. I am using something like your "School Key" for two years now. Every student must buy an USB key and it's up to me to fill it with Slax. It works very fine. I use some bash scripts that are present in every "School Key". Your can start with mine. I'm working for improving them, and plan to have a new release by the mid of january 2009.
Here is the main program (old fashion)
=============
#!/bin/sh
echo Making bootable the LAST plugged in USB disk
echo "Are-you sure that the new USB is plugged-in ? [Y]"
read YN
[ r$YN = r ] || exit 50
sleep 1
DEV=$( ls -rt /dev/sd* | tail -1 | cut -c 6-8)
echo The last plugged in USB disk is $DEV
echo Here is what Linux kernel thinks this device is :
dmesg | grep -B1 $DEV
#if [[ $DEV=sda ]] ; then
# echo sda refused
#exit 456
#fi
echo This will erase all data on it
echo "Do you wish to continue [y|N] ?"
read YN
[ r$YN = ry ] || exit 51
Plist=$(awk " /${DEV}./{print \$4} " /proc/partitions)
echo "umount-ing all partitions on $DEV :"
echo $Plist
for p in $Plist; do
grep /dev/$p /proc/mounts > /dev/null &&
(cmd="umount /dev/$p" ; echo "-->$cmd" ;$cmd || exit 101)
done
Hello,
an other way can be to mount with "sync" option,
this will be real slowwwwwwwww for writing many tiny files,
reading is not affected, but you can be sure that nothing will
be lost. And it may wear the flash device(usb thumb) more than
usual.
Have a nice day!
Hi all,
Does anyone know an efficient way to make SLAX more robust when the system is not properly shut down?
Two partition? a read only partition?
I've got a big trouble with my little boy... he is too fast when takes out the USB key!!!
Do you mean you are having problems with the data on the USB device when it is 'pulled out' without unmounting? and you have corrupt data? Or do you mean a problem with slax itself not knowing the device is gone? Is your slax running from the hard drive?
I have seen a script around designed to help when a USB device is extracted prematurely. The most stable configuration i have seen (if slax runs on USB) is 2 partitions with the changes folder on a linux partition.
Hi jcsoh, thanks for your reply.
The only thing is that I didn't understand this:
"Note: Adapt the comands below and version syslinux to your needs."
I have to modify some config file?
bye.