Enzo is the greatest! I have successfully created an exact backup of my Soekris net4801, 3 partition CF.
For those following along at home, I have summarized below. Given an AstLinux box with local DNS "voip". Given a UNIX box with a CF card reader, shell prompt "UNIX $". (Mac OS X 10.3.9 PowerBook in my case). Comments are lines beginning with "#". Create file image of net4801: --------------------------- # Start a terminal shell... UNIX $ ssh [EMAIL PROTECTED] Password: voip # asterisk -rx "stop now" voip # mount -o ro,remount /mnt/kd # Start a new terminal shell... UNIX $ cd local_CF_image_directory # The next step's progress is about 20MB/minute (for me) # ie. a 512MB CF = 25 minutes UNIX $ ssh [EMAIL PROTECTED] "dd if=/dev/hda; sync" >0.3.0.image Password: UNIX $ gzip -c 0.3.0.image >0.3.0.image.gz UNIX $ rm 0.3.0.image # back to original terminal shell # Simple way to put AstLinux box back to normal voip # reboot --------------------------- Create CF 'clone' from file image: --------------------------- # View what /dev makes up the mounted filesystem # Make sure you don't mess with any of these # /dev/disk0 in my Mac OS X case. UNIX $ mount UNIX $ ls /dev # Insert CF in card reader (Click "Ignore" to dialog in Mac OS X) UNIX $ ls /dev # note the new /dev, /dev/disk1 in my case. # be VERY careful here, you MUST find the correct /dev # it may be different for you. UNIX # gunzip -c 0.3.0.image.gz >/dev/disk1 # For my Mac OS X case, a dialog may appear when finished, Click "Ignore". # Mac OS X users can cleanup with... UNIX # hdiutil eject /dev/disk1 # non Mac OS X users should find the command to # 'flush' the output before removing the CF card. # Remove your CF card. --------------------------- Lonnie On Jan 23, 2006, at 2:42 AM, Enzo Michelangeli wrote: > ----- Original Message ----- > From: "Lonnie Abelbeck" <[EMAIL PROTECTED]> > To: "Discussion of AstLinux - Asterisk on Compact Flash" > <[EMAIL PROTECTED]> > Sent: Monday, January 23, 2006 9:45 AM > Subject: Re: [Astlinux-users] How to clone a CF card > > >> Enzo, >> >> Thanks for addressing this issue. I want to make a backup net4801 >> box. >> >> I am using a net4801 with /mnt/opt and /mnt/kd on a three partition >> CF, >> /dev/hda1, /dev/hda2 and /dev/hda3. >> >> You say I MUST make /dev/hda3 read-only like hda1 and hda2. > > Yes, or else the filesystem could be modified during the copying > process, > and the destination would get a corrupted IMAGE. > >> If I >> understand you (say my AstLinux box has a dns of "voip"), and my local >> Unix box (Mac OS X) has a prompt of "UNIX $". >> >> --------------------------- >> UNIX $ ssh [EMAIL PROTECTED] >> Password: >> voip # asterisk -r "stop now" >> voip # mount -o ro,remount /mnt/kd >> >> UNIX $ ssh [EMAIL PROTECTED] "dd if=/dev/hda" >/tmp/image >> Password: >> UNIX $ sync >> >> voip # reboot >> ------------------------- >> >> Is this correct? > > Yes. The "sync" command ensures that the disk buffers get properly > flushed, and would be useful especially on the Astlinux side: > > UNIX $ ssh [EMAIL PROTECTED] "dd if=/dev/hda; sync" >/tmp/image > >> If I then "cat" (UNIX $ cat /tmp/image >/dev/disk1) this image to a >> new >> CF of the same size, > > ...then "flush"... :-) > >> inset it into a DIFFERENT net4801, do I need to >> change anything? Will the /mnt/kd/ssh folder need to be changed? > > I'd say not, unless you want to change the private key of the host > (probably a wise thing to do). In that case just remove > /etc/ssh/ssh_host_key, /etc/ssh/ssh_host_rsa_key and > /etc/ssh/ssh_host_dsa_key , and they should be recreated. > > (This only in case in recent versions they have been made > non-volatile: in > older releases, like the 0.2.8, the whole /etc/ssh was symlinked to > /tmp/etc/ssh and the keys were automatically destroyed powering off the > machine, so there was no need of deleting them manually). > > Enzo > > _______________________________________________ > Astlinux-users mailing list > [email protected] > http://lists.kriscompanies.com/mailman/listinfo/astlinux-users > > Donations to support AstLinux are graciously accepted via PayPal to > [EMAIL PROTECTED] > _______________________________________________ Astlinux-users mailing list [email protected] http://lists.kriscompanies.com/mailman/listinfo/astlinux-users Donations to support AstLinux are graciously accepted via PayPal to [EMAIL PROTECTED]
