PDA

View Full Version : [SOLVED] Copying Ubuntu from one drive to another



tomdabullet
October 27th, 2010, 09:27 PM
Hi

I installed Ubuntu 10.10 64 Bit on a 20GB drive and it is running fine, no problems. But after installing a 10GB Windows XP virtual machine I'm running low on disk space. I want to copy this setup onto my 160GB drive in a 40GB partition so that i have 2 copies and can run a few more VM's if i want to and have more free space. Is there an easy way to do this?

PS : Wasn't sure if this was the right forum to post it on but it seemed close enough

Tom

sikander3786
October 27th, 2010, 10:41 PM
If you just want to increase the disc space of Ubuntu partition, you can expand it to take some more space on your drive.

If you want to copy it over to a new drive, consider using a cloning software like clonezilla.

http://clonezilla.org

or the terminal command dd. See the man page for details.


man dd

ronparent
October 27th, 2010, 11:03 PM
Ive used ^c and ^v in gparted on a live cd to copy a partition from one drive to another. Since the copy will have the same UUID as the original it is best to remove the original from the computer after copying (otherwise you may not know which system you are booting to). You would also have to reinstall grub to the new drive to boot to the new install. Have fun.

sikander3786
October 27th, 2010, 11:09 PM
Ive used ^c and ^v in gparted on a live cd to copy a partition from one drive to another.

Doesn't the partition size remain the same that way?

Sylslay
October 27th, 2010, 11:21 PM
one step for copy partition
one step for resize partion.


for dd comand use with care:

copy MBR , just to have backup
dd if=/dev/sda of=/boot/mbr_backup bs=512 count=1

restore MBR
dd if=/boot/mbr_backup of=/dev/sda bs=446 count=1

How copy all partition with dd, no idea

ronparent
October 28th, 2010, 05:00 AM
Yes, exactly. The grub reinstall is itself a simple two step process.

https://help.ubuntu.com/community/Grub2#Reinstalling GRUB 2

tomdabullet
October 28th, 2010, 06:10 PM
Did it last night using ronparent's method as it looked the more simple. Had to remove the smaller partition afterwards as the UUID was confusing it.

Thanks a lot guys

Tom

ronparent
October 28th, 2010, 06:15 PM
Great to hear you got it worked out. Suggest you mark the thread as solved.