Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 dont 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.

share|improve this question
up vote 3 down vote accepted

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=.

share|improve this answer
Thank you, but I have additional questions. I've updated the main question. – Corvus Oct 19 '12 at 9:29
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.