[geeks] Copy a linux disk

Joshua Boyd jdboyd at jdboyd.net
Sat May 20 10:57:29 CDT 2006


I'm trying to accomplish something on linux that is trivial on Solaris
and Irix.

I have a 20 gig disk that the IT person used to build linux from
scratch.  I don't want to mess too much with his setup so I want to copy
it to a 6 gig disk.

So, I made my single big partition on the 6 gig disk (no swap is being
used), formatted it, and used cpio to copy the contents of the 20 gig
disk (about 1.5 gigs actually used) to the 6 gig disk, then used grub to
make the 6 gig disk bootable.

Now, when I try to boot this, it says "unable to open initial console".
Googling about turns up that this is an issue with not finding
/dev/console on the file system.  So, I put the device back as the
second drive and booted from the working one again, and found /dev to be
empty on the new disk.

So, that raises a few questions:
1) Is there a better way to copy disks?  On Solaris I would
ufsdump/ufsrestory, and likewise on Irix I would use xfsdump/xfsrestore
2) Is there a good way to copy /dev entries, other than by hand.
3) How does udev effect all of this?  I thought it was automatically
supposed to kick in the /dev entries for me.
4) Is there a way to use cpio (or whatever I should be using instead)
over a ssh tunnel?  I'm pretty sure it is possible, but I've been
banging my head on it.  I want an image of the disk in a more powerful
machine to use as a build system (in a chroot environment).

After I get the 6 gig disk working, I'm going to have to repeat all of
this with a 1 gig flash card.

-- 
Joshua D. Boyd
jdboyd at jdboyd.net
http://www.jdboyd.net/
http://www.joshuaboyd.org/



More information about the geeks mailing list