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 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?

Update:

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
2  
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
show 1 more comment

1 Answer

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'
 lilo

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