Lost initrd [Solved]

You have a problem with Salix? Post here and we'll do what we can to help.
User avatar
Van_Vinkle
Donor
Posts: 157
Joined: 25. Oct 2012, 17:39

Lost initrd [Solved]

Post by Van_Vinkle »

My computer has two Linux OS inside: aptosid, a Debian derivative, and salix. As a consequence of an aptosid's dist-upgrade, I cannot boot salix.

Diving into grub2 (which is the bootloader used by aptosid, and was running perfectly before dist-upgrade), I realized that mi [salix]/boot directory has no initrd.gz. I don't know if it has been erased by the dist-upgrade, but the fact is that now it does not exist, and I suppose that initrd is necessary. I've read the file /usr/doc/mkinitrd-1.4.6/README.initrd. It explains how build an initrd, but it assumes that the user is running a slackware system, which is not the case because I'm not able to boot Slackware/salix, as said.

Any advice will be very appreciated. Regards.

Van_Vinkle
Last edited by Van_Vinkle on 29. Mar 2013, 19:42, edited 1 time in total.
User avatar
aurlaent
Donor
Posts: 106
Joined: 1. Feb 2012, 19:46
Location: Sydney, Australia

Re: Lost initrd

Post by aurlaent »

Salix uses the huge kernel by default and so does not require an initrd.
If you want to run the generic kernel, you can build an initrd, but you'll have to solve your booting problem first.
If you can boot aptosid but can't boot Salix you should check your grub2 config. Perhaps the update has changed something there.
(Sorry, I have no experience with grub)
Any error messages that you get would be helpful for tracking down the problem.
User avatar
Van_Vinkle
Donor
Posts: 157
Joined: 25. Oct 2012, 17:39

Re: Lost initrd

Post by Van_Vinkle »

Thanks, aurlaent, I was very surprised that a dist-upgrade could erase a file in a /media/sdx (the salix root adress in aptosid's system) directory. Now it is clear that initdr.gz never has existed.

The error message when trying to boot in salix is:

Code: Select all

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block (8,3)
I must fight a little more against grub2. When I find the solution, I'll explain it here for the sake of general knowledge.

Thanks again.

Van_Vinkle
User avatar
hakerdefo
Posts: 91
Joined: 9. Dec 2012, 08:12
Contact:

Re: Lost initrd

Post by hakerdefo »

Hello Van_Vinkle. The problem is with the os-prober script of grub2. It is not yet smart enough to be 100% accurate all the time ;) The best thing for you to do is make a custom entry in the grub2 menu for Salix.
Okay here's how to do it,
1) boot aptosid
2) open terminal
3) run the following command in the terminal. Replace 'leafpad' in the command with the text editor you have in aptosid

Code: Select all

sudo leafpad /etc/grub.d/40_custom
4) this will open the file '40_custom'. You need to add the Salix menuentry here. Use the following menuentry as example and just replace the 'sda1' & 'msdos1' in the example with the partition you have Salix installed on.

Code: Select all

menuentry "Salix 14.0 (on /dev/sda1)" --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	linux /boot/vmlinuz-huge-smp-3.2.29-smp root=/dev/sda1
}
5) save the file and close the text editor
6) In your terminal

Code: Select all

sudo update-grub
7) reboot.
I hope with this custom entry you'll be able to boot Salix. And the best part is the future update-upgrade in aptosid grub won't affect this custom entry.
Cheers!!!
User avatar
Van_Vinkle
Donor
Posts: 157
Joined: 25. Oct 2012, 17:39

Re: Lost initrd

Post by Van_Vinkle »

Thanks a lot, hakerdefo. I've followed your advice, but there is yet a problem.

This is now (in aptosid) my /etc/grub.d/40_custom file:

Code: Select all

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "Salix" --class gnu-linux --class gnu --class os {
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos3)'
   linux /boot/vmlinuz-huge-2.6.37.6 root=/dev/sda3
}
More info: I use salix 2.6.37, and (in the aptosid system) the salix root is in /dev/sda3.

After update-grub and reboot, trying to launch salix an error message appears:

Code: Select all

 error: unknown filesystem
I don't know where is the error, because, as said, /dev/sda3 is the partition in which salix' root resides.

Thanks for your support.

Van_Vinkle

Edit: Changed the content of /etc/grub.d/40_custom
Last edited by Van_Vinkle on 25. Mar 2013, 13:07, edited 1 time in total.
User avatar
knome
Donor
Posts: 163
Joined: 20. Dec 2012, 19:36
Location: UK

Re: Lost initrd

Post by knome »

Check the filesystem Salix is using... in aptosid run (as su or sudo root) fdisk -l and post results.
Image
User avatar
Van_Vinkle
Donor
Posts: 157
Joined: 25. Oct 2012, 17:39

Re: Lost initrd

Post by Van_Vinkle »

knome wrote:Check the filesystem Salix is using... in aptosid run (as su or sudo root) fdisk -l and post results.

Code: Select all

root@aptosidbox1:/etc/grub.d# fdisk -l

Disk /dev/sda: 82.0 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders, total 160086528 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7b83f016

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1         6205440    98643967    46219264   83  Linux
/dev/sda2            2048     6205439     3101696   83  Linux
/dev/sda3        98643968   160086015    30721024   83  Linux

Partition table entries are not in disk order

Disk /dev/sdb: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a9eb6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63    37110149    18555043+  83  Linux
/dev/sdb2        37110150   317988863   140439357   83  Linux
/dev/sdb3       483877800   488392064     2257132+  82  Linux swap / Solaris
/dev/sdb4       317988864   483876863    82944000   83  Linux

Partition table entries are not in disk order
root@aptosidbox1:/etc/grub.d# 
and

Code: Select all

root@aptosidbox1:/etc/grub.d# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=255412,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=205664k,mode=755)
/dev/disk/by-uuid/d1e46756-9e15-48e1-964e-3cd1b8263f71 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=862740k)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sdb2 on /home type ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda3 on /media/17405d87-e0a8-4b36-94cd-27682c750d50 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks)
/dev/sdb4 on /media/a29f44f5-75aa-48f8-90ad-2dc8ee1c4fb7 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks)
root@aptosidbox1:/etc/grub.d# 

Code: Select all

ls -l /dev/disk/by-path
total 0
lrwxrwxrwx 1 root root  9 mar 25 14:02 pci-0000:00:02.1-usb-0:5:1.0-scsi-0:0:0:0 -> ../../sdc
lrwxrwxrwx 1 root root  9 mar 25 14:02 pci-0000:00:02.1-usb-0:5:1.0-scsi-0:0:0:1 -> ../../sdd
lrwxrwxrwx 1 root root  9 mar 25 14:02 pci-0000:00:02.1-usb-0:5:1.0-scsi-0:0:0:2 -> ../../sde
lrwxrwxrwx 1 root root  9 mar 25 14:02 pci-0000:00:02.1-usb-0:5:1.0-scsi-0:0:0:3 -> ../../sdf
lrwxrwxrwx 1 root root  9 mar 25 14:02 pci-0000:00:06.0-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 mar 25 14:02 pci-0000:00:06.0-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 mar 25 14:02 pci-0000:00:06.0-scsi-0:0:0:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 mar 25 14:02 pci-0000:00:06.0-scsi-0:0:0:0-part3 -> ../../sda3
lrwxrwxrwx 1 root root  9 mar 25 14:02 pci-0000:00:06.0-scsi-0:0:1:0 -> ../../sr0
lrwxrwxrwx 1 root root  9 mar 25 14:02 pci-0000:00:09.0-scsi-0:0:0:0 -> ../../sdb
lrwxrwxrwx 1 root root 10 mar 25 14:02 pci-0000:00:09.0-scsi-0:0:0:0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 mar 25 14:02 pci-0000:00:09.0-scsi-0:0:0:0-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 mar 25 14:02 pci-0000:00:09.0-scsi-0:0:0:0-part3 -> ../../sdb3
lrwxrwxrwx 1 root root 10 mar 25 14:02 pci-0000:00:09.0-scsi-0:0:0:0-part4 -> ../../sdb4
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Lost initrd

Post by mimosa »

Try changing the 'insmod ext2' line inthe grub stanza to 'instmod ext4'
User avatar
Van_Vinkle
Donor
Posts: 157
Joined: 25. Oct 2012, 17:39

Re: Lost initrd

Post by Van_Vinkle »

mimosa wrote:Try changing the 'insmod ext2' line inthe grub stanza to 'instmod ext4'
Done. And no luck :(
User avatar
mimosa
Salix Warrior
Posts: 3311
Joined: 25. May 2010, 17:02
Contact:

Re: Lost initrd

Post by mimosa »

That was just a guess (though yours seems to be ext4 not ext2, it may not even matter). I know virtually nothing about grub. I don't suppose you fancy lilo ...
Post Reply