Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do I copy one drive to another? And expand partitions?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
ilswyn
n00b
n00b


Joined: 13 Nov 2002
Posts: 26

PostPosted: Thu Jan 16, 2003 12:15 am    Post subject: How do I copy one drive to another? And expand partitions? Reply with quote

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
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Thu Jan 16, 2003 3:03 am    Post subject: Reply with quote

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
View user's profile Send private message
ilswyn
n00b
n00b


Joined: 13 Nov 2002
Posts: 26

PostPosted: Thu Jan 16, 2003 4:37 am    Post subject: Reply with quote

Heh.. just copying it all seemed too easy :P but I guess I was wrong.
Back to top
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Thu Jan 16, 2003 4:40 am    Post subject: Reply with quote

It is not too bad :wink: 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 :P but I guess I was wrong.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum