Cloning a Voyage Linux host

After you made all your customizations to a Voyage Linux installation, you may want to replicate it to other boards. The procedure is tested with PC Engines’ ALIX2 boards.

The dump can also be easily piped through SSH to/from your backup server. This way it’s easy to organize snapshots for your lab testing and backups. Do not use any compression inside ALIX — the CPU is quite slow, and it’s faster to transfer uncompressed data over SSH and compress it on the target host if needed (assuming the target host is a usual modern machine).

# get dump and restore
apt-get install dump

# make sure your source filesystem is read-only

# The target CF card is attached as /dev/sdb in a USB card reader

/usr/local/sbin/ -t $CF -b 1 -y
mkdir /tmp/cf
mount $CF1 /tmp/cf
cd /tmp/cf
dump -0 -f - /dev/hda1 | restore -r -f -

# let the new system re-generate SSH keys
rm /tmp/cf/etc/ssh/ssh_host_*
touch /tmp/cf/voyage.1st

# Populate a new hostname
vi /tmp/cf/etc/hostname
vi /tmp/cf/etc/hosts

# Install the boot loader (assuming Partition 1 is used for boot filesystem)
echo "(hd0) $CF" > /tmp/cf/boot/grub/
mount -o bind /dev /tmp/cf/dev
chroot /tmp/cf /usr/sbin/grub --device-map=/boot/grub/ <<EOM
setup (hd0) (hd0,0)
umount /tmp/cf/dev

# finished preparing the filesystem
cd /
umount $CF1

, ,

  1. #1 by Mirco on March 9, 2012 - 10:54 pm

    Read it on the list, just wanted to let you know that this is very appreciated…

    • #2 by txlab on March 9, 2012 - 11:24 pm

      my pleasure 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: