How to repair system without DVD

My system got stuffed after a trivial online update, it downloaded a new kernel update, I rebooted and now it won’t boot at all saying “FATAL: Could not load /lib/modules/2.6.31.8-0.1-desktop/modules.dep: No such file or directory”, then some stuff, then “mount: unknown filesystem type ‘ext4’”, “could not mount root filesystem”…

It’s on my laptop without a DVD drive and I’ve only got a LiveCD USB stick which doesn’t have a YAST system repair tool.

Is there any way to repair a system without a DVD drive?

Thank you.

just a guess here, but couldn’t you boot from the live USB, mount your openSUSE partition and install the old kernel. I don’t know if it is possible, but just a thought.

Yes, I can boot into LiveCD (USB) but then how do I install an old kernel from the USB onto the hard drive?

I’ve copied the whole /boot folder from USB to my HDD /boot - no difference. Looks like something else may be broken.

Now, after I did this in Grub

grub> find (hd0,0)/boot/grub/menu.lst
(hd0,0) <- this is my /boot partition
(hd0,2) <- / partition
(hd0,4) <- /home
grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> kernel /boot/vmlinuz
[Linux-bzImage, setup=0x3c00, size=0x3e62e0]
grub> initrd /boot/initrd
Error 15: File not found

But I’ve checked the /boot folder, the initrd is there!

On 01/06/2010 08:16 AM, linuxoidoz wrote:
>
> Now, after I did this in Grub
>
> grub> find (hd0,0)/boot/grub/menu.lst
> (hd0,0) <- this is my /boot partition
> (hd0,2) <- / partition
> (hd0,4) <- /home
> grub> root (hd0,0)
> Filesystem type is ext2fs, partition type 0x83
> grub> kernel /boot/vmlinuz
> [Linux-bzImage, setup=0x3c00, size=0x3e62e0]
> grub> initrd /boot/initrd
> Error 15: File not found
>
> But I’ve checked the /boot folder, the initrd is there!

When you use a separate boot partition, then the paths must change. Remember
that GRUB has not mounted the entire disk, only the partition containing boot.
Thus your file paths should be /vmlinuz and /initrd, not /boot/xxxx.

If I do

find /boot/grub/menu.lst
or
kernel /vmlinuz
or
initrd /initrd

it can’t find anything. Only if I put either (hd0,0) or /boot in front it finds some, but still can’t find the initrd.

I also noticed the /vmlinuz is a simlink to /vmlinuz-2.6.31.5-0.1-desktop, as well as /initrd is a simlink to /initrd-2.6.31.5-0.1-desktop. But the actual kernel vmlinuz-2.6.31.5-0.1-desktop is in the folder /boot but there is NO initrd-2.6.31.5-0.1-desktop in the /boot folder, just the simlink. Could that be the problem? Where can I get the actual initrd-2.6.31.5-0.1-desktop file from? It’s not in the USB /boot folder either.

The other thing is, as I said it happened after the update and I had multiple kernels installed for some stupid reason (automatically by YAST, not by me), so I deleted everything to do with all kernels (*-desktop, *-debug, *-xen - what the hell was this one installed for?) except for *-default, then did the update and BOOM!

I’m sure the DVD can repair the system, but my first question was if there’s any way to do that without a DVD drive? My only options are:

  1. Try repair it from Grub
  2. I can boot into LiveCD USB and edit HDD files
  3. Reinstall

I’d hate to resort to reinstalling, I’ve spent so much time setting it up.

If you can’t find the real initrd file that the symlink is supposed to point to, then it could have been lost in the update. The installer is supposed to create an initrd customised for your setup. Obviously something seems to have gone pear-shaped in the kernel upgrade.

I forget if there is a repair or rescue subsystem on the LiveCD. You could try that if you can’t find the initrd.

you could try from live cd mount your boot partition
chroot /where mounted/boot
mkinitrd
then ls /*/boot
to see if initrd is there. It must be the same as vmlinuz if the trailing numbers don’t match then its a no go

If I log in livecd, open shell and:
>su
>cd /media/disk/boot <- my HDD /boot in mounted on /media/disk
>mkinitrd
Kernel image: /boot/vmlinuz-2.6.31.5-0.1-desktop
Initrd image: /boot/initrd-2.6.31.5-0.1-desktop
Root device: /dev/root (mounted on / as defaults)
Device root not found in sysfs
>chroot /media/disk/boot
chroot: cannot run command ‘bin/bash’: no such file or directory

If I do this:
>mkinitrd /boot/initrd-2.6.31.5-0.1-desktop initrd-2.6.31.5-0.1-desktop
Kernel image: /boot/vmlinuz-2.6.31.5-0.1-desktop
Initrd image: /boot/initrd-2.6.31.5-0.1-desktop
Kernel Modules: <not available>
Could not find map /boot/initrd-2.6.31.5-0.1-desktop/boot/System.map, Please specify a correct file with -M

Any other ideas?

I think the problem is a lost initrd as I tried the super_grub_disk and I the same error saying initrd file not found.

So I guess the question now is how can I get an initrd onto my laptop? Any experts? Thank you.

If I were you I’d reinstall, keeping partitions, leaving /home untouched.

linuxoidoz wrote:
> Is there any way to repair a system without a DVD drive?

sorry i missed this earlier (yesterday)…yes, it is possible to go
back a day and repair an after update messed up system…to do that
pull out your backup image, and run the restore backup routine…


palladium

I don’t have a back up image, this is the 1st time in 5 years the system got so badly stuffed and me having no DVD drive

What you have to do is seemingly do the impossible, run mkinitrd but with the target filesystem as /. This means you also have to use the mkinitrd in the target filesystem. You were on the right track though. Try this, assumes that your target / is mounted at /mnt and target /boot mounted at /mnt/boot.

mount --bind /dev /mnt/dev
chroot /mnt
mount /proc
mount /sys
mkinitrd

This is cribbed from the man page for mkinitrd.

Reinstall from the Live-USB stick. During install, do not accept the partitioning proposal, choose change. In the partitioner, choose Rescan drives, Import mount points. This allows you to only format partitions you don’t want to keep. So only your system will be reinstalled, nothing will be done to /home.

When you’re done, backup things you’re nervous about right now.

It still says “chroot: cannot run command ‘bin/bash’: no such file or directory” and then skipping chroot and doing mkinitrd “Device root not found in sysfs”.

I want to leave reinstalling as a last resort.

You’ve probably missed a step, you have to have the full target filesystem, including /boot and /dev, mounted under /mnt (or whereever on your in-memory rescue system). This assumes that you have a fully-functional target filesystem, but without a usable initrd in /boot.

I have first mounted my installed / partition in /mnt/hdd on the live system, then I’ve done

>mount --bind /dev /mnt/hdd/dev
>chroot /mnt
chroot: cannot run command ‘bin/bash’: no such file or directory
>mount /proc
mount: proc already mounted
>mount /sus
mount: sysfs already mounted or /sys busy
mount: according to mtab, sysfs is already mounted on /sys
>mkinitrd
Kernel image: /boot/vmlinuz-2.6.31.5-0.1-desktop
Initrd image: /boot/initrd-2.6.31.5-0.1-desktop
Root device: /dev/root (mounted on / as defaults)
Device root not found in sysfs

and my system /boot is on /dev/sda1 and / is on sda3

I really appreciate your help. Thank you.

mount /dev/sda3 /mnt
mount /dev/sda1 /mnt/boot
mount --bind /mnt/dev
chroot /mnt /sbin/mkinitrd