0

I am running Ubuntu 13.04 on a 250 GB hdd. This HDD has developed bad sector and I received replaced drive from Manufacturer. I am also running a RAID1 using mdm.

I want to move the existing setup to new hard drive.

Can someone please give suggestions.

Thanks for your answers.

Cheers.

vikas112
  • 131

2 Answers2

2

If you are using a RAID and your previous drive had problems, the best solution is installing from 0, since dd don't understand damaged sectors, and could migrate them (with damaged data) to your new drive and cause problems thereafter.

Do a backup of your /home directory, and restore all your data in the new drive. For having a list of all software/packages installed:

dpkg --get-selections > package_list

Then on your new system run:

sudo apt-get update && cat package_list | sudo dpkg --set-selections && sudo apt-get dselect-upgrade

With that, you will have a fresh copy of your system without possible problems that could cause the old one.

Braiam
  • 67,791
  • 32
  • 179
  • 269
0

dd is your friend :)

This command can be used to clone one drive into another.

Read more here: https://serverfault.com/questions/4906/using-dd-for-disk-cloning

Copy of answer for convenience:

dd is most certainly the best cloning tool, it will create a 100% replica simply by using the following command. I've never once had any problems with it.

dd if=/dev/sda of=/dev/sdb bs=32M Be aware that while cloning every byte, you should not use this on a drive or partition that is being used. Especially applications like databases can't cope with this very well and you might end up with corrupted data.

l3dx
  • 471