Backup and restore & GRUB openSUSE 11.3 x86-64

I do regular full and incremental backups using dar. All disk volumes are labeled and mounted by label. There is no other operating system installed.

I built a new system but due to having to RMA a disk, I built the openSUSE system on a disk from the backup cycle. This Maxstor disk has problems which is why it was moved into an external box and the backup system. I now have a replacement disk and wish to replace the Maxstor before it dies. I initially tried a disk to disk clone with clonezilla but this died complaining that a small target partition was smaller than the source partition. It had created the partition and the start and end sectors were identical. There are no problems with the new disk.

I decided that it would be a good opportunity to test a full system disk restore from the backups. I have in the past restored individual files and partitions but have never restored onto a bare boot disk.

I have restored and labeled all 6 partitions. The partition containing / has been marked as active. /boot is included in the partition containing /. fstab is valid, menu.lst is valid, device.map needs editing but this is not a problem.

What do I need to do to make this disk bootable. I have looked through the GRUB documentation but if you try some standard GRUB commands in 11.3 you get messages saying don’t do this use YAST. I have seen other suggestions ranging from trying to start the not supported system repair option to using dd to copy the MBR which seemed to trash the partitions in the users extended partition.

The YAST bootloader displays “boot from the root partition”. I assume that this is currently what is happening rather than what YAST thinks might be a good idea for next time. I suspect that all I have to do is dd the first 512 bytes of the root partition. If this is the case I can add this to the backup process. While I automate backups I do not automate restores. Each restore tends to be different and I am not sure of the best way getting grub to work on a bare disk restore.

You have a data backup not an image backup so What I’d do is install fresh and then use the restore.

The probelm is grub. Everything is there except a working boot loader. I have tried chroot to the restored root partition and then YAST2. This updated device.map and claimed to install the boot loader but grub did not get as far as displaying the menu. I trien trien
grub
root (hd0,1)
setup (hd0)

This said it succeded but grub still does not work. All I get is a black screen with a flashing cursor. There are no messages. It looks like grub can’t find stage 2 or can’t read stage 2 and the menu.lst. This is the same as when I tried to boot after installing using chroot and YAST. A previous attempt to install the boot loader seems to have updated stage2, etc., as it has a timestamp from yesterday. Sda2 has the boot flag set as it does on the original disk. I have no idea what is wrong with grub

Provided you copied everything (including Grub stage2), here’s what you can do (to make things easier):

  • remove /boot/grub/device.map if present on your new HD
  • remove the old HD - start the computer with only 1 HD - and boot from live CD or PartedMagic
  • reinstall Grub on your MBR with the Grub shell.
grub
root (hd0,1)
setup (hd0)

If you wonder where is stage2 you can also type first in the Grub shell:

find /boot/grub/stage2

and take the output of this command as argument for he root command.
Be aware that (in legacy Grub - unlike Grub2!) :
(hd0,0) -> sda1
(hd0,1) -> sda2
etc.

The old disk is disconnected as I use device by label and duplicates cause confusion. Also with the stupid power supply cables it is hard to get power to the CD/DVD at the top of the box and 4 disks at the bottom

Device.map was replaced by one attempt to get the boot loader working. I told YAST2 to propose a new config. Device map contains references to all 3 disks plus the USB external disk that contains the backups. The new disk is associated with hd0

hd0,0/sda1 is swap
hd0,1/sda2 is / which also contains /boot

Other than remove device.map, which looks correct, I have already done what has been suggested. This has got to be something silly. I set the boot flag on sda2 (hd0.1) as this is where it is on the original disk. Is this correct?

With Grub in MBR, which partition has the booflag or whether or not a bootflag is set somewhere is irrelevant. So you did reinstall Grub in MBR and it still doesn’t work? Is that HD (hd0/sda1) really the first BIOS device (0x80)? Is it set as first boot device in the BIOS? Further … is it physically connected to SATA port 1 (or 0 on some mainboards) or if it’s an IDE drive, is it the master of the first channel? Are you using SATA and IDE disks together? Do the links under /dev/disk/by-id reflect the reality of the hds? (or do they still point to the old disk?)

I am not sure where grub got installed. Where ever

grub
root (hd0,1)
setup (hd0)

tries to install it. I suspect that the standard openSUSE install puts it in the partition containing / . Grub find always reports (hd0,1). The system was initially built with a single disk and the additional disks were subsequently added and the system booted without problems. Both the power and data cables were moved from the original disk to the new disk.

The reference to the old disk in device map has been replaced by the new disk, I think by YAST. All references to partitions in menu.list are by-label, ycsroot and ycsswap. The exception is gfxmenu which refers to (hd0,1). These were put in by YAST on the original disk prior to backup and the original disk was booting without problems before it was disconnected.

I am going to try reinstalling a minimal system and check that it boots and then over write it with the backup.

The following scripts looks for the Grub bootloader in all possible locations (MBR and partitions bootsector) :

Looking for Grub and Windows bootloader in all partitions.

Problem solved. It was the boot order. Even though the WD disk replaced the maxstor disk as the first SATA drive, it became the last one in the boot sequence. It is not easy to identify the sequence of the disks when they are all the same type and the bios only shows the type. I had never changed the boot sequence and assumed that the first sata port sda1 would remain the first disk in the boot sequence unless I manually changed it. When I started the reinstall process it showed the boot sequence as sdb, sdc, sda.

I shall have to build a bootable DVD for restore to ensure that I have a working copy of dar. The static version is not included in the 64 bit openSUSE.

The dar restore and reinstallation of grub seems to work well. Disk images are not backups.

Thank you for your assistance

I might have to search in the revillon wrapping for a suitible signature