Jump to content

Recommended Posts

Posted

To put it shortly I have an old IDE hard drive that is beginning to die. I want to replace it with a nice new 500GB hard drive but I don't want to reinstall, I just want to clone the HDD to the new 500Gb one.

 

I need the software to be free and I cannot run it from a windows machine so either a linux program or a live CD would be great. Also if possible I would like it to also copy the MBR and obviously the partition layout.

 

Any ideas appreciated.

Posted
I have an old IDE hard drive that is beginning to die. I want to replace it with a nice new 500GB hard drive but I don't want to reinstall, I just want to clone the HDD to the new 500Gb one.

 

Plug the new drive in, copy files between the two. I assume your new 500GB drive is a SATA drive, as I don't think I've seen a 500GB IDE one for sale recently. Does the motherboard of the PC have both SATA and IDE connections, or do you have a separate SATA card?

 

I would unplug the original harddrive from the motherboard (leave it in the case, though) and plug the new one in. Boot from your original Ubuntu install CD, install Ubuntu on the new harddrive so you get all the partitioning and the GRUB boot loader set up correctly. Then switch off the machine, plug the original harddrive back in again and boot from the Ubuntu installer CD to a command-line prompt. Mount the new harddrive's OS partition, erase all the files from that OS partition, mount the original harddrive's OS partition and copy all the files from the original harddrive to the new one. Do the same for any other partitions you had set up. Switch off, unplug the old harddrive, you should now be able to boot from the new drive.

 

Make sure you don't get confused between the old and new harddrives, obviously. If you're moving from IDE to SATA you might need to change /etc/fstab to mount /dev/sda0 instead of /dev/hda0, or similar.

 

--

David Hicks

Posted
Assuming you're not using LVM you should be able to use gparted live cd to copy & expand the partitions from the old drive to the new one. Then use the Ubuntu installer cd to repair grub.
Posted

Boot from a Knoppix live disk and copy the partition, then grow it. Mount the new one, chroot to it in a shell and update your fstab mappings and reinstall grub to the MBR (Ubuntu, right? - dpkg-reconfigure grub).

 

With LVM, I recall you can copy a filesystem snapshot to another disk, but I don't remember the details.

Posted
Plug the new drive in, copy files between the two. I assume your new 500GB drive is a SATA drive, as I don't think I've seen a 500GB IDE one for sale recently. Does the motherboard of the PC have both SATA and IDE connections, or do you have a separate SATA card?

Yes the motherboard has both IDE and SATA but it is quite old

I would unplug the original harddrive from the motherboard (leave it in the case, though) and plug the new one in. Boot from your original Ubuntu install CD, install Ubuntu on the new harddrive so you get all the partitioning and the GRUB boot loader set up correctly. Then switch off the machine, plug the original harddrive back in again and boot from the Ubuntu installer CD to a command-line prompt. Mount the new harddrive's OS partition, erase all the files from that OS partition, mount the original harddrive's OS partition and copy all the files from the original harddrive to the new one. Do the same for any other partitions you had set up. Switch off, unplug the old harddrive, you should now be able to boot from the new drive.

 

Make sure you don't get confused between the old and new harddrives, obviously. If you're moving from IDE to SATA you might need to change /etc/fstab to mount /dev/sda0 instead of /dev/hda0, or similar.

 

--

David Hicks

 

Assuming you're not using LVM you should be able to use gparted live cd to copy & expand the partitions from the old drive to the new one. Then use the Ubuntu installer cd to repair grub.

 

Boot from a Knoppix live disk and copy the partition, then grow it. Mount the new one, chroot to it in a shell and update your fstab mappings and reinstall grub to the MBR (Ubuntu, right? - dpkg-reconfigure grub).

 

With LVM, I recall you can copy a filesystem snapshot to another disk, but I don't remember the details.

 

Ubuntu is using Grub2 as of 9.10 so its now

sudo install-grub && sudo update-grub

i think.

 

Thanks for the help

Posted (edited)

Take a look at this post. This will let you clone the existing disk onto a new one and then boot from the cloned disk;

 

 

Clone your Ubuntu installation onto a new hard disk | Linux.com

 

 

The other alternative is to use a program like simplebackup to back up you home partition, /var ,/usr etc to a network share. Install ubuntu onto the new drive and use simplebackup to restore your backups. Although obviously you will need to reinstall your programs etc.

Edited by danbuntu
Posted
Take a look at this post. This will let you clone the existing disk onto a new one and then boot from the cloned disk;

 

 

Clone your Ubuntu installation onto a new hard disk | Linux.com

 

From experience, I'd still use Knoppix and a graphical gParted. It's much safer.

 

The other alternative is to use a program like simplebackup to back up you home partition, /var ,/usr etc to a network share. Install ubuntu onto the new drive and use simplebackup to restore your backups. Although obviously you will need to reinstall your programs etc.

 

This is riskier, because there's a good change you'll confuse the package manager in the process, and then it will stop playing nicely.

  • Thanks 1
Posted

the package manager won't have a problem with /home and /var but your right the other partitions could start to cause a problem. But then it all depends and how much the system has had new things installed and been tweaked.

 

You can also do things like export your sources list and a list of all installed deb packages and then use those to quickly reinstall everything a fresh on a new system - but things are no starting to get a bit fancy.

 

From experience, I'd still use Knoppix and a graphical gParted. It's much safer.

 

The advantage over this method is that you won't need to play around with reinstalling grub afterwards

 

I'd take a look at gparted live if you haven't already - it's much faster to download and burn then knoppix :)

Posted
the package manager won't have a problem with /home and /var but your right the other partitions could start to cause a problem. But then it all depends and how much the system has had new things installed and been tweaked.

 

Best example that comes to mind is copying /usr but not /var/lib, where package manager state data is held. Then you have things partially installed that it doesn't know about (actually, everything - even Required and Important packages, which will really screw it up).

 

Or vice-versa - you will have no actual files installed, but apt thinks everything is :thumb:, and that's not a pretty mess to be in.

Posted
Clonezilla is free and will allow you to clone between two discs from a live CD.

 

I have seen clonezilla used before but only over a network and I wasn't aware that It could clone in the same machine. One query though, How does it handle differently sized disks?. I may go down this route.

Posted

There is a live CD that I have used in the past- not sure if it can dynamically resize partitions but there are other boot CD's like PartEd which can do this.

 

I appreciate this does make it a two step process.

 

If the OP is a PC Pro subscriber and has past cover discs then Acronis True Image home will copy and resize partitions between local drives and was given away a while back. Otherwise it is [ame=http://www.amazon.co.uk/Acronis-True-Image-Home-2010/dp/B002NGO1KO/ref=sr_1_1?ie=UTF8&s=software&qid=1264018309&sr=8-1]inexpensive[/ame] and might be worth the time saving as the boot disc is OS agnostic (although it may struggle with some file systems). I've never actually installed the Windows Client as the bootable disc does everything I need.

Posted
I can recommend clonezilla but be careful if you have bad sectors on there, most duplicators bug out when the source has bad sectors.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...