[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: hard drive migration



On Tue, Mar 29, 2005 at 12:43:53AM -0700, Keziah W wrote:
> Hello,
> 
> I currently have Debian installed on a 10 GB partition of an IDE hard
> drive. I just got a bigger hard drive (also IDE), and have partitioned
> 30 GB for Debian. I want to move my existing Debian installation to
> the larger drive, but I am not sure if that will break the
> installation.
> My root partition right now is hda2. The partition that I want to copy
> it to is hdb1, but after I copy it I would like to make it the master
> drive, so it will be hda1.
> So, basically, if the name of the root partition changes from hda2 to
> hda1, will that break my Debian installation?
> 
> If that will work:
> 
> What flags do I need to use with cp to copy the full contents of a
> drive, with the symlinks still pointing to the same files? Will "cp
> --no-dereference --preserve=all" work?
> 
> -----------------------------------------
> 
> Is there some way to do all this with the packaging system, maybe like
> installing the core onto the new partition, and then copying the
> packages from the old one?
> 
> 
> 
> Thank you!
> Keziah
> 
Hi Keziah,

second part first, you could do a debootstrap, e.g.:

- dpkg --get-selections > debian.packages
- debootstrap sarge /mnt/hdb1 http://ftp.cx.debian.org/debian
  chroot /mnt/hdb1
  Setup networking, fstab etc.
- Shutdown, change disks and reboot new system
- dpkg --set-selections < debian.packages
- apt-get update
- apt-get upgrade

I would prefer, however, to use the cp approach. I haven't used cp for
this, so someone else should comment on that. Instead I have
successfully used rsync, even via network, to clone a machine.

rsync -avx / /mnt/hdb1

The 'x' for not crossing file system boundaries. The advantage over the
above method is that you keep all you configuration.

Hth,
-- 
Andreas Rippl -- GPG messages preferred
                 Key-ID: 0x81073379

Attachment: signature.asc
Description: Digital signature


Reply to: