I (Reece) have created a couple of shell scripts that I got to work from an Ubuntu Live CD and am in the process of making an ISO image based on Damn Small Linux (initially 50MB, now around 70MB)- which is in turn based on an old Knoppix LiveCD? - that will allow you to run these scripts or boot into the DSL environment.
Update 10/3/2008: DSL is based on the 2.4 kernel and the NTFS writing package needs the 2.6 kernel so I've put this on hold for now.
Its all built around the python script mrsync.py which allows you to do a multicasting rsync.
How it works
The source.sh script:
- changes the samba name and starts up samba which means there is a world writeable share that has any changes to it saved in RAM (its set to the /tmp folder on the LiveCD?).
- The Master Boot Record and Partition Boot Sector are copied to this share, as is the password that will be used later by mrsync to connect to the target machines (it won't work with null passwords as it uses ssh to connect to the machines).
- The partition is mounted as read only NTFS.
- Then it lists the IP addresses registered by the target script (see below) and waits for the user to allow it to continue i.e. when all machines are connected.
- mrsync is set going to copy all the files on the partition to all the registered IPs? (using expect to ssh in using the password above).
- Finally the partition is unmounted and a flag file written to tell the targets that its finished.
The target.sh script:
- Stops samba.
- Waits for the source machine to come up and then connects to the samba share on the source.
- Writes its IP address to the end of a file (after deleting any other occurances of it in the file). This file is used by the source script to determine which machines it should multicast to.
- (Unicast) Reads the password from the share and sets it.
- (Unicast) Reads the MBR and partition boot sector and writes them to the drive. Note that it doesn't overwrite the Partition Table part of the MBR as it is assumed that the target partition is already existing.
- Formats the partition as NTFS and mounts it as read/write
- Waits for the source to write a flag file which means the copying is finished then unmounts the partition.
Currently these scripts assume that the source is a single NTFS partition, as are the targets with the additional assumption that the partitions are big enough to handle the data. Also, each script leaves a bit of a mess behind that is incompatible with running the other script immediately after but that will be simple enough to fix.
Hopefully it won't take a lot of effort to make it into a fairly robust system with a lot more options and less assumptions.
Currently, the DSL version doesn't like the python mrsync.py script and hasn't got ntfs-3g installed so its not much use but its ohh so very close to working.
For a list of what has been done, and what still needs to be done, try the multicast CD version history
Also, here are the current versions of the shell scripts:
source.sh
target.sh
run_mrsync.sh - run at bootup
A couple of pages I put up to explain how to edit the iso images:
Remastering a Ubuntu LiveCD
Remastering a Knoppix based CD