View previous topic :: View next topic |
Author |
Message |
ilswyn n00b
Joined: 13 Nov 2002 Posts: 26
|
Posted: Thu Jan 16, 2003 12:15 am Post subject: How do I copy one drive to another? And expand partitions? |
|
|
Hello,
What I want to do is copy my 40GB drive (ext3) to my new 80GB drive and I want to expand the root partition to fit the 80GB. What is the easiest way of doing this sucessfully or do I just have to reinstall gentoo and everything? (that would be very painful) The Western Digital utilites failed on me, it said that there was an unformatted NTFS partition on one of the disks so apparently it can't handle ext3 (sad, I thought it would just copy over raw data).
Thanks,
Eric Newton |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Thu Jan 16, 2003 3:03 am Post subject: |
|
|
Boot from the Gentoo CD. Create and format the new partition. Mount the old and new partitions and then use tar or cp to copy the old partition over. For example:
Code: |
mkdir /mnt/oldpart
mount /dev/hdXX /mnt/oldpart
mkdir /mnt/newpart
mount /dev/hdXY /mnt/newpart
cp -ax /mnt/oldpart /mnt/newpart
|
or
Code: |
mkdir /mnt/oldpart
mount /dev/hdXX /mnt/oldpart
mkdir /mnt/newpart
mount /dev/hdXY /mnt/newpart
tar cplf - /mnt/oldpart | (cd /mnt/newpart; tar xvpf -)
|
You would have to modify /etc/fstab and grub.conf to reflect the new root partition. If you want to copy the boot partition (if it is a separate one), you would have to do that too.
There is also a script here that automates this process. As shown in that script, you can "mount --bind / <some_dir>" to do the copy instead of using the CD.
Don't blow away the old partition before you boot with the new one and are convinced that everything is fine.
[EDIT]Edited to make sure that /dev is copied properly.[/EDIT] |
|
Back to top |
|
|
ilswyn n00b
Joined: 13 Nov 2002 Posts: 26
|
Posted: Thu Jan 16, 2003 4:37 am Post subject: |
|
|
Heh.. just copying it all seemed too easy but I guess I was wrong. |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Thu Jan 16, 2003 4:40 am Post subject: |
|
|
It is not too bad Just make sure that you don't blow away the old partition until you are REALLY convinced that the new one works.
ilswyn wrote: | Heh.. just copying it all seemed too easy but I guess I was wrong. |
|
|
Back to top |
|
|
|