LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   can't write modified lilo.conf to external USB drive. (https://www.linuxquestions.org/questions/slackware-14/cant-write-modified-lilo-conf-to-external-usb-drive-4175563318/)

camorri 01-07-2016 10:39 AM

can't write modified lilo.conf to external USB drive.
 
The title describes my problem.

Here is what I have tried.

First of all, the external HD was the only drive on my HP netbook. I purchased an SSD, installed it in the netbook, and put the original HD in an external enclosure, without modifying anything on the ( now external ) HD.

I can mount the partitions on the external HD without any problems. What I would like to accomplish is to be able to boot from the external HD, mostly for emergencies, if and when I create them.

In order to accomplish this, I have modified /etc/fstab and /etc/lilo.conf. I know I need to write the modified lilo.conf to the mbr of the external HD. I have set up a chroot environment, however, when I run the command 'lilo' I get the following errors:

Code:

root@duelie:/etc# lilo
Warning: /dev/disk/by-id/ata-TOSHIBA_MK1655GSX_Z9EDT3XIT is not on the first disk
Fatal: open initrd.gz: No such file or directory

I looked at the man page for lilo, how do I tell lilo to write to the external drive in the chroot environment? I have 3 internal drives on the system I have it plugged into now.

Both systems are Slackware 14.1 32 bit.

I used this link to set up chroot.

-->http://blog.tpa.me.uk/2009/09/29/re-...kware-boot-cd/

I looked in /foo/proc /foo/sys and /foo/dev, and I see the same things there I see on the non-chrooted host system, so I think the mount --bind commands worked.

I have also modified the /etc/conf file on the SSD netbook, and added an option to boot the external USB HD. That fails also. I suspect the reason is because the new system on the SSD is 64 bit 14.1, and the system on the USB HD is 32 bit. This is not a big deal though, Is my thinking here correct?

As always, your comments are welcome.

bassmadrigal 01-07-2016 12:02 PM

What are the contents of your /etc/fstab and /etc/lilo.conf? Also, can you provide the output of ls -la /dev/disk/by-id/? However, I believe the Warning is just that... a warning. It is probably letting you know that the drive you're attempting to write lilo to is not the primary disc (which makes sense, since you're doing it on an external drive). I don't think this will cause any problems. I think your actual issue is related to the "Fatal" error.

It isn't finding the initrd.gz file. Do you have it correctly listed in the stanza? Usually the file is placed in /boot, so the entry should read initrd = /boot/initrd.gz. In addition to the information I requested above, can you also provide the output of ls -la /boot? Have you installed secondary kernels or are you just using the stock kernels Slackware provided?

camorri 01-07-2016 12:22 PM

bassmadrigal,

Thank-you, the problem was I did not have initrd = /boot/initrd.gz; I had initrd = initrd.gz. I'm marking this solved.

For completeness, here is what you asked for.

Code:

ls -la /dev/disk/by-id
total 0
drwxr-xr-x 2 root root 740 Jan  7 10:49 .
drwxr-xr-x 6 root root 120 Jan  7 10:49 ..
lrwxrwxrwx 1 root root  9 Jan  7 05:12 ata-HL-DT-STDVD-RAM_GSA-H55N -> ../../sr0
lrwxrwxrwx 1 root root  9 Jan  7 10:40 ata-Maxtor_4G120J6_G604XC6E -> ../../sdc
lrwxrwxrwx 1 root root  10 Jan  7 05:12 ata-Maxtor_4G120J6_G604XC6E-part1 -> ../../sdc1
lrwxrwxrwx 1 root root  10 Jan  7 05:12 ata-Maxtor_4G120J6_G604XC6E-part2 -> ../../sdc2
lrwxrwxrwx 1 root root  10 Jan  7 05:12 ata-Maxtor_4G120J6_G604XC6E-part3 -> ../../sdc3
lrwxrwxrwx 1 root root  9 Jan  7 13:15 ata-TOSHIBA_MK1655GSX_Z9EDT3XIT -> ../../sdd
lrwxrwxrwx 1 root root  10 Jan  7 11:18 ata-TOSHIBA_MK1655GSX_Z9EDT3XIT-part1 -> ../../sdd1
lrwxrwxrwx 1 root root  10 Jan  7 10:49 ata-TOSHIBA_MK1655GSX_Z9EDT3XIT-part2 -> ../../sdd2
lrwxrwxrwx 1 root root  10 Jan  7 10:49 ata-TOSHIBA_MK1655GSX_Z9EDT3XIT-part5 -> ../../sdd5
lrwxrwxrwx 1 root root  10 Jan  7 10:49 ata-TOSHIBA_MK1655GSX_Z9EDT3XIT-part6 -> ../../sdd6
lrwxrwxrwx 1 root root  9 Jan  7 11:12 ata-WDC_WD1600AAJS-00PSA0_WD-WCAP93955927 -> ../../sda
lrwxrwxrwx 1 root root  10 Jan  7 05:12 ata-WDC_WD1600AAJS-00PSA0_WD-WCAP93955927-part1 -> ../../sda1
lrwxrwxrwx 1 root root  10 Jan  7 05:12 ata-WDC_WD1600AAJS-00PSA0_WD-WCAP93955927-part2 -> ../../sda2
lrwxrwxrwx 1 root root  10 Jan  7 05:12 ata-WDC_WD1600AAJS-00PSA0_WD-WCAP93955927-part5 -> ../../sda5
lrwxrwxrwx 1 root root  10 Jan  7 05:12 ata-WDC_WD1600AAJS-00PSA0_WD-WCAP93955927-part6 -> ../../sda6
lrwxrwxrwx 1 root root  9 Jan  7 10:40 ata-WDC_WD5000AAKS-00V0A0_WD-WCAWFA545240 -> ../../sdb
lrwxrwxrwx 1 root root  10 Jan  7 05:12 ata-WDC_WD5000AAKS-00V0A0_WD-WCAWFA545240-part1 -> ../../sdb1
lrwxrwxrwx 1 root root  10 Jan  7 05:12 ata-WDC_WD5000AAKS-00V0A0_WD-WCAWFA545240-part2 -> ../../sdb2
lrwxrwxrwx 1 root root  10 Jan  7 05:12 ata-WDC_WD5000AAKS-00V0A0_WD-WCAWFA545240-part5 -> ../../sdb5
lrwxrwxrwx 1 root root  10 Jan  7 05:12 ata-WDC_WD5000AAKS-00V0A0_WD-WCAWFA545240-part6 -> ../../sdb6
lrwxrwxrwx 1 root root  9 Jan  7 13:15 wwn-0x50000392316043f2 -> ../../sdd
lrwxrwxrwx 1 root root  10 Jan  7 11:18 wwn-0x50000392316043f2-part1 -> ../../sdd1
lrwxrwxrwx 1 root root  10 Jan  7 10:49 wwn-0x50000392316043f2-part2 -> ../../sdd2
lrwxrwxrwx 1 root root  10 Jan  7 10:49 wwn-0x50000392316043f2-part5 -> ../../sdd5
lrwxrwxrwx 1 root root  10 Jan  7 10:49 wwn-0x50000392316043f2-part6 -> ../../sdd6
lrwxrwxrwx 1 root root  9 Jan  7 11:12 wwn-0x50014ee1007fd0a9 -> ../../sda
lrwxrwxrwx 1 root root  10 Jan  7 05:12 wwn-0x50014ee1007fd0a9-part1 -> ../../sda1
lrwxrwxrwx 1 root root  10 Jan  7 05:12 wwn-0x50014ee1007fd0a9-part2 -> ../../sda2
lrwxrwxrwx 1 root root  10 Jan  7 05:12 wwn-0x50014ee1007fd0a9-part5 -> ../../sda5
lrwxrwxrwx 1 root root  10 Jan  7 05:12 wwn-0x50014ee1007fd0a9-part6 -> ../../sda6
lrwxrwxrwx 1 root root  9 Jan  7 10:40 wwn-0x50014ee1ae293c4e -> ../../sdb
lrwxrwxrwx 1 root root  10 Jan  7 05:12 wwn-0x50014ee1ae293c4e-part1 -> ../../sdb1
lrwxrwxrwx 1 root root  10 Jan  7 05:12 wwn-0x50014ee1ae293c4e-part2 -> ../../sdb2
lrwxrwxrwx 1 root root  10 Jan  7 05:12 wwn-0x50014ee1ae293c4e-part5 -> ../../sdb5
lrwxrwxrwx 1 root root  10 Jan  7 05:12 wwn-0x50014ee1ae293c4e-part6 -> ../../sdb6

Note, the drive in question is sdd.

and the /boot dir:

Code:

ls -la /boot
total 35104
drwxr-xr-x  3 root root    4096 Jan  7 13:15 .
drwxr-xr-x 23 root root    4096 Nov 18 11:37 ..
lrwxrwxrwx  1 root root      37 Apr 28  2014 README.initrd -> /usr/doc/mkinitrd-1.4.8/README.initrd
lrwxrwxrwx  1 root root      31 Apr 28  2014 System.map -> System.map-huge-smp-3.10.17-smp
-rw-r--r--  1 root root 1569805 Jun 11  2013 System.map-cliff-3.2.45
-rw-r--r--  1 root root 1706325 Oct 23  2013 System.map-generic-3.10.17
-rw-r--r--  1 root root 1760315 Oct 23  2013 System.map-generic-smp-3.10.17-smp
-rw-r--r--  1 root root 2667078 Oct 23  2013 System.map-huge-3.10.17
-rw-r--r--  1 root root 2724121 Oct 23  2013 System.map-huge-smp-3.10.17-smp
-rw-r--r--  1 root root    512 Mar 14  2012 boot.0800
-rw-r--r--  1 root root    512 Jan  7 13:15 boot.0830
-rw-r--r--  1 root root    209 Mar 14  2012 boot_message.txt
lrwxrwxrwx  1 root root      27 Apr 28  2014 config -> config-huge-smp-3.10.17-smp
-rw-r--r--  1 root root  126381 Jun 11  2013 config-cliff-3.2.45
-rw-r--r--  1 root root  140912 Oct 23  2013 config-generic-3.10.17
-rw-r--r--  1 root root 1440967 Mar 19  2012 config-generic-smp-2.6.37.6-smp-cliffsmini
-rw-r--r--  1 root root  141822 Oct 23  2013 config-generic-smp-3.10.17-smp
-rw-r--r--  1 root root  140912 Oct 23  2013 config-huge-3.10.17
-rw-r--r--  1 root root  141822 Oct 23  2013 config-huge-smp-3.10.17-smp
-rwxr-xr-x  1 root root  217646 Jan 10  2011 elilo-ia32.efi
-rwxr-xr-x  1 root root  250510 Jan 10  2011 elilo-x86_64.efi
drwxr-xr-x 13 root root    4096 Apr 28  2014 initrd-tree
-rw-r--r--  1 root root 4122551 Apr 28  2014 initrd.gz
-rw-r--r--  1 root root  22578 Oct 28  2013 inside.bmp
-rw-------  1 root root  34816 Jan  7 13:15 map
-rw-r--r--  1 root root    6878 Oct 28  2013 onlyblue.bmp
-rw-r--r--  1 root root  14174 Feb 14  2010 slack.bmp
-rw-r--r--  1 root root  33192 Oct 28  2013 tuxlogo.bmp
lrwxrwxrwx  1 root root      31 Apr 28  2014 vmlinuz -> vmlinuz-generic-smp-3.10.17-smp
-rw-r--r--  1 root root 3088656 Oct 23  2013 vmlinuz-generic-3.10.17
-rw-r--r--  1 root root 3272208 Oct 23  2013 vmlinuz-generic-smp-3.10.17-smp
-rw-r--r--  1 root root 5995104 Oct 23  2013 vmlinuz-huge-3.10.17
-rw-r--r--  1 root root 6251392 Oct 23  2013 vmlinuz-huge-smp-3.10.17-smp

Thank-you for your help.

MarcT 01-07-2016 12:28 PM

The error is because lilo failed to find "initrd.gz" in your chroot environment.
Check the /etc/lilo.conf for "initrd.gz" and ensure the paths are correct.

If you have no joy - post the contents of /etc/lilo.conf

KRs,
Marc

Edit: I type too slow...! :)


All times are GMT -5. The time now is 09:49 AM.