+ Post New Thread
Results 1 to 14 of 14
*nix Thread, Change hard drives in Technical; To put it shortly I have an old IDE hard drive that is beginning to die. I want to replace ...
  1. #1
    llawwehttam's Avatar
    Join Date
    Nov 2008
    Location
    Birmingham
    Posts
    223
    Thank Post
    56
    Thanked 3 Times in 3 Posts
    Blog Entries
    2
    Rep Power
    14

    Change hard drives

    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.

  2. #2

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,622
    Thank Post
    1,240
    Thanked 777 Times in 674 Posts
    Rep Power
    235
    Quote Originally Posted by llawwehttam View Post
    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

  3. #3

    Join Date
    Oct 2007
    Location
    Northamptonshire
    Posts
    310
    Thank Post
    20
    Thanked 80 Times in 68 Posts
    Rep Power
    43
    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.

  4. #4

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    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.

  5. #5
    llawwehttam's Avatar
    Join Date
    Nov 2008
    Location
    Birmingham
    Posts
    223
    Thank Post
    56
    Thanked 3 Times in 3 Posts
    Blog Entries
    2
    Rep Power
    14
    Quote Originally Posted by dhicks View Post
    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
    Quote Originally Posted by Ashm View Post
    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.
    Quote Originally Posted by powdarrmonkey View Post
    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
    Code:
    sudo install-grub && sudo update-grub
    i think.

    Thanks for the help

  6. #6
    danbuntu's Avatar
    Join Date
    Dec 2009
    Location
    Maidstone, Kent
    Posts
    292
    Thank Post
    0
    Thanked 53 Times in 50 Posts
    Rep Power
    19

    Take a look at this post

    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.
    Last edited by danbuntu; 20th January 2010 at 09:59 AM.

  7. #7

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Quote Originally Posted by danbuntu View Post
    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.

  8. Thanks to powdarrmonkey from:

    llawwehttam (20th January 2010)

  9. #8
    danbuntu's Avatar
    Join Date
    Dec 2009
    Location
    Maidstone, Kent
    Posts
    292
    Thank Post
    0
    Thanked 53 Times in 50 Posts
    Rep Power
    19
    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

  10. #9

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Quote Originally Posted by danbuntu View Post
    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 , and that's not a pretty mess to be in.

  11. #10
    pwds's Avatar
    Join Date
    Dec 2008
    Location
    Derby
    Posts
    279
    Thank Post
    73
    Thanked 48 Times in 38 Posts
    Rep Power
    20
    Clonezilla is free and will allow you to clone between two discs from a live CD.

  12. #11
    llawwehttam's Avatar
    Join Date
    Nov 2008
    Location
    Birmingham
    Posts
    223
    Thank Post
    56
    Thanked 3 Times in 3 Posts
    Blog Entries
    2
    Rep Power
    14
    Quote Originally Posted by pwds View Post
    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.

  13. #12
    pwds's Avatar
    Join Date
    Dec 2008
    Location
    Derby
    Posts
    279
    Thank Post
    73
    Thanked 48 Times in 38 Posts
    Rep Power
    20
    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.

  14. #13

    Join Date
    Oct 2008
    Posts
    213
    Thank Post
    2
    Thanked 11 Times in 11 Posts
    Rep Power
    21
    I can recommend clonezilla but be careful if you have bad sectors on there, most duplicators bug out when the source has bad sectors.

  15. #14
    AIT
    AIT is offline
    AIT's Avatar
    Join Date
    Dec 2009
    Location
    Nottingham
    Posts
    369
    Thank Post
    46
    Thanked 32 Times in 30 Posts
    Rep Power
    19
    can i suggest a free live cd clonezilla???

SHARE:
+ Post New Thread

Similar Threads

  1. Copying Hard Drives
    By marvin in forum Windows
    Replies: 20
    Last Post: 15th April 2010, 12:21 PM
  2. Photoshop and Hard Drives
    By titch in forum General Chat
    Replies: 1
    Last Post: 21st May 2009, 03:52 PM
  3. Hard drives failing!
    By googlemad in forum General Chat
    Replies: 5
    Last Post: 31st March 2008, 10:28 PM
  4. disposing of old hard drives
    By chrbb in forum How do you do....it?
    Replies: 28
    Last Post: 29th November 2007, 11:29 AM
  5. Faulty hard drives
    By Jobos in forum Hardware
    Replies: 4
    Last Post: 4th July 2007, 05:07 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •