LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Windows 10 upgrade ruins dual boot (https://www.linuxquestions.org/questions/slackware-14/windows-10-upgrade-ruins-dual-boot-4175672165/)

deretsigernu 03-28-2020 11:17 PM

Windows 10 upgrade ruins dual boot
 
I have a laptop with Windows 10 and Slackware64-14.2-current. Windows recently upgraded to a newer build of 10. This did something to my GRUB menu. Now I can't boot Slackware. Where before when I started my computer and waited, I would get a GRUB menu with Slackware 14+ and Windows 10 options. Now, if I don't press F9 at start up, I get

Quote:

Welcome to GRUB!

error: unknown filesystem.
Entering rescue mode...
grub rescue>
I looked up how to respond to the grub rescue and found this. I used the following from the answer on that page:

Code:

grub rescue>set boot=(hd0,gpt6)
grub rescue>set prefix=(hd0,gpt6)/boot/grub
grub rescue>insmod normal
grub rescue>normal

And I get my old GRUB menu. I select Slackware and it starts to boot. But then I get the following:
Quote:


Checking root filesystem:
fsck from util-linux 2.35.1
/sbin/e2fsck: Bad magic number in super-block while trying to open /dev/sda5
/dev/sda5:
The superblock could be be read or does not describe a valid ext2/ext3/ext4 filesystem. If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or usf or something else), the the superblock is corrupt, and you migt try running e2fsck with an alternate suprblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>

/dev/sda5 contains a ntfs file system

***
* An error occurred during the root filesystem check.
* You will now be given a chance to log into the system in single-user mode to fix the problem.
*
* If you are using the ext2 filesystem, running 'ef2sck -v -y <partition>' might help.
***

Once you exit the single-user shell, the system will reboot.
I run:

Code:

root@darkstar:/# e2fsck -b 8193 /dev/sda5
Quote:

e2fsck 1.45.5 (07-Jan-2020)
e2fsck: Bad magic number in super-block while trying to open /dev/sda5

The superblock could be be read or does not describe a valid ext2/ext3/ext4 filesystem. If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or ufs or something else), the the superblock is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>

/dev/sda5 contains a ntfs file system
Code:

root@darkstar:/# e2fsck -b 32768 /dev/sda5
Quote:

e2fsck 1.45.5 (07-Jan-2020)
e2fsck: Invalid argument while trying to open /dev/sda5

The superblock could be be read or does not describe a valid ext2/ext3/ext4 filesystem. If the device is valid and it really contains an ext2/ext3/ext4 filesystem (and not swap or ufs or something else), the the superblock is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
So is my Slackware partition really destroyed? I can't fix GRUB2 and get back to it at this point?

ferrari 03-29-2020 12:44 AM

What a situation to have encountered! Are you sure about the block size though? I wonder if TestDisk might be worth a shot here.
https://www.cgsecurity.org/wiki/Adva...kup_SuperBlock

Good luck with this.

syg00 03-29-2020 01:04 AM

Strictly speaking, it doesn't look like grub has a problem.
Fire up your rescue system and have a look around.

pan64 03-29-2020 06:19 AM

I have made a win10 upgrade last week and it did not destroy anything (like grub or any other partition). So (I would say) this is not related to windows.
But anyway, you need to check the content of that partition as it was suggested.

WARNING! do NOT run e2fsck on an NTFS partition (/dev/sda5), you can only destroy it.

deretsigernu 03-29-2020 10:47 AM

@ferrari To answer your question, I am not sure what the block or super block size is. I barely enough know what it is. TestDisk sounds like it might be useful. Thank you for the suggestion.

@sig00 I will try GRUB Super Disk. I have a copy of Knoppix somewhere too. But there is something weird about my laptop that it doesn't like most linux boot options and I can never get past the starting screen. Someone suggested it's just a graphics issue. I have a basic Intel UHD Graphics 620 processor. Maybe that's it. I don't know. I will give those a try, but don't expect much. I installed -current because for some reason, it was the only version that got past the startup screen. I think because it used newer versions of isolinux or one of the other starting procedures. Most of what I just wrote is covered in the long thread at the previous link.

@pan64 Thanks for the reply. This problem started for me right after Windows 10 "upgraded" from build 1809 to build 1909. When I started Windows after that "upgraded", it acted like I had installed Windows anew. I searched web a bit and there was a reference or two in places that said other people had similar experiences. I think those were Ubuntu forums. Not sure. Thank you for the warning about not using e2fsck on ntfs, but I'm pretty sure that I won't hurt that partition. Windows did something to it. Here is my fstab prior to the "upgrade":

Quote:

/dev/sda7 swap swap defaults 0 0
/dev/sda5 / ext4 defaults 1 1
/dev/sda2 /boot/efi vfat defaults 1 0
/dev/sda4 /fat-c ntfs-3g fmask=133,dmask=022 1 0
/dev/sda6 /fat-d ntfs-3g fmask=111,dmask=000 1 0
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro,comment=x-gvfs-show 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs nosuid,nodev,noexec 0 0
/dev/sda5 is my old Slackware /
Or it was. If e2fsck says that partition is NTFS now, when it should have been ext4, it seems that Windows destroyed it first.

pan64 03-29-2020 10:55 AM

so probably you used that partition earlier for windows and was remembered... That would be anyway a surprise (I mean how can windows take /dev/sda5 and use... ?).
Now you can try to force to set it ext4 again, and try to recover - if you have enough space somewhere to use testdisk.

deretsigernu 03-29-2020 12:25 PM

Well, I started the Slackware install again. The first part of the process looks to establish partitions. There are _3_ “Windows recovery environment” partitions now. I don’t know why there are 3. I remember one when I set up dual boot. At least one of those is very recent, as in it was probably added with that upgrade. So it looks like Windows will run rampant over the entire hard disk, not just the local partition it is installed too.

ferrari 03-29-2020 02:26 PM

Quote:

@ferrari To answer your question, I am not sure what the block or super block size is. I barely enough know what it is. TestDisk sounds like it might be useful. Thank you for the suggestion.
The TestDisk page that I linked to explains the following regarding the superblock location and block size...
Quote:

The superblock contains all the information about the configuration of the filesystem. The primary copy of the superblock is stored at an offset of 1024 bytes from the start of the partition, and it is essential to mounting the filesystem. Since it is so important, backup copies of the superblock are stored in block groups throughout the filesystem. The first version of ext2 (revision 0) stores a copy at the start of every block group, along with backups of the group descriptor block(s). Because this can consume a considerable amount of space for large filesystems, later revisions can optionally reduce the number of backup copies by only putting backups in specific groups (this is the sparse superblock feature). The groups chosen are 0, 1 and powers of 3, 5 and 7.

Now using the value given by TestDisk, you can use fsck to repair your ext2/ext3 filesystem. I.E. if TestDisk has found a superblock at block number 24577 and a blocksize of 1024 bytes, run

/sbin/fsck.ext3 -b 24577 -B 1024 /dev/hda1
With the information that it provides it may have been possible to then use fsck more successfully (with TestDisk having found the required supverblock location and blocksize).

2damncommon 03-29-2020 05:21 PM

Everyone should keep a copy of Super Grub2 around.

ferrari 03-29-2020 05:39 PM

Yes, good advice.

colorpurple21859 03-29-2020 05:50 PM

Before the upgrade slackware was on sda5
Quote:

/dev/sda5 / ext4 defaults 1 1
after the upgrade slackware is on sda6
Quote:

set boot=(hd0,gpt6)
Quote:

And I get my old GRUB menu.
Either windows created another partition or re-ordered the partitions.
Edit your fstab for /dev/sda6 or use UUID, reinstall grub, rerun grub-mkconfig, and mkinitrd.

pan64 03-30-2020 01:05 AM

yest, that is possible, windows may create a small "hidden" partition for itself (that is more plausible). In that case better to use uuids to identify partitions.

deretsigernu 03-30-2020 10:04 PM

I logged in to Slackware using the “set ... “ and “insmod” commands. I changed to root via su. My fstab now looks like

Quote:

/dev/sda7 swap swap defaults
/dev/sda5 / ext4 defaults
/dec/sda2 /boot/efi vfat defaults
/dev/sda4 /fat-c ntfs-3g fmask=133,dmask=022
/dev/sda6 /fat-d ntfs-3g fmask=111,dmask=000
#/dev/cdrom /mnt/cdrom auto
...
I tried “vi /etc/fstab” and was told there were too many session files in /var/tmp. Went there to see about getting rid of files and I kept getting that the files I was trying to delete were read only.

I am using nano for /etc/fstab and there is a message in red at bottom of field that says “[ File ‘/etc/fstab’ is unwritable ]”

I took a pic of what cfdisk said the hard disk looked like when I was using it with the Slackware install a few minutes ago. That says the /dev/sda6 is now where / resides. /fat-d is on /dev/sda7 and /dev/sda8 holds the linux swap. /fat-d is a ntfs-3g partition that holds data I use on Slackware and Windows. So I was going to write new lines and edit existing lines in fstab to reflect what I saw in cfdisk. But if I can’t get it to save to /etc/fstab, what’s the point? Sorry for sounding sore. I’m open to suggestions, but I’m probably about to just reinstall Slackware. Everything important is backed up.

ferrari 03-30-2020 10:10 PM

Quote:

I tried “vi /etc/fstab” and was told there were too many session files in /var/tmp. Went there to see about getting rid of files and I kept getting that the files I was trying to delete were read only.

I am using nano for /etc/fstab and there is a message in red at bottom of field that says “[ File ‘/etc/fstab’ is unwritable ]”
You need root privileges to write to (and remove) system files. For example
Code:

su -c "nano /etc/fstab"
Take care when editing files or in general issuing commands as root.

This may be useful to you...
https://docs.slackware.com/slackware:beginners_guide

onebuck 03-31-2020 07:08 AM

Moderator Response
 
Moved: This thread is more suitable in <Slackware> and has been moved accordingly to help your thread/question get the exposure it deserves.


All times are GMT -5. The time now is 11:58 AM.