4

I have two SATA drives, but their names /dev/sda and /dev/sdb are chosen randomly by Linux.

How can I correctly set up LILO? How can I put a stable reference to the hard drives in lilo.conf?

ADDED. Can I use udev's names (like /dev/disk/by-id/*) in lilo.conf? LILO doesn't read lilo.conf at each boot, but only once on setup MBR when I run 'lilo' without arguments. At this stage udev names are available. But how do LILO store information about disks to MBR and boot-files?

I use dual-boot with Windows, but NTFS disks have no UUID. I want to use udev's id.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255

1 Answers1

5

You'll want to use UUIDs to identify the disks and boot via that.

Run blkid on your machine to get a list of drives and their UUIDs.

Then modify your lilo.conf and use root=UUID=<DISK UUID> rather than root=/dev/sda etc.

Assumes you have a kernel version that supports UUIDs - check first by looking in /dev/disk/by-uuid. You could also use LABEL=.

didster
  • 819
  • Thank you, but I have additional questions. I've updated the main question. –  Oct 19 '12 at 09:29
  • 2
    I dont think it matters - lilo.conf will be read once when installing and whether it contains root entries by UUID or by dev doesnt matter - its the kernel that understands the "UUID=" options, not lilo. There are even scripts to automatically convert your lilo.conf to using UUIDs, like this one – didster Oct 19 '12 at 13:15