Imaging OpenSUSE or SUSE enterprise using dd

Many times I have used dd to image OS disks under many
different distro. e.g. dd if=/dev/sda of=/dev/sdb bs=4096
When I try this with OpenSUSE or SUSE Enterprise everything
copies correctly however, when I boot the imaged drive,
the boot loader is trying to locate the image using something like /dev/by_id///
where grub is looking for some partition based on the original
disk partition+serial number. Of course the new disk has a different
serial number and the original can’t be found.
Is there a way to boot from the distro CD in rescue mode
and reinstall the grub boot loader on the freshly imaged drive? Or:
is there a better way to image disks?

Thanks for any help.

–marc

Hi
You need to edit /boot/grub/menu.lst and /etc/fstab (maybe /boot/grub/device.map?)

The default install uses dev-id, but can be changed during install via the fstab options. You can also modify the settings in YaST Partitioner.

When you image a system you are correct in the issue that you have seen. The two files that effect you are device.map & fstab. Both files can instead be set to use /dev/sdxy instead of disk by ID, but no matter what you do, you must modify these two files and even perhaps menu.lst file, to construct the correct setup for the target PC. When using /dev/sdx, drive letters can change if you move drives around. Disk by ID does not change, which is the default, but will be different with a new hard drive and or a new PC. When you install openSUSE, it does set you up properly for the new system drives. Taking the image to another computer or installing a new hard drive to an existing PC will require extra effort on your part to make it work. You can boot from an openSUSE LiveCD and use it to determine the new /dev/sdx assignment or determine the correct disk by ID and then modify the system files I mentioned to set the new system straight. The YaST Partitioner can be used to determine the new Disk By ID for instance and you can mount existing partitions and modify these system files /etc/fstab, /boot/grub/device.map and /boot/grub/menu.lst files.

Thank You,

On 2011-10-11 23:46, marc cozzi123 wrote:
>
> Many times I have used dd to image OS disks under many
> different distro. e.g. dd if=/dev/sda of=/dev/sdb bs=4096
> When I try this with OpenSUSE or SUSE Enterprise everything
> copies correctly however, when I boot the imaged drive,
> the boot loader is trying to locate the image using something like
> /dev/by_id///

You have to edit the destination system and put the correct ID references.
Three files: /boot/grub/menu.lst and devices.map, and /etc/fstab.

You can use by-id, by-label, by-path, or by-uuid.

If the original system was using labels, for example, the copy would work.

Your choice what you use :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)