You are not logged in.

#1 2026-08-31 11:48

essao
Member
Registered: 2026-06-10
Posts: 18

Help!Grub 'eaten' by windows installation

Hi support
I needed to use windows for a certain task.So i installed it to a partition on my disk.I intended to use dualboot but now grub is not working so i can't boot to q4os.After a lot of research and using a live cd i can chroot but when i do grub-install it returns with 'command not found'.I have tried out many tutorials but nothing works since am unable to install grub via live cd and chroot method.

Last edited by essao (2026-08-31 11:52)

Offline

#2 2026-08-31 11:52

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 6,378
Website

Re: Help!Grub 'eaten' by windows installation

If you can chroot into your Q4OS installation, first check whether grub-install is actually installed:
$ which grub-install
$ dpkg -l | grep grub

If it is missing, install the appropriate GRUB package from inside the chroot, then run grub-install and update-grub.

Also make sure the live USB was booted in the same mode (UEFI or Legacy BIOS) as the installed Q4OS system. For UEFI, the EFI System Partition must be mounted at /boot/efi.

Post the output of:
$ lsblk -f
$ dpkg -l | grep grub

and tell us whether the live USB was booted in UEFI or Legacy mode.

Offline

#3 2026-08-31 13:09

essao
Member
Registered: 2026-06-10
Posts: 18

Re: Help!Grub 'eaten' by windows installation

q4osteam wrote:

If you can chroot into your Q4OS installation, first check whether grub-install is actually installed:
$ which grub-install
$ dpkg -l | grep grub

this is what i get:
root@debian:/# which grub-install
root@debian:/# dpkg -l | grep grub
root@debian:/# grub-install
bash: grub-install: command not found

doesnt  seem like it is installed.Which specific commands do i use  to install?

Added later 03 min 11 s:

q4osteam wrote:

Also make sure the live USB was booted in the same mode (UEFI or Legacy BIOS) as the installed Q4OS system. For UEFI, the EFI System Partition must be mounted at /boot/efi.

I use legacy on myHp  Atom 110

Added later 07 min 13 s:
I  have mainly followed this page:


https://www.bigiron.cc/guides/rescue-fr … ot-pattern

Added later 14 min 01 s:

q4osteam wrote:

Post the output of:
$ lsblk -f

adminq@debian:~/Desktop$ lsblk -f
NAME FSTYPE FSVER LABEL           UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0
     squash 4.0                                                              0   100% /run/live/rootfs/filesystem.squashfs
sda                                                                             
├─sda1
│    ext4   1.0                   e647b7e6-903a-4b4b-8b14-21ee74fad1f2   31.1G    49% /mnt/target/boot
│                                                                                     /mnt/target
├─sda2
│    ntfs         System Reserved 0650BC9550BC8D45                             
├─sda3
│    ntfs                         5A5274E65274C7F1                             
├─sda4
│                                                                               
└─sda5
     swap   1                     15130d60-bdf7-4259-9c82-6ca50bff088e         
sdb                                                                             
├─sdb1
│    vfat   FAT32 Q4OS 6 ANDR     19EA-3F3B                              34.9G     5% /run/live/medium
└─sdb2
     ext3   1.0   persistence     643b53e0-53b9-1649-8e12-599adf45683f   19.9G     4% /run/live/persistence/sdb2
zram0
     swap   1                     a35f50b2-2e8b-4cc6-bad6-35e8fa84200e                [SWAP]

Last edited by essao (2026-08-31 13:11)

Offline

#4 2026-08-31 13:26

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 6,378
Website

Re: Help!Grub 'eaten' by windows installation

Since you are using Legacy BIOS, grub-pc is the correct package. While still inside the chroot, run:
$ apt update
$ apt install grub-pc
$ grub-install /dev/sda
$ update-grub
Replace /dev/sda with the actual disk containing Q4OS if it is different.
During installation of grub-pc, it may ask where to install GRUB. Select the whole disk, for example /dev/sda, not a partition such as /dev/sda1.
If apt update or apt install fails, post the complete error message. Since this is Legacy BIOS, there is no need for an EFI partition or /boot/efi.

Offline

#5 2026-08-31 13:27

essao
Member
Registered: 2026-06-10
Posts: 18

Re: Help!Grub 'eaten' by windows installation

q4osteam wrote:

Post the output of:
$ lsblk -f
$ dpkg -l | grep grub

adminq@debian:~/Desktop$ dpkg -l | grep grub
ii  grub-common                                              2.12-9+deb13u2                       amd64        GRand Unified Bootloader (common files)
ii  grub-pc                                                  2.12-9+deb13u2                       amd64        GRand Unified Bootloader, version 2 (PC/BIOS version)
ii  grub-pc-bin                                              2.12-9+deb13u2                       amd64        GRand Unified Bootloader, version 2 (PC/BIOS modules)
ii  grub2-common                                             2.12-9+deb13u2                       amd64        GRand Unified Bootloader (common files for version 2)
adminq@debian:~/Desktop$

Added later 09 min 24 s:

q4osteam wrote:

Since you are using Legacy BIOS, grub-pc is the correct package. While still inside the chroot, run:
$ apt update
$ apt install grub-pc

here is what i get:

adminq@debian:~/Desktop$ sudo chroot /mnt/target /bin/bash
root@debian:/#  apt update
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
root@debian:/# apt install grub-pc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package grub-pc
root@debian:/#

Offline

#6 2026-08-31 14:01

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 6,378
Website

Re: Help!Grub 'eaten' by windows installation

This indicates that the chroot environment is not seeing the same Debian/Q4OS repositories as the installed system. Do not install anything yet. Inside the chroot, please post the output of:
$ cat /etc/os-release
$ cat /etc/apt/sources.list
$ ls /etc/apt/sources.list.d/
$ dpkg -l | grep grub

Also, outside the chroot, please post:
$ lsblk -f

The fact that grub-pc is installed on the live system doesn't mean it is installed in the Q4OS installation mounted at /mnt/target. We need to make sure /mnt/target is actually the Q4OS root partition and that its APT sources are correct.

Offline

#7 2026-08-31 14:12

essao
Member
Registered: 2026-06-10
Posts: 18

Re: Help!Grub 'eaten' by windows installation

q4osteam wrote:

cat /etc/os-release

root@debian:/# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root@debian:/#

Added later 01 min 58 s:

q4osteam wrote:

cat /etc/apt/sources.list

root@debian:/# cat /etc/apt/sources.list
root@debian:/#

Added later 03 min 22 s:

q4osteam wrote:

ls /etc/apt/sources.list.d/

root@debian:/#  ls /etc/apt/sources.list.d/
root@debian:/#

Added later 05 min 09 s:

q4osteam wrote:

dpkg -l | grep grub


root@debian:/# dpkg -l | grep grub
root@debian:/#

Added later 16 min 38 s:

q4osteam wrote:

Also, outside the chroot, please post:
$ lsblk -f


adminq@debian:~/Desktop$ lsblk -f
NAME FSTYPE FSVER LABEL           UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0
     squash 4.0                                                              0   100% /run/live/rootfs/filesystem.squashfs
sda
├─sda1
│    ext4   1.0                   e647b7e6-903a-4b4b-8b14-21ee74fad1f2   31.1G    49% /mnt/target
│                                                                                     /mnt/target/boot
│                                                                                     /mnt/target
│                                                                                     /mnt/target/boot
│                                                                                     /mnt/target
│                                                                                     /mnt/target/boot
│                                                                                     /mnt/target
├─sda2
│    ntfs         System Reserved 0650BC9550BC8D45
├─sda3
│    ntfs                         5A5274E65274C7F1
├─sda4

└─sda5
     swap   1                     15130d60-bdf7-4259-9c82-6ca50bff088e
sdb
├─sdb1
│    vfat   FAT32 Q4OS 6 ANDR     19EA-3F3B                              34.9G     5% /run/live/medium
└─sdb2
     ext3   1.0   persistence     643b53e0-53b9-1649-8e12-599adf45683f   19.9G     4% /run/live/persistence/sdb2
zram0
     swap   1                     a35f50b2-2e8b-4cc6-bad6-35e8fa84200e                [SWAP]
adminq@debian:~/Desktop$

Offline

#8 2026-09-01 15:00

essao
Member
Registered: 2026-06-10
Posts: 18

Re: Help!Grub 'eaten' by windows installation

If there is no way forward I suppose i could just format the windows partition and see what happens.In any case i finished the task that required windows.

Offline

#9 2026-09-01 19:49

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 6,378
Website

Re: Help!Grub 'eaten' by windows installation

From the outputs you sent, it seems your Linux installation is crippled somewhat. It has empty sources.list. We would recommend you to keep Windows installation and make new Q4OS setup. It should install Grub with Windows boot option.

Offline

#10 2026-09-01 19:59

essao
Member
Registered: 2026-06-10
Posts: 18

Re: Help!Grub 'eaten' by windows installation

q4osteam wrote:

From the outputs you sent, it seems your Linux installation is crippled somewhat. It has empty sources.list. We would recommend you to keep Windows installation and make new Q4OS setup. It should install Grub with Windows boot option.

Ok.i will just have to reinstall q4os using the live usb disk.There is a document in the old installation that i will miss though.windows used to put old files on windows.old folder.Linux doesnt seem to have such a feature.

Added later 08 min 13 s:
I was  puzzled though that the output showed i was using debian bookworm yet i was on trixie.i am starting to think i had two partitions,and trixie was overwritten.but am not sure so i'll just install the live usb q4os.

Added later 13 min 34 s:

q4osteam wrote:

From the outputs you sent, it seems your Linux installation is crippled somewhat. It has empty sources.list. We would recommend you to keep Windows installation and make new Q4OS setup. It should install Grub with Windows boot option.

The live usb was andromeda trixie and the harddisk showed bookworm.could this be the reason?

Last edited by essao (2026-09-01 20:14)

Offline

#11 2026-09-01 20:16

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 6,378
Website

Re: Help!Grub 'eaten' by windows installation

essao wrote:

The live usb was andromeda trixie and the disk showed bookworm.could this be the reason?

That shouldn't be a problem. The fact that sources.list.d/ is empty in the chroot is a general indication that your system is severely crippled. We don't know what else might be broken.

Offline

Registered users online in this topic: 0, guests: 1

Board footer

Powered by FluxBB
Modified by Visman