Fixed it till it broke - GrubF*ckup?

Hi!
So,
I remembered that I had a dusty partition with Manjaro on it so I deleted the partition
Even managed to delete the right one LOL
Then I did grub-update

But, now my AL doesnt boot - I get a ‘Welcome to GRUB!’ flashing up then it goes into BIOS
If I then put Windows 10 at the top of boot sequence it works
None of my live Linux USB’s boot - AL one gets stuck at mirrors and stuff, my ArchBang one goes straight to BIOS. The MX tools one works but I havent found any respite in the grub rescue options

The thing is - I did some work arounds with my grub due to the Manjaro + AL (or anything else?) problems before:

NB I currently only have AL and Win 10 on the lappy

Can anyone offer the best way forward for me please?

Please! before I cry.

I’m thinking that I might have to undo my previous grub edits?

But I cant get any bloody linux usb’s to work

I am currently in Win 10

At least this didnt happen when I have loads of work to do, 3 cubic meters of earth being delivered that I have to wheelbarrow up the drive as the truck is too big to get in, its finally going to rain today after a long hot summer, and my parents are arriving to visit for a week or so and I have to go to the airport at lunchtime

LOL

I just remembered that in Win10 I installed DiskGenius and I can view my AL Ext4 linux files from there, but dont think I can edit them

There appears to be nothing at all in my AL /boot - at least from windows according to DiskGenius where I can see and view other files

I have got another lappy with AL on it that I can use to redo my USB live AL which is a bit old now


To make it easier - my post from other thread:

I have a workaround :

Make a custom grub entry in Archlabs’ grub to chainload the Manjaro grub
(Inspired by this post on the Mint forums)

1/ In Archlabs:

sudo nano /etc/grub.d/40_custom

insert the last two lines:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "Manjaro GRUB chainloader" {
 chainloader /efi/Manjaro/grubx64.efi
}

2/ update grub:

sudo grub-mkconfig -o /boot/grub/grub.cfg

(or install and simply use update-grub wrapper thingy)

3/ Set laptop to boot 1st to Archlabs via firmware UEFI settings

4/ Use the Archlabs GRUB menu for Archlabs, EOS and Windows
[EDIT: in fact to get EOS to boot from the Archlabs GRUB menu I had to edit /boot/grub/grub.cfg to add the missing /boot/initramfs-linux-lts.img to the initrd line under the EndeavourOS Linux menuentry - I have no idea why (I did try to update-grub in EOS and then in Archlabs, but it didnt add that bit) and this edit was undone on grub-update, so is a very flakey solution :slight_smile: )]

5/ Or use the ‘Mangaro GRUB chainloader’ entry to go to the Manjaro GRUB menu if I want to boot to Manjaro,

But, I dont think I will be doing 5/ very often as I MUCH prefer Archlabs [Openbox] & EOS [i3] :smile:
[EDIT #4: I edited the Manjaro GRUB to set Default to 0 (1st, entry, Manjaro) and set the delay to 0 sexonds so that I dont even see the Manjaro GRUB menu before it boots into Manjaro]

Now to find out how to remove grub menu entries that wont work to tidy up …
[EDIT#3: I just cut the relevant Manjaro menuentries out of /boot/grub/grub.cfg to carry on my flakey solution :)]

EDIT #2: NB I installed Archlabs and EOS on another laptop with no Manjaro and there were no such problems

Walk away from it. Go shovel dirt. Eat a meal with the parents. Have a good night sleep. Start fresh in the morning.

3 Likes

it is morning and I am fresh LOL
I went to start the garden, buy some seed and fertilizer
Garden Centre only opens on Tuesday.

So, I got my AL usb to work / reflashed new iso - had to be the LTS one and only worked in my USB 2 port for some reason. But then using that as a live iso needs doing all that Pacman and mirrors malarky so I downloaded and flashed to USB stick the Endeavour OS live iso on the other lappy and now am in linux on my main lappy

I started by deleting the following from /etc/grub.d/40_custom on my now unaccessible AL installation

menuentry "Manjaro GRUB chainloader" {
 chainloader /efi/Manjaro/grubx64.efi
}

Then I went to see if my modification to /boot/grub/grub.cfg was still there .

But there is indeed nothing at all in /boot on my main installation

I do not understand LOL

Next step
I installed another instance of Archlabs on a new partition where the Manjaro one was
That worked, and now I have a grub menu with the two Archlabs and the windows one

but the new Archlabs doesnt boot up
Failed to mount /boot

Then into emergency mode

If I try to boot into my old archlabs it says that
/boot/initramfs-linux-blah-blah not found

When I installed the new archlabs I chose to use grub (I thought it migh ‘sort it out’) and I didnt format the boot partition (sorry - I forget what that is called, the first partition on the disk)
Should I have formatted this?
Or would that mess up my Windows installation too?

Cheers

We need more info. Post lsblk. Describe each drive and partition.

2 Likes

Post output of:

sudo fdisk -l

as well.

You need to determine the partition layout and which are being used by Windows.

Are there two hard drives in the laptop?

Might be easier for you to boot Windows and get into the control panel and view the disk(s) partitions.

3 Likes

Thanks @eight_bit_al @PackRat

[liveuser@eos-2022.09.10 ~]$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0    7:0    0   1.6G  1 loop /run/archiso/airootfs
sda      8:0    0 931.5G  0 disk 
├─sda1   8:1    0   601M  0 part 
├─sda2   8:2    0   128M  0 part 
├─sda3   8:3    0 244.1G  0 part 
├─sda4   8:4    0   788M  0 part 
├─sda5   8:5    0  34.2G  0 part /run/media/liveuser/a3c550ab-b6be-486e-ac93-c524fcbf077a
├─sda6   8:6    0 146.5G  0 part 
├─sda8   8:8    0   3.9G  0 part 
└─sda9   8:9    0 501.3G  0 part 
sdb      8:16   0 931.5G  0 disk 
└─sdb1   8:17   0 931.5G  0 part 
sdc      8:32   1  14.9G  0 disk /run/archiso/bootmnt
├─sdc1   8:33   1   1.7G  0 part 
└─sdc2   8:34   1   104M  0 part

2 disks:

sda SSD Disk (main Lappy disk) with various partitions including win10 and Archlabs:
sda1 = EFI
sda2 = MS reserved Partition
sda3 = Windows 10 (C:)
sda4 = Windows Recovery
sda5 = EXT4 new /today) installation of Archlabs (not working - before was Manjaro whichI deleted and got myself into this mess LOL)
sda6 = My lovely Archlabs partition - please help me get her back!
sda8 = SWAP
sda9 = My data files

sdb SSD Disk (in DVD player bay)
sdb1 = my work files

[sdc is the live Endeavour OS USB]

[liveuser@eos-2022.09.10 ~]$ sudo fdisk -l
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: CT1000MX500SSD1 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 45760DE8-D8FC-4E80-A1D7-DF23A1610ABD

Device         Start        End    Sectors   Size Type
/dev/sda1       2048    1232895    1230848   601M EFI System
/dev/sda2    1232896    1495039     262144   128M Microsoft reserved
/dev/sda3    1495040  513495039  512000000 244.1G Microsoft basic data
/dev/sda4  513495040  515108863    1613824   788M Windows recovery environment
/dev/sda5  515108864  586788863   71680000  34.2G Linux filesystem
/dev/sda6  586788864  893995007  307206144 146.5G Linux filesystem
/dev/sda8  893995008  902187007    8192000   3.9G Linux swap
/dev/sda9  902187008 1953523711 1051336704 501.3G Microsoft basic data


Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: CT1000MX500SSD1 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 8CB4AF79-4B76-490F-9B92-49EBB9057951

Device     Start        End    Sectors   Size Type
/dev/sdb1   2048 1953523711 1953521664 931.5G Microsoft basic data


Disk /dev/sdc: 14.91 GiB, 16008609792 bytes, 31266816 sectors
Disk model: Cruzer Blade    
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x1e784590

Device     Boot   Start     End Sectors  Size Id Type
/dev/sdc1  *         64 3583359 3583296  1.7G  0 Empty
/dev/sdc2       3583360 3796351  212992  104M ef EFI (FAT-12/16/32)


Disk /dev/loop0: 1.61 GiB, 1724010496 bytes, 3367208 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[liveuser@eos-2022.09.10 ~]$ sudo mount -t auto /dev/sda1 /mnt 
[liveuser@eos-2022.09.10 ~]$ ls /mnt
boot-repair   dbx                           initramfs-linux.img               KEK
boot-sav      EFI                           initramfs-linux-lts-fallback.img  PK
BOOTSECT.BAK  grub                          initramfs-linux-lts.img           vmlinuz-linux
db            initramfs-linux-fallback.img  intel-ucode.img                   vmlinuz-linux-lts
[liveuser@eos-2022.09.10 ~]$ ls /mnt/EFI
archlabs  ASUS  Boot  EFI  EndeavourOS  Manjaro  Microsoft
[liveuser@eos-2022.09.10 ~]$ ls /mnt/EFI/archlabs
grubx64.efi
[liveuser@eos-2022.09.10 ~]$ ls /mnt/EFI/ASUS
BCD  BCD.LOG  BCD.LOG1  BCD.LOG2  el-GR  en-GB  es-ES  he-IL  pt-PT  ReAgent.xml  ru-RU
[liveuser@eos-2022.09.10 ~]$ ls /mnt/EFI/Boot
bkpbootx64.efi  bootx64.efi  fbx64.efi  mmx64.efi
[liveuser@eos-2022.09.10 ~]$ ls /mnt/EFI/EFI
manjaro
[liveuser@eos-2022.09.10 ~]$ ls /mnt/EFI/EFI/Manjaro
grubx64.efi
[liveuser@eos-2022.09.10 ~]$ ls /mnt/EFI/EndeavourOS/
grubx64.efi
[liveuser@eos-2022.09.10 ~]$ ls /mnt/EFI/Manjaro
grubx64.efi
[liveuser@eos-2022.09.10 ~]$ ls /mnt/EFI/Microsoft/
Boot  Recovery
[liveuser@eos-2022.09.10 ~]$ ls /mnt/grub
fonts  grubBAK.cfg  grub.cfg  grubenv  locale  themes  x86_64-efi
1 Like

First thing you need to do is back up your work files on /dev/sda9 and /dev/sdb1

Is that plug and play where you can just remove it? If you can do that without losing the data, you can get it out of harms way and avoid a catastrophic accident.

3 Likes

@PackRat

I back up all my personal (sda9) and work (sdb1) files onto an external hard drive every day
Did that last night

I also do a weekly backup on another external hard drive every Friday

My personal files are on sda9

My work files are on sdb1

I have to take the laptop apart to get the sdb disk out

1 Like

You’ll want to mount that partition from the Endeavour OS live system and copy the configuration and dotfiles you want to save.

2 Likes

There are your Windows 10 partitions don’t format those.
Do you have a Windows 10 install media in case this goes bad?

2 Likes

Done, although I am not sure if that is all of them:

[liveuser@eos-2022.09.10 ~]$ ls -a /run/media/liveuser/USB_STICK/Archlabs/
.           ArchLabs.conkyrc  .gtkrc-2.0        .lyxauth     .xprofile    .zshrc
..          ArchLabs.tint2rc  .jgmenu-lockfile  .Xauthority  .Xresources
.aliasesBU  .gtk-bookmarks    .kickshawrc       .xinitrc     .zprofile

Yup, but really hoping not to have to do that as I have lots of software etc setup on that Win installation LOL

You’ll want the files in ~/.config
Lie your i3 and openbox config files.

2 Likes

@PackRat - thanks for your help!

my .config has 15699 items, totalling 3.2 GiB

[liveuser@eos-2022.09.10 ~]$ ls /run/media/liveuser/ArchLabs/home/leigh/.config/
 atril           gthumb           nitrogen                  Thunar
 autostart       gtk-2.0          nwg-look                  tint2
 calibre         gtk-3.0          ocrfeeder                 touchpad-indicator
 catfish         i3               openbox                   transmission
 cef_user_data   i3status         pavucontrol.ini          'Unknown Organization'
 chromium        ibus             picom.conf                user-dirs.dirs
 configstore     inkscape         Pinta                     user-dirs.locale
 conky           jgmenu           plugin-Autenticacao.Gov   vidcutter
 corectrl        Joplin           privateinternetaccess     VirtualBox
 dconf           joplin-desktop   pulse                     volumeicon
 dunst           libfm            qpdfview                  xed
 filezilla       libreoffice      QtProject.conf            xfce4
 fontconfig      libvirt          qutebrowser               xsettingsd
 geany           mimeapps.list    rofi                      yay
 GIMP            mpv              Signal                    zoomus.conf
 gscan2pdfrc     neofetch         sinew.in
 gsimplecal      Nextcloud        skypeforlinux

Copied them all across to USB stick -it did say 10 hours to complete but now its finished
I had to skip symbolic links in case this is important

Is this all an in case thing? Am I going to try to keep the installation but if it goes tits up then I have the backups - or is a complete reinstall needed?

Thanks again

It’s just backup in case things go bad.

2 Likes

I’m not sure if you’ll need a complete reinstall; but you could end up with an odd partition scheme.

Were you set up with Win10 and Linux sharing the EFI partition?

Edit - reinstall of Linux, your Win10 should be ok.

2 Likes

I thought so. I presumed that this was the way it worked
But now you have asked, I am not sure.
How would I be able to tell?
It all got complicated by that pesky Manjaro installation

I think that’s what you were doing.

I need to research this some more. I don’t dual boot from a single drive. I have one drive Windows, one Linux.

I wasnt doing this, i.e. not everything on the same disk.
During installation of Archlabs I selected sda1 as the boot partition, so I guess Win, Manjaro and AL were all using the same EFI partition?