You are not logged in.

#1 2023-05-19 16:33:39

luketen
Member
Registered: 2023-03-25
Posts: 22

Bunsenlabs in dual boot with Windows

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

#2 2023-05-19 17:28:39

deleted0
Guest

Re: Bunsenlabs in dual boot with Windows

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

#3 2023-05-19 19:09:08

luketen
Member
Registered: 2023-03-25
Posts: 22

Re: Bunsenlabs in dual boot with Windows

eight.bit.al wrote:

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

#4 2023-05-19 22:42:42

deleted0
Guest

Re: Bunsenlabs in dual boot with Windows

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.

grub-repair1.png

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.

grub-repair2.png

Reinstall the bootloader with the new config:

grub-repair3.png

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)

grub-repair4.png

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)

#5 2023-05-20 21:39:52

deleted0
Guest

Re: Bunsenlabs in dual boot with Windows

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)

#6 2023-05-20 21:44:38

deleted0
Guest

Re: Bunsenlabs in dual boot with Windows

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)

#7 2023-05-20 22:24:48

el_koraco
Member
Registered: 2016-02-08
Posts: 307

Re: Bunsenlabs in dual boot with Windows

eight.bit.al wrote:

M$ will of course take over the boot process.

Everything follows from this. What a shitty company.

Offline

#8 2023-05-21 06:43:16

luketen
Member
Registered: 2023-03-25
Posts: 22

Re: Bunsenlabs in dual boot with Windows

What do you mean with "chroot" and "chroot into" exactly? Thanks

Offline

#9 2023-05-21 13:15:44

deleted0
Guest

Re: Bunsenlabs in dual boot with Windows

^
Are you trolling me or is your google broken? smile smile smile

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)

#10 2023-05-21 14:33:15

luketen
Member
Registered: 2023-03-25
Posts: 22

Re: Bunsenlabs in dual boot with Windows

eight.bit.al wrote:

^
Are you trolling me or is your google broken? smile smile smile

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

#11 2023-05-21 14:43:51

deleted0
Guest

Re: Bunsenlabs in dual boot with Windows

luketen wrote:

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. smile

8bit

#12 2023-05-21 14:55:57

deleted0
Guest

Re: Bunsenlabs in dual boot with Windows

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)

#13 2023-05-21 18:39:38

luketen
Member
Registered: 2023-03-25
Posts: 22

Re: Bunsenlabs in dual boot with Windows

eight.bit.al wrote:

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

Board footer

Powered by FluxBB