LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Image will not boot (https://www.linuxquestions.org/questions/linux-server-73/image-will-not-boot-4175571892/)

thund3rstruck 02-10-2016 09:59 AM

Image will not boot
 
So I bought a 250GB SSD to replace a 8 year old 250GB HDD for one of my Ubuntu Linux servers. Turns out that the new SSD isn't actually 250GB, its actually 240GB and because of this Clonezilla will not clone my old HDD onto my new SSD (destination is smaller than source).

So I booted into GParted, created a MS-DOS partition table and shrank /dev/sda1 to slightly smaller than /dev/sdb1

Then I booted into Clonezilla and cloned /dev/sda1 to /dev/sdb1.

Finally, I disconnected the original drive so just the cloned SSD was attached.

My problem is this, the server won't boot with the cloned drive attached. It gets to a screen that says 'Loading Operating system' and just sits there forever.

So I must have missed some critical step to make the newly imaged SSD partition bootable. I did go back into GParted and set the boot flag on the first partition of the cloned drive but no luck still won't boot.

Does anyone know what I need to do in addition to cloning /dev/sda1 to /dev/sdb1 to make /sdb1 bootable? Again, I can't clone the entire disk from /dev/sda to /dev/sdb because /dev/sdb is slightly smaller than /dev/sda

Thanks in advance

fmattheus 02-10-2016 10:27 AM

Chances are you have the master boot record on the disk, not on the partition. You need to copy the MBR from your original drive to the new one.

Assuming the original drive is stil /dev/sda and the new one is /dev/sdb, here's the command.
Code:

dd if=/dev/sda of=/dev/sdb bs=512 count=1
It copies the first 512 bytes, which is where the MBR lives

thund3rstruck 02-10-2016 12:20 PM

Quote:

Originally Posted by fmattheus (Post 5498140)
Chances are you have the master boot record on the disk, not on the partition. You need to copy the MBR from your original drive to the new one.

Assuming the original drive is stil /dev/sda and the new one is /dev/sdb, here's the command.
Code:

dd if=/dev/sda of=/dev/sdb bs=512 count=1
It copies the first 512 bytes, which is where the MBR lives

Thanks! I'm certain that was it; but before I had a chance to give it a try I booted to this OSS recovery CD and it reinstalled grub and fixed the problem :)


All times are GMT -5. The time now is 12:17 PM.