LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   slackware 15 unbootable after slackpkg upgrade (https://www.linuxquestions.org/questions/slackware-14/slackware-15-unbootable-after-slackpkg-upgrade-4175736451/)

zinge 04-26-2024 10:30 AM

slackware 15 unbootable after slackpkg upgrade
 
I did a full upgrade after booting the new kernel, startx didn't work. The log showed no display device so I reinstalled the Nvidia drivers and it still didn't work. I made sure that nouveau was blacklisted and I recreated the grub.cfg. It is worth pointing out that I didn't update some config files when slackpkg asked me to but no files that have anything to do with x11 I think. xorg.conf is empty though so I tried the Nvidia xconfig utility and I got an exe error. The binaries literally wont run. I then tried reinstalling the Nvidia driver yet again and I recreated the grub.cfg. I now have an unbootable system which instantly throws me into the grub emergency shell without even letting me select the kernel or anything. Could the issue be that I did not make an initramfs (I forgot)? but wouldn't the system have been unbootable since the kernel upgrade and not after I installed the driver the 2nd time? I have no clue what the issue could be and no clue how to solve it. I would appreciate some help.

business_kid 04-26-2024 11:49 AM

Hello zinge & welcome to LQ.

I gather you have enough experience to get yourself into trouble, but not enough to get out. You haven't followed a basic commonsense principle
Quote:

When you're in a hole, the first thing to do is to stop digging!
If you want help, post some basic information How_To_Ask_a_Question

Next, answer some questions:
  • You had Slackware-15.0 which is a stable release. What did you update to?
  • What pc did you use to post this question?
  • What stops you simply reinstalling slackware-15.0?
  • What kernel(s) have you got now in /boot?
  • Have you manually installed them in your EFI setup?

Petri Kaukasoina 04-26-2024 02:11 PM

Boot from the install USB stick (slackware64-15.0-install-dvd.iso). Press enter, select keyboard, and press enter to get a shell prompt. Give command 'lsblk' and try to recognize the root partition. Say it's /dev/nvme0n1p3:
Code:

mount /dev/nvme0n1p3 /mnt
mkbindmounts
chroot /mnt

Now you are in your system and can build the initrd and configure the boot loader. After that:
Code:

exit
umount -R /mnt
poweroff

You are a grub user. If you had used elilo instead, it would have also been necessary to mount the EFI partition, for example 'mount /dev/nvme0n1p1 /mnt/boot/efi' just before chroot. Maybe also 'mount -t efivarfs none /mnt/sys/firmware/efi/efivars'

titopoquito 04-26-2024 03:55 PM

Quote:

Originally Posted by Petri Kaukasoina (Post 6498426)
mkbindmounts

I didn't know about that mkbindmounts command, thanks for that info. I'm sure this will come in handy some time.

0XBF 04-26-2024 05:34 PM

Quote:

Originally Posted by zinge (Post 6498403)
I did a full upgrade after booting the new kernel, startx didn't work. The log showed no display device so I reinstalled the Nvidia drivers and it still didn't work. I made sure that nouveau was blacklisted and I recreated the grub.cfg. It is worth pointing out that I didn't update some config files when slackpkg asked me to but no files that have anything to do with x11 I think. xorg.conf is empty though so I tried the Nvidia xconfig utility and I got an exe error. The binaries literally wont run. I then tried reinstalling the Nvidia driver yet again and I recreated the grub.cfg. I now have an unbootable system which instantly throws me into the grub emergency shell without even letting me select the kernel or anything. Could the issue be that I did not make an initramfs (I forgot)? but wouldn't the system have been unbootable since the kernel upgrade and not after I installed the driver the 2nd time? I have no clue what the issue could be and no clue how to solve it. I would appreciate some help.

It sounds like you:

1. Did an upgrade, but forgot to rebuild nvidia kernel modules, which gave you a booting OS, but no working X environment.
2. Broke your grub.cfg in attempt to repair the nvidia problem, giving you a non-booting OS.

That sound about right?

You will have to boot a rescue environment and chroot into the broken installation, the slackware installer usb that Petri mentioned is a good choice.

Find the kernel version you are planning on booting, and make sure you have the matching kernel-source package installed. You need the source to build the nvidia kernel modules. Once thats confirmed, build the nvidia kernel drivers and whatnot from your nvidia build method. There's a few methods out there so I dont know what you are doing. Personally I use the .run script that nvidia provides put it into a slackware package format, but you can also just run the script directly on the root filesystem.

I also dont bother putting nvidia kernel modules in my initrd. As long as the root disk is found and mounted properly, they'll be usable by the time I'm starting X, and I get a working text console at early boot still so I never saw the need for it in the initrd.

In any case, once you have the drivers properly installed, and you've sorted out your initrd (if you need it), then you'll have to generate the grub.cfg again, e.g:
Code:

grub-mkconfig -o /boot/grub/grub.cfg
The output of that command should mention the kernel and initrd are detected and used.

Please note that you don't really have to fix the nvidia problem to get grub booting into slackware again, so your first goal should just be to chroot into the broken OS, fix grub, and get Slackware booting to a command line at least. From there you can fix the nvidia problem like I mentioned. Unless there's a need to get nvidia kernel modules into the initrd then you might as well not overcomplicate it by doing it all via the chroot.

Good luck!

Quote:

Originally Posted by titopoquito (Post 6498439)
I didn't know about that mkbindmounts command, thanks for that info. I'm sure this will come in handy some time.

The 'mkbindmounts' command only comes in the slackware installer's initrd afaik, hence needing to use the 'slackware64-15.0-install-dvd.iso' usb stick for the rescue. It was added in 2019, so its in slackware versions 15.0 or later. Just thought that info might be useful to people looking for this command.


All times are GMT -5. The time now is 03:33 PM.