Article 54KC8 Windows 10 2004 hosed my Linux, but I was able to recover

Windows 10 2004 hosed my Linux, but I was able to recover

by
sombragris
from LinuxQuestions.org on (#54KC8)
While gaming on visiting my Windows partition, I checked Windows Update and I was given the possibility to update to the newest Windows 2004. Since this version offers a completely new WSL system, I was curious and decided to proceed.

This Windows is the original system from my laptop. I dual-boot it with Slackware-current using GRUB.

The download finished and then began a series of reboots; after the second download, grub failed to show the menu with an error message saying that it could not find any partition. This was serious. Thankfully a Dell boot menu from UEFI offered me the possibility of booting directly into Windows Boot Manager, so I did that. In this way, the windows upgrade was able to proceed.

After the upgrade finished, I was left with a broken GRUB and no way of accessing my Linux system. But I had a Slackware bootable USB around, so I plugged that, and selected from its GRUB menu "boot with any operating system". I then selected my installed kernel, which was dutifully detected, and chose the huge version just to be on the safe side.

The kernel booted alright, and init also booted, but shortly afterwards the process stopped with an alarming message from fsck: it could not find the root partition. This was serious. How could I recover?

I discovered what could be the cause. I checked with cgdisk the various partitions available and compared them with /etc/fstab. It turned out that the Windows upgrade, besides completely hosing my GRUB setup, somehow changed the partition numbering scheme (without destroying them). For example, what used to be /dev/sda8 now was /dev/sda5.

Then, I tried remounting the root partition with write permissions, and edited /etc/fstab to reflect the new partition numbers for root, swap, and so on. Rebooted (with the UEFI boot menu and the USB-assisted boot process) and success! I had an usable Linux system again!

The remaining tasks were to reinstall grub (using grub-install) and then, regenerate a working config by using grub-mkconfig. Good thing I had the latter already codified in a small administrative shell script I wrote to make kernel upgrades easier.

Rebooted, and everything is (fingers crossed) back to normal.

So, recovering a hosed system in Slackware was basically a matter of editing the right config file. This is the beauty of Slackware: I never lost anything and never had to reinstall anything, and Slackware encourages you to seek a fix instead of nuking everything and reinstalling from scratch. If I were an user of another distro, I would have reformatted and reinstalled everything.

So, folks, be careful if you happen to update your Windows partition to 2004...latest?d=yIl2AUoC8zA latest?i=vdagComDQ-g:mJINvGV3zgs:F7zBnMy latest?i=vdagComDQ-g:mJINvGV3zgs:V_sGLiP latest?d=qj6IDK7rITs latest?i=vdagComDQ-g:mJINvGV3zgs:gIN9vFwvdagComDQ-g
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments