Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.