Hard disk identification problem

I have installed openSUSE 11.0 and all is running perfectly. I have made an image of my HD (let us call it HD1) on an removable media (DVD or USB HD) with the help of IFL (Image For Linux). Then I have removed HD1 and replaced it with another identical disk (HD2), to simulate the hardware crash of HD1. I have restored the image I have made previously on HD2 without problem. And I have booted with HD2. The process of booting has stopped at a certain point, asking to introduce the original disk, because the identification was wrong. I think it was because, in my etc/fstab file, the disk is identified “by id”. As I am relatively new to Linux, can someone tell me what would be the identification method which would avoid this problem. Thank you in advance.

If the problem is a bad entry in the /etc/fstab table, then all you have to do is boot to a liveCD, and then go in with an editor and edit that file.

You could try your installation CD (which has a rescue mode) or you could try a liveCD such as knoppix, or sidux, or kanotix. Make certain you back up the file before you make any edits.

Thank you for your answer and the method you propose.
I have also asked the maker of the “Image for Linux” software and they told me to use UUID instead of ID in the /etc/fstab file. It seems to me that this would not solve the problem. What do you think about it?

I don’t know the fstab functionality well enough to venture an opinion on the merits of UUID vs ID.

Note, before they came up with putting unique device identifiers in the fstab, we used to use simple: /dev/sda1 or /dev/sda2 … etc to identify the partition.

If you do boot to the rescue CD, you could run “fdisk -l” and determine what the various hard drive device assignments are, and then replace the unique (but incorrect) identifier with something simple like /dev/sdxx (where you need to fill in the appropriate “xx” ).

I think it would solve the problem. UUID is a unique label attached to each partition. It would be copied verbatim by the imaging. Disk ID on the other hand is composed of the manufacturer key, and partition, among other things, and would change if your disk model changes. You could also use plain device paths like /dev/sda1 like other suggested.

Just as an aside, I bet this drive uses an LVM partition layout is that correct? LVM uses the disk IDs by default I believe.

The suggestions already given should be fine - using a live environment and editing fstab to use the direct partition devices (/dev/sda1, /dev/sda2, etc)

You can also check out /proc for ID and UUID device information, such as:

#ls -lha /dev/disk/by-uuid/

I believe you can also change the UUID of an LVM VG or PV with:

pvchange --uuid {pv dev}
vgchange --uuid {vg name}

Cheers,
Pete Eby

Thank you for your answer. But my disk does not use a LVM partition.

As I am not yet at my ease with Linux, would you be kind enough to indicate me the detailed procedure for the two following cases?

  1. How do I have to practically make use of the direct partition devices (/dev/sda1, /dev/sda2, etc)? What would be the syntax of a line in the fstab file?
  2. In the case of UUID instead of ID, how do I proceed to make the change?
    Thank you in advance.

Something like:

/dev/sda2 / ext3 acl,user_xattr 1 1

and

/dev/disk/by-uuid/0a58e57e-a013-4db9-ad9a-50ac33e4e45d / ext3 acl,user_xattr 1 1

respectively.

To find the UUID corresponding to a partition, just ls -l /dev/disk/by-uuid and you will see it contains links to the partition devices.

You can also see the UUID of a partition by using tune2fs for ext2/3 filesystems.

Or if you are using a gui like nautilus, konqueror or thunar you can browse to /dev and see those different disk labels

The problem is not solved. Let us summarize:
I have made an image of my HD (let us call it HD1) on a removable media (DVD or USB HD) with the help of IFL (Image For Linux). HD1 has an identification (let us call it ID1). Then I have removed HD1 and replaced it with another identical disk (HD2 with ID2), to simulate the hardware crash of HD1. I have restored on HD2 the image I have made previously from HD1. And I have booted with HD2. The process of booting has stopped at a certain point, asking to introduce the original disk, because the identification was wrong.
I have booted with Knoppix and changed ID1 by ID2 in the etc/fstab file of HD2, in which the disk is identified “by id” (not a good idea, apparently). When rebooting from HD2, I am always asked to introduce the original disk (HD1). IMHO it seems that this id is present in another place, where?

Hi
It’s also referenced by grub, have a look at the /etc/boot/menu.lst
file.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.0 x86 Kernel 2.6.25.18-0.2-default
up 2 days 16:55, 1 user, load average: 0.01, 0.07, 0.04
GPU GeForce 6600 TE/6200 TE - Driver Version: 177.80

From a pragmatic perspective, and from one who does not understand much about identifying disks by “id”, why not simply use a more generic assignment, like I suggested previous?

You can determine that assignment, with that drive installed, by booting to Knoppix, and in a konsole typing:fdisk -l and take note as to what drive is the one that is giving you problem. Lets say it is called /dev/hdb1 by knoppix. OpenSUSE-11.0 uses libata, so I believe you would call it /dev/sdb1 in openSUSE.

Then simply edit the fstab, and instead of the specific id definition, replace that with /dev/sdb1 … (I would need to see the precise output of both “fdisk -l” and the “/etc/fstab” before I could be really precise).

Thanks to all of you.
I have found the way to solve my problem by keeping the identification by “id” method. It was necessary to change the disk ID in two files:
/boot/grub/menu.lst
/etc/fstab.
I do agree that this is not an elegant method and I would evolve in the future to the suggestion you made.
Thank you again for your help.

Hi
I see I entered the wrong path for menu.lst, my apologies… glad you
have it sorted.

I always use the partitioner manually when doing an install and change
it back to device name and also add a volume label. You can also
boot by volume label as well.


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.0 x86 Kernel 2.6.25.18-0.2-default
up 2 days 19:17, 1 user, load average: 1.73, 1.49, 0.74
GPU GeForce 6600 TE/6200 TE - Driver Version: 177.80