Clonezilla disk to disk clone on a dual boot ubuntu karmic & XP setup - cannot open '/boot/grub/device.map'

3

1

I just tried to clone a failing existing boot drive for a dual boot system with Ubuntu karmic and Windows XP installed using Clonezilla. The cloning worked fine right up until the end when I got the following error:

Running: grub-install --no floppy --root-directory=/tmp/hd_img.twABYW /dev/sdb
grub-probe: error: Cannot open '/boot/grub/device.map'
/usr/sbin/grub-install:line 374: [: =: unary operator expected

What's my next step?

I imagine I need to somehow rebuild my boot record for Windows and Ubuntu and edit grub.

srboisvert

Posted 2010-02-26T16:41:03.530

Reputation: 139

Answers

2

When you want to re-install Grub from a system that you cannot boot, you usually boot from a live CD like Knoppix or Ubuntu. There you mount your Linux installation:

mount /dev/sdbX /mnt

Where X is the partition number on your hard drive. Then, you have two possibilities. Either you install the Grub version installed on your live CD:

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

Or you install the Grub version on your Linux installation:

chroot /mnt /bin/bash
grub-install --no-floppy /dev/sdb
exit

If this still throws the same error, you should send us that line of the grub-install script and the lines above it (using head -374 /usr/sbin/grub-install | tail -10).

cdauth

Posted 2010-02-26T16:41:03.530

Reputation: 323

chroot is often not as simple as this, but there's a good tutorial on using chroot for those who need more detail. – quack quixote – 2010-04-12T08:17:23.240