What is the difference hd0,2 or sda3 or disk/by-id/... ?

Recently I had to do some editing of /etc/fstab and /boot/grub/menu.lst

I noticed that there are at least three different ways to define the disk partitions:


I understand that all three lines (above) point to the 3rd partition on my drive. What I don’t understand is: why are there three different ways of doing that? Isn’t it easier to always use the same notation? I personally like the /dev/sda3 one.

Probably there is a reason to have these three different ways of notation.
Can someone explain the philosophy behind it?

The (hd0,2) notation is only used by GRUB, not Linux. So you can’t substitute GRUB notation in /etc/fstab, or use Linux notation in GRUB, except in kernel parameters where they aren’t interpreted by GRUB, just passed to the kernel.

As for the other two on some systems the path depends on the order in which the disks come online. On such a system, you might want to prevent mounting the wrong disk by mounting by-id.

There are actually two other methods, by-label and by-uuid, look at the directories in /dev/disk/.

Thanks a lot!
Things are much clearer now.