* stuporglue [Thu,  6 Jan 2005 at 19:53 -0700]
<quote>
> On Thu, 06 Jan 2005 20:06:53 -0600, Michael Halcrow <[EMAIL PROTECTED]> wrote:
> > On Thu, Jan 06, 2005 at 07:02:20PM -0700, Thomas Wheatley wrote:
> > > What's the best way to make an exact copy of all data (not just a
> > > backup, but an image transfer) from one hard drive to another with
> > > Linux installed?
> > >
> > > I know that there are utilities for Windows.  Any for Linux?  Does
> > > it matter if the new hard drive is bigger?
> > 
> > dd is your first option, if you want everything to be the same.  cpio
> > or star is your second.  Something like this might work:
> > 
> > find bin boot etc home lib opt root sbin usr var -print0 -depth \
> >      | cpio -pmdv --null /mnt/other-disk
> > 
> > Mike
> 
> I have almost the same question, so I'll ask it in line here. Suppose
> I made an image of my installation on annother disk, so I end up with
> some file that is named "gentoo-jan". When I go to restore that image,
>  I'm assuming I'd boot from a CD (or something) and make the partition
> ready for the "gentoo-jan" system. Do I format that partition? Does it
> have to be exactly the same size as the image is, or can it be bigger?

If it's an image of an entire drive, you would do nothing with the
drive. Just dd it right back onto the drive. All the filesystem and
partition information would be stored in the image. If you have a
different drive, it may or may not work. I'm not sure if drive geometrys
would matter and mess things up. If it did work, and the drive was
bigger, that extra space would go unused.

If it's an image of a partion (e.g. hda3) then that image would include
filesystem information, but not partition information. This type of
image would be a little more tricky to restore, but assuming you haven't
changed your partition layout at all, you can just dd it back to hda3 as
well. If you're on a new drive, you would need to make one of the
partitions the same size as the one on the image and restore the image
to that partition. Again, filesystem information is stored on the image,
so you don't have to format first.

In restoring the images, you need to use some kind of device level
copying. You don't want to copy the image file into a filesystem, or you
would just have a filesystem with /gentoo-jan.img and possibly
/lost+found/. Such device level copying could be done with cat (not
recommended), dd, or cpio. There may be others, but those are the ones I
know of.

Von Fugal

Attachment: signature.asc
Description: Digital signature

--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to