I got a new and bigger HDD for my webserver and so I decided to clone my existing one (128GB) to the new one (512GB). The best thing was that I didn’t need to install and configure all my applications again, so here is a short manual that worked in my case.
- Download Ubuntu Desktop
- Create a bootable USB disk with Rufus
- Start from USB disk and choose “Try Linux from bootable media”
- After Linux has started open a terminal and enter the following commands to copy the disk layout:
>> sudo bash [go to superuser mode] >> fdisk /dev/sda [source disk] >> o [dump disk layout to file] >> q [quit] >> fdisk /dev/sdb [destination disk] >> d [delete] >> I [load disk layout from currently saved sda layout] >> w [write layout]
- Now clone all data from the source disk to the destination disk by following this command:
>> dd if=/dev/sda1 of=/dev/sdb1 bs=64K conv=noerror,sync [blocksize 64K, don't stop on error and keep syncing] Don't mix up input and output disk!!!
- Now you have to make the destination disk bootable again:
>> mount /dev/sdb1 /mnt >> grub-install --root-directory=mnt /dev/sdb
- If all worked correctly you can optionally open gparted and resize the cloned partation to your needings.