Categories
boot clonezilla GRUB grub-install

Fixing the CloneZilla GRUB issue

Yesterday I wrote how I was experiencing some troubles rebooting a system after using clonezilla to clone the current drive onto a fresh HD. The old drive was 11 years old. It probably could have gone on for a couple mor years, but why take a chance.

A lot of the “fixes” for this issue are based on the older GRUB and these commands are simply not available in GRUB 2.0. These fixes ask you to use command like



find /boot/grub/stage1
boot (hd0,0)
setup hd(0)

Those are not there in GRUB 2.0

I managed to fix my issue by getting the machine to boot in a live disk. Well actually I used the older drive as the boot drive and the new drive as the secondary drive. With this setup I mounted the partition where the /boot folder was. In my case it was within the / mount point.



mount /dev/sdb1 /mnt

And then run the grub-install command as such



grub-install --no-floppy --root-directory=/mnt /dev/sdb

The process completes and the machine will reboot immediately – meaning that I don’t have a chance to shutdown and remove the older drive.

I got the machine up now, but the NIC was not being recognised. It was odd, the card had power, but a lspci did not list it as a device. A quick reseat of the card solved that issue and my machine was back up.

I need to keep this notes for the next machine…the NAS, eeek!

Categories
boot clonezilla GRUB Linux MBR Ubuntu

Conezilla and GRUB a match

The backup server in the office is obviously a quite critical machine. Its the only thing preventing user’s from permanently losing their data. The machine was an old machine that I had bought from a charity. I replaced the powesupply and the internal fans and upgrade the NIC and installed a RAID.

Well I had been checking the drive health by SMART using the LINUX package smartctl. I don’t fully understand the statistics in this package but it did look like the drive was wearing and due for a replacement. So I’d heard of Clonezilla and thought this was the perfect solution.

I had a 160GB drive I bought over a year ago for just this purpose. So I installed it and turned off the RAID while I figured things out.

I fired up clonezilla and went through the steps. I ran into a couple of hitches along the way.
Clonezilla failed to copy one of the partitions because it wasn’t clean. I had to fsck that partition and start over.

The second was that I asked Clonezilla to copy over the GRUB in the MBR – but this also failed as I was still on GRUB 1.x and Clonezilla wanted to put in GRUB 2.0. So on the reboot the machine did not boot. It dumped me into a min-GRUB command line. This didn’t have all the commands of the OS version. So I was a bit stuck.

Now the frustrating bit. Somehow as I was rejigging the cables and devices the machine failed to POST, which was sad indeed. I have a spare but this sad as this machine really had been a workhorse for four years now.

I now have to use another unused machine (lucky me) to take over the backup duties. I did try the Ubuntu repair-system process but this failed to install GRUB for some reason. Which does worry me a lot. Obviously another way would be to re-install Ubuntu fresh to the disk and clone over the partitions. That would be a last resort.

Any advice would be most welcome.