LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Failed to symbolic-link boot/initrd.img-2.6.18-4-486 to initrd.img (http://www.linuxquestions.org/questions/linux-software-2/failed-to-symbolic-link-boot-initrd-img-2-6-18-4-486-to-initrd-img-556239/)

Scotteh 05-23-2007 09:41 PM

Failed to symbolic-link boot/initrd.img-2.6.18-4-486 to initrd.img
 
I can't really give any details about what's going on here because I don't understand it at all. It happens everytime I do anything such as installing a package or removing a package. I am using Debian, and this error occurs with aptitude and with apt-get.

This is what is outputted:
Code:

Setting up linux-image-2.6.18-4-486 (2.6.18.dfsg.1-12) ...
Running depmod.
Finding valid ramdisk creators.
Using mkinitramfs-kpkg to build the ramdisk.
Failed to symbolic-link boot/initrd.img-2.6.18-4-486 to initrd.img.
dpkg: error processing linux-image-2.6.18-4-486 (--configure):
 subprocess post-installation script returned error exit status 17
Errors were encountered while processing:
 linux-image-2.6.18-4-486
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up linux-image-2.6.18-4-486 (2.6.18.dfsg.1-12) ...
Running depmod.
Finding valid ramdisk creators.
Using mkinitramfs-kpkg to build the ramdisk.
Failed to symbolic-link boot/initrd.img-2.6.18-4-486 to initrd.img.
dpkg: error processing linux-image-2.6.18-4-486 (--configure):
 subprocess post-installation script returned error exit status 17
Errors were encountered while processing:
 linux-image-2.6.18-4-486


crashmeister 05-29-2007 04:01 PM

There should what appears to be a file called initrd.img (but is just a link)in the root directory that points to /boot/initrd-version.img which is a real file.

Why it can't make this link is strange - is /boot on a mounted partition?

Scotteh 05-30-2007 06:54 AM

I don't believe it is. I never explicitly created a separate partition for it, and it isn't listed in /etc/fstab

This is pretty interesting though...
Code:

/; ls -l
lrwxrwxrwx  1 root root    23 2007-03-25 14:39 initrd.img -> initrd.img-2.6.18-4-486
lrwxrwxrwx  1 root root    27 2007-03-25 06:20 initrd.img.old -> boot/initrd.img-2.6.7-1-386
lrwxrwxrwx  1 root root    20 2007-03-25 14:39 vmlinuz -> vmlinuz-2.6.18-4-486
lrwxrwxrwx  1 root root    24 2007-03-25 06:20 vmlinuz.old -> boot/vmlinuz-2.6.7-1-386
/boot; ls
config-2.6.18-4-486  initrd.img-2.6.18-4-486      System.map-2.6.18-4-486
grub                initrd.img-2.6.18-4-486.bak  vmlinuz-2.6.18-4-486

It appears as if the vmlinuz and initrd.img symlinks in / do not point to the correct place because vmlinuz and initrd.img are in /boot, not in /.

crashmeister 05-30-2007 08:30 AM

Yeah that sounds about right - they should point to something like that for the initrd and the vmlinuz:

lrwxrwxrwx 1 root root 27 2007-05-30 10:11 initrd.img -> boot/initrd.img-2.6.21-1-k7

Are there a initrd-2.6.18-4-486 and vmlinuz under / or is that just a dangling symlink?
If those are there I'd just copy that to /boot and change the symlink to see whats going on.

Unfortunately I use Lilo as bootloader and wouldn't have the faintest idea if this is a grub related thing.I did try grub on Debian once and dumped it at once because it left the system for some reason unbootable.

Scotteh 05-31-2007 07:34 AM

I've been very happy with grub but I've never tried LILO.

initrd-2.6.18-4-486 doesn't exist in /. If I manually change the symlinks to point to /boot, could this prevent me from booting? If so, is it fixable with Knoppix? I don't fancy breaking my system. ;)

crashmeister 05-31-2007 07:56 AM

Depends on various things - with grub it _shouldn't_ prevent you from booting but I wouldn't bet on it.
As far as that is concerned it shouldn't with lilo either but thats no your concern right now.
After all you got already a dangling symlink there as is.

Are the initrd and the vmlinuz with the respective versions in /boot ?

If so try to make a symlink to boot like:

cd /
rm initrd
cd /boot
ln -s initrd-version /initrd

and the same stuff for the vmlinuz.

Then you need to make sure you got an entry in grub for the whole thing.
Thats the tricky part since I don't use grub and can't be of any help there ;)

BTW - did you try uname -a to see if you are not by any chance are running the new kernel and the warnings are bogus?

Scotteh 06-01-2007 08:17 AM

Code:

/ $ sudo mv initrd.img initrd.img\~
/ $ sudo mv vmlinuz vmlinuz\~
/ $ sudo ln -s boot/initrd.img-2.6.18-4-486 initrd.img-2.6.18-4-486
/ $ sudo ln -s boot/vmlinuz-2.6.18-4-486 vmlinuz-2.6.18-4-486
/ $ sudo /sbin/shutdown -r now

Reboot was successful, no errors that I saw. I then upgraded some program to trigger the apt-get error. I chose tzdata because it's small.

Code:

~ $ sudo apt-get install tzdata
Setting up linux-image-2.6.18-4-486 (2.6.18.dfsg.1-12) ...
Running depmod.
Finding valid ramdisk creators.
Using mkinitramfs-kpkg to build the ramdisk.
Running postinst hook script /sbin/update-grub.
Your /etc/kernel-img.conf needs to be updated. Read grub's NEWS.Debian[1]
file and follow its instructions.

  1. /usr/share/doc/grub/NEWS.Debian.gz

Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.18-4-486
Updating /boot/grub/menu.lst ... done

Press return to continue.

Which of course made me happy. Thanks for your help! It was just in time for the new kernel! :P

crashmeister 06-01-2007 08:21 AM

Strange - anyway if you are happy so am I.

Scotteh 06-01-2007 11:24 PM

If anyone happens to have the same problem I had, manually symlinking /boot/initrd.img-2.6.18-4-486 to /initrd.img-2.6.18-4-486 was unnecessary. All that needed to be done was to remove the symlink in / that was pointing to /initrd.img-2.6.18-4-486 which didn't exist.


All times are GMT -5. The time now is 07:28 PM.