Henry Poon's Blog

Moving an OS to another disk and still have it boot with Linux

For the longest time, I’ve had an 80 GB HDD running my Windows partition (dual-boot setup with Ubuntu on a SSD), but now I’ve finally upgraded the Windows partition to an SSD as well. I looked into how to clone my Windows partition onto the SSD, such that I can still boot the disk.

I already have Ubuntu as my main OS, so copying the disk was easy using dd, which allows copying all the contents of one disk to another. This works well when the new hard drive is greater than or the same size as the current hard drive (I upgraded from a 80GB HDD to a 128GB SSD).

First I run this to see which disk I am copying from and to

fdisk -l

Then I run dd. If I am copying from /dev/sda to /dev/sda, then it’s:

dd if=/dev/sda of=/dev/sdb

But sometimes the disks don’t have the same size, so I used gparted to move/resize the partitions to make use of the extra space on the new disk. gparted complained that it might make my disk no bootable, but the disk was still bootable for me nonetheless. I didn’t even have to mess with any grub bootloader settings either. I simply unplugged the old disk, and left the new disk plugged in and booted into the new disk no problem.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Next Post

Previous Post

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2022 Henry Poon's Blog

Theme by Anders Norén

%d bloggers like this: