You are not logged in.
Hi,
Bunsenlabs and Windows 10 run on my laptop. I am going to install Windows 11 on the same partition in which the 10 runs now. It is going to be a clean install, so I guess that GRUB will be probably deleted by Windows or messed up. How can I recover it?
Thanks
Offline
M$ will of course take over the boot process. After the install, boot with a Linux USB drive, chroot into the Linux partition and reinstall grub.
Easier is to DL MX Linux, write it to a thumb drive and boot with it. It has a GUI boot recovery utility and a boot option utility to set time out, priority boot, etc.
MX on a thumb drive is a good utility disro to keep for emergency use.
Last option is to wipe everything, install Win and then reinstall BL.
Post any question you may have. No dumb questions, only dumb mistakes.
8bit
M$ will of course take over the boot process. After the install, boot with a Linux USB drive, chroot into the Linux partition and reinstall grub.
Easier is to DL MX Linux, write it to a thumb drive and boot with it. It has a GUI boot recovery utility and a boot option utility to set time out, priority boot, etc.
MX on a thumb drive is a good utility disro to keep for emergency use.
Last option is to wipe everything, install Win and then reinstall BL.
Post any question you may have. No dumb questions, only dumb mistakes.
8bit
Ok, I'll try with MX linux first, after I have installed win 11 and let you know.
I may come up with questions that can sound dumb to you though :-)
Thanks
Offline
Chroot and reinstall grub from the command line - Post #5, below.
Chroot and reinstall grub from the command line on an encrypted filesystem - Post #6, below.
---
Chroot and reinstall grub with MX Linux Boot Repair:
Before starting make notes of partition numbers, name, etc.
Gparted can show them. At the terminal:
sudo fdisk -l
or
lsblk -f
---
There are two parts;
the grub config file which contains info about booting each OS,
and the boot loader which points to the partition
containing grub and it's config file.
---
MX Linux - MX Tools - MX Boot Repair.
Rebuild the grub config file. It needs to be updated about
the new W$ partition and the existing Linux partition.
Write it to the Linux Partition. Double check before applying.
Your example is not complicated, so most likely the defaults
will work.
Remember, all responsibility is with you; I believe
this guide to be accurate.
Reinstall the bootloader with the new config:
This is my best guess will fit your setup.
You can always bail out and ask here.
Boot loader in the EFI partition and root location is
the partition containing your Linux spin. (BL in this case)
Someone please speak up if they spot an error.
Mod may want to rename/move this to the tutorial
section with a sticky or whatever.
https://imgur.com/a/e6Jqzx3
https://imgur.com/a/MAL12Vp
https://imgur.com/a/IcYKCkN
https://imgur.com/a/XO5l7H1
8bit
Last edited by deleted0 (2023-05-20 23:22:33)
Chroot and reinstall grub from the command line.
Find your drive with linux on it.
lsblk -f
or
sudo fdisk -l -l
In my case:
al@p3630:~$ lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
├─sda1 swap 1 swap bc9787f9-a773-4b89-b8d4-061009223a98 [SWAP]
├─sda2 ext4 1.0 Stuff ed643301-3fa5-4ebf-849a-1fe990b3bca5 123.4G 25% /media/al/Stuff
└─sda3 ext4 1.0 Temp 9d5a239d-bfa2-4038-87e8-fc239eefb048
nvme0n1
├─nvme0n1p1 vfat FAT32 NO_LABEL E8F4-402E 288.6M 4% /boot/efi
└─nvme0n1p2 ext4 1.0 813f9b49-88ad-4877-bcc0-89346f01bdfd 174.5G 18% /
al@p3630:~$
nvme0n1 is the device.
nvme0n1p1 is the EFI Partition.
nvme0n1p2 ext4 is the root partition.
sda is the first device on SATA.
nvme0n1 is the first device on PCIe.
Boot from a Linux thumb drive.
sudo mount /dev/nvme0n1p2 /mnt
sudo mount /dev/nvme0n1p2 /mnt/boot/efi
Bind mount various virtual filesystems:
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
The foreach loop above is basically saying "Hey, if you find /dev, /dev/pts, /proc, /sys, and /run, mount them (as the superuser)".
The mount executable supplied with busybox does not support the -B option, use "mount -o bind" in this case.
Chroot into the broken system and reinstall grub.
Reinstall GRUB to the appropriate disk
(without partition number, nvme0n1 not nvme0n1p2 ):
sudo chroot /mnt
grub-install /dev/nvme0n1
Update grub-config
update-grub
exit the chroot - <Ctrl>D
reboot.
8bit
Last edited by deleted0 (2023-05-20 23:26:26)
Chroot and reinstall grub from the command line on an encrypted filesystem.
(coming soon - place holder)
8bit
Last edited by deleted0 (2023-05-20 21:51:20)
M$ will of course take over the boot process.
Everything follows from this. What a shitty company.
Offline
What do you mean with "chroot" and "chroot into" exactly? Thanks
Offline
^
Are you trolling me or is your google broken?
Okay, I'll byte. (pun intended)
A chroot on Unix and Unix-like operating systems is an operation that changes the apparent root directory for the current running process and its children.
https://en.wikipedia.org/wiki/Chroot
Thumb drive booted
current process filesystem we need
running on it's to fix.
filesystem.
bin bin
boot boot
dev chroot into dev
etc etc
home home
... ...
The file system we need to fix becomes the active filesystem.
---
All seriousness aside, I didn't mind answering your question; a good way to strengthen one's knowledge is to teach it to someone else.
8bit
Last edited by deleted0 (2023-05-21 14:40:35)
^
Are you trolling me or is your google broken?![]()
![]()
Yes, I'd already looked it up of course, but if just reading a few articles on a new subject you know nothing about is all you need to make sense of it, I'd already be a Linux user badass.
Of course, I also lack some basic understanding about how linux works.
it is a bit clearer now, although I haven't yet understood how such a chroot exactly works.
I'm going to dive deeper into it
All seriousness aside, I don't mind answering your question; a good way to strengthen one's knowledge is to teach it to someone else.
8bit
yes, you're right. I experimented it myself too
Thanks
Offline
Yes, I'd already looked it up of course, but if just reading a few articles on a new subject you know nothing about is all you need to make sense of it, I'd already be a Linux user badass.
Yes, some of us need to pound away at it 'till we get it. Welcome to the club, you're in good company.
8bit
In Unix, everything is a file. If the filesystem is broken and can't be booted, we boot with a working filesystem, then swap the working filesystem with the broken one. Now we have a working kernel et al, (current process)(It's alive!!) "linked" to the broken filesystem and we can work on it.
It seemed kinda magical to me when I first heard of it.
8bit
Last edited by deleted0 (2023-05-21 15:01:58)
In Unix, everything is a file. If the filesystem is broken and can't be booted, we boot with a working filesystem, then swap the working filesystem with the broken one.
yes, what you say makes sense, but it is about how exactly all this happens that I still can't grasp. Even the "chroot" term barely makes sense to me, even though I know that it is part of the namespace- cgroups subject (and all that jazz) also related to docker and LXC containers which massevely run on my home environment. Yes, I deployed softwares in my pc which I know little about :-)
Thanks for the explanation
Luke
Offline