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 04-04-2020 12:16 AM

I used the LiveSlak usb edition. I edited /etc/fstab. Now

/dev/sda8 is swap
/dev/sda7 is ntfs-3g to share data between Win10 and -current
/dev/sda6 is /
/dev/sda5 is /winre ( / was here and displaced with a windows rescue partition)
/dev/sda4 is Windows 10
/dev/sda2 is /boot/efi, formatted as vfat

Next, I had to fix GRUB2. I looked at several different sources for help and tried a couple different commands, since nothing was working for me.



Quote:

mount /dev/sda6 /mnt

chroot /mnt

sudo grub-install --root-directory=/mnt /dev/sda6
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.

umount /mnt
I rebooted...

Quote:

mount /dev/sda6 /mnt

sudo grub-install --root-directory=/mnt /dev/sda
Installing for i386-pc platform.
/proc/devices: fopen failed: No such file or directory
device mode not found
[... repeats this line several times ...]
/proc/devices: fopen failed: No such file or directory
device mode not found
/proc/devices: fopen failed: No such file or directory
device mode not found
grub-install: warning: this GPT partition label contains no BIOS Boot Partition;
embedding won't be possible.
grub-install: warning: Enbedding is not possible. GRUB can only be installed in
this setup by using blocklists. However, blocklists are UNRELIABLE and their
usage is discouraged...
grub-install: error: will not proceed with blocklists.



I tried

Quote:

sudo grub-mkconfig -o /mnt/boot/grub/grub.cfg
Generating grub configuration file ...
/proc/devices: fopen failed: No such file or directory
device mode not found [repeats this line several times]
...
Found linux image: /boot/vmlinuz-huge
Found initrd image: /boot/initrd.gz
Found linux image: /boot/vmliuz-generic-4.19.75
[...finds a few more images...]
grep: /proc/mounts: No such file or directory
Cannot find list of partitions! (Try mounting /sys.)
done
I'm not sure what the right approach is for GRUB2. It seemed like the first try, with chroot, was close. I just don't know how to point to the /dev/sda2 for GRUB2.

bassmadrigal 04-04-2020 01:16 AM

Did you regenerate your initrd to have the correct root device? It might be easier to use UUID for that. You can run /usr/share/mkinitrd/mkinitrd_command_generator.sh to give you the output, then you'd change the -r /dev/sda6 to -r "UUID=your-uuid-for-/dev/sda6"

You can find your uuid using lsblk -o +uuid

colorpurple21859 04-04-2020 07:35 AM

This is all wrong
Quote:

mount /dev/sda6 /mnt

chroot /mnt

sudo grub-install --root-directory=/mnt /dev/sda6
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.

umount /mnt
should have been after booting in efi mode.
Code:

mount /dev/sda6 /mnt
mount /dev/sda2 /mnt/boot/efi
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /run /mnt/run


chroot /mnt

grub-install --target=x86_64-efi
grub-mkconfig -o /boot/grub/grub.cfg
exit

Then umount everything and reboot.

With slackware What I usually do is edit the /boot/grub/grub.cfg after running grub_mkconfig to use the vmlinuz-generic/initrd.gz as my first boot entry and add other boot options I deem necessary and don't never run it again.

yancek 04-04-2020 08:51 AM

Quote:

grub-install: warning: this GPT partition label contains no BIOS Boot Partition
grub-install: error: cannot find EFI directory
The output above is what you posted in post 31 and indicates you are trying to do a Legacy install of Grub on a GPT/EFI system. That won't work. You need to point to the correct EFI partition as suggested in post 32. I would expect that suggestion to work but if that still fails, you need to run blkid and compare the UUID for sda6 to what you have in the grub.cfg file.

deretsigernu 04-04-2020 04:48 PM

colorpurple21859, I thank you for showing me the correct commands for mounting everything inside of the LiveSlak environment. I was able to update GRUB2. Now it works and I can access the Slackware partition again from the normal GRUB2 boot menu. I used your post and RadicalDreamer's several suggestions to change fstab over to UUID.

I have to still update mkinitrd as suggested, but since I haven't changed my kernel, I guess it's not something that needs to be done right away. I did run the script and redirected output to a text file so I can look at it and see if I have questions.

I learned a lot from the help everyone provided in this thread. Thanks to everyone that participated.

colorpurple21859 04-04-2020 05:50 PM

Your welcome

pan64 04-05-2020 01:03 AM

Just one additional comment: Probably better to give the full disk to windows and put any other OS onto another one. In this case Windows will not harm anything but itself.

enorbet 04-05-2020 01:41 AM

Quote:

Originally Posted by pan64 (Post 6107932)
Just one additional comment: Probably better to give the full disk to windows and put any other OS onto another one. In this case Windows will not harm anything but itself.

Well... almost. The problem OP experienced couldn't occur again but it isn't completely true that Windows won't mess with another OpSys just because they are on a separate drive. Recently MS is a bit less aggressive about destroying the competition it discovers on one's drives. There are still a few minor gotchas these days but there is no guarantee they won't go back to old ways or even worse, now that they offer a sort of alternative to Linux within windows, actually step up the fight. Be wary.

2damncommon 04-13-2020 09:32 PM

1 Attachment(s)
Quote:

Originally Posted by Gordie (Post 6106298)
This is good advice if you use grub to boot your computer. For those of us that use lilo the Super Grub Disk will not work

Update grub shows this entry:
Found ELILO Boot Manager on /dev/sda2@/EFI/elilo.efi/elilo.efi

and using the "e" edit option with the SuperGrub disk I get this:

Attachment 32976

deretsigernu 04-15-2020 11:09 PM

@2damncommon that's interesting. I don't have ELILO. I would have thought GRUB2 and ELILO would be incompatible.


All times are GMT -5. The time now is 06:59 PM.