Tricky Slackware update
#32 Henry, Wednesday, 06 January 2010 10:15 AM (Category: Linux)
(Tags: slackware)

I check my Slackware installations once a week to see if there are any updates. Yesterday, there were several. The Gnu compiler had an upgrade, glibc and the kernel. There was a warning that libata had changed and finally all vestiges of calling hard disks hda, hdb, etc was gone, and all hard disks would be sda, sdb, etc. A warning was issued to change /etc/fstab and /etc/lilo.conf before hand. All but one of my servers and desktops were already over on the sda pattern, and nothing needed to be done. My home server is a little older and it still had a hda. This one gave me some grief.

I changed /etc/fstab as directed, but "forgot" to change lilo.conf and that started a problem. When I rebooted, it couldn't mount root, and the boot failed. I booted from the Slackware cdrom, and got to the command line and had access to lilo.conf but I had a problem. Booting from the original Slackware 13 cdrom had me viewing the hard disk as hda. But if I booted from the hard disk, it was seen as sda. My problem was because I had a faulty understanding of lilo. I researched for a while, corrected my understanding and fixed the problem.

I booted from the Slackware 13 cdrom and got to the command line. I mounted the hard disk:

mount /dev/hda1 /mnt

Changed down to /mnt/etc and edited lilo.conf. There are two sections affected - boot= and root=. The line

boot=hda

refers to where to install the lilo data NOW, so this had to be set to hda because that was where the hard disk was right now. The line

root=hda1

refers to where to find root after booting. After booting, this would be sda1, so the line should be

root=sda1

I changed that and saved the file, then ran lilo (requiring a little more research)

/mnt/sbin/lilo -r /mnt

Then I rebooted, and it all started correctly. I changed lilo.conf again, because now the hard disk is seen as sda, so the boot line had to change to

boot=sda

I saved it and booted again, and the problem was over. I learnt some things. Mostly, I need to follow instructions better. But because I didn't, I now have a better knowledge of lilo's behaviour and configuration. And the home server is back in operation and all is well.

Addendum: I have found another server with the same hda issue. This time I remembered to change lilo and run it. I changed the root= line, ran lilo and it rejected it with "Fatal: Illegal 'root=' specification: /dev/sdb1". I experimented with this and found the answer. I booted from the Slackware install disk, mounted the drive and edited lilo.conf. When I ran lilo again, it worked. I think the difference is this: if you are editing lilo.conf on the disk you booted from, it checks the root= line and will reject it if it is not found. If you boot from another disk, like the Slackware installation DVD or CDROM, and run lilo, it does not check the root= line. Something like that. It worked, I got my system upgraded, and I know how to get around the problem next time.

0 comments