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.

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 a really old hard drive with DOS and Linux partitions with LILO as the boot loader. I want a clone of this hard drive that works exactly like the original.

I made a clone using Knoppix and dd_rescue. When I plug in the newly cloned drive, the LILO boot loader stops at "LI" meaning LILO failed at that point.

Is this because I need to actually run the LILO command on the LILO partition on the new hard drive before it will work? If so, how do I do that from a live CD?


Booted from Knoppix live CD: fdisk chroot

I don't know what "open /dev/hda: Device not configured" is telling me.

share|improve this question

closed as off-topic by psusi, jasonwryan, Ramesh, Michael Homer, cuonglm Apr 6 '15 at 4:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – psusi, jasonwryan, Ramesh, Michael Homer, cuonglm
If this question can be reworded to fit the rules in the help center, please edit the question.

Have a look at my answer here. It deals with grub but you can just use lilo instead. The main idea is setting up a chroot environment. – terdon Oct 3 '13 at 20:13
@terdon That is the point I'm getting to. After I type 'lilo' to run it, I get "open /dev/hda: Device not configured". In lilo.conf; boot=/dev/hda. Does this error mean something isn't mounted correctly? – user142485 Oct 3 '13 at 21:09
Yes, your disk is almost certainly now called dev/sdX and lili.conf is still pointing to /dev/hda. If you boot a live cd and run lilo from a chroot environment as I describe in my linked answer, it should work. – terdon Oct 3 '13 at 21:12
@terdon I have ran it from the chroot environment you described and I get the "open /dev/hda: Device not configured" message. Do I need to change the entries in lilo.conf from '/dev/hda' to '/dev/sda'? I don't understand what that error is telling me. – user142485 Oct 3 '13 at 21:27
OK, then please edit your question to show what you did, including the output of sudo fdisk -l, the exact commands you used to make the chroot environment and the contents of your lilo.conf. – terdon Oct 3 '13 at 21:30

I don't remember the exact details but for a few years now, the kernel has been treating IDE hard drives as SCSI. So, what used to be /dev/hda in your old system will be /dev/sda in your new one. This is simply the naming convention for SCSI drives. In any case, your new drive is almost certainly not a classic IDE drive but either SCSI or eSATA or one of the more modern protocols.

Your system, therefore, currently has no /dev/hda, what it has, as you can see in the output of fdisk -l, is /dev/sda. Therefore, for lilo to work, you need to change all occurrences of hda with sda in your lilo.conf and then run lilo again:

 sed -i.bak 's/hda/sda/g'

The sed command will make the necessary replacement and also create a backup of your original file called lilo.conf.bak.

IMPORTANT NOTE: This assumes that the system you are trying to boot will also recognize the new hard drive as /dev/sda.

share|improve this answer
The ancient kernel being booted will still recognize the drive as hda, so the root setting needs to stay as that, and only the boot setting needs to point to sda while reinstalling lilo from the livecd. – psusi Dec 21 '14 at 15:30

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