-1

I've seen that there's a good amount of relocated sectors on my home server with one harddrive, so it should be about time to replace it.

Sure, I can plug the replacement harddrive in, format and begin from scratch, but it doesn't feel so compelling.

As this home server currently isn't equipped with any RAID, I guess that I am stuck at connecting a second harddrive and transfer the content from the old harddrive onto the replacement and then switch the default harddrive inside the OS (Ubuntu 10.10).

For me, having zip-zero experience of this, I do not know where to begin.

  1. How can I transfer the data from Harddrive 1 -> Harddrive 2?
  2. How do I switch the "main harddrive" inside my Ubuntu 10.10?

Thanks

Industrial
  • 1,559
  • 5
  • 24
  • 37

2 Answers2

1

Clone your Ubuntu installation onto a new hard disk

moving to a larger drive in linux

ooshro
  • 10,874
  • 1
  • 31
  • 31
0

It's possible there are custom tools for this, but if you want to get your hands dirty and do it yourself, the stages are:

  1. Attach the new HDD physically. Identify the device (/dev/hdc, /dev/sdba, whatever).
  2. Use fdisk to partition the new disc. Don't forget to tag the partition that will be the new /boot as being bootable.
  3. Mount the new partitions one at a time, on /mnt. With the machine quiescent (single-user mode is best), use dump | restore to copy the data from each old partition to each new partition.
  4. Use grub to install an MBR on the new HDD.
  5. Remove (and carefully store!) the old HDD, replacing it with the new one. Have bootable media to hand in case it fails to boot from the new HDD.
  6. Once you're completely happy with the new HDD, put the old one into a chassis and use DBAN to securely wipe it before disposal.

Each of these steps has a lot of fiddly detail involved, and you are strongly advised to read around each step, and try it on a dev box, before doing it on your live box. But you will have learned a lot about low-level systems admin by the time you've done all this. Good luck!

MadHatter
  • 78,442
  • 20
  • 178
  • 229