efibootmgr --verbose tells MBR however it should UEFI, GPT. Or am I wrong ?
It means you are booted in Legacy (MBR) mode and not UEFI…
That’s most likely the cause why your Grub restore doesn’t work because it is restoring the MBR version instead of the UEFI version of Grub…
Edit: Didn’t noticed the grub command when i said that…
how to change it ?
I am using GPT (at least I used before mistake format and recover, probably recover change it to MBR).
An idea how to proceed ?
Lets check that…
Can you provide output of:
sudo fdisk --list-details /dev/sda
That will show you if it is MBR or GPT, plus more info.
Doesn’t the efi version of Grub have a different name?
(I can’t check myself, because im using a different Distro)
fdisk --list-details /dev/sda Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors Disk model: TOSHIBA MQ02ABF0 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: dos Disk identifier: 0x4c67e213 Device Boot Start End Sectors Id Type Start-C/H/S End-C/H/S Attrs /dev/sda1 * 2048 616447 614400 7 HPFS/NTFS/exFAT 0/32/33 38/94/56 80 /dev/sda2 616448 821247 204800 b W95 FAT32 38/94/57 51/30/43 /dev/sda3 1083392 976773119 975689728 7 HPFS/NTFS/exFAT 67/111/45 1023/254/63
I am using UEFI, the partition must be GPT. In the past I installed Windows and Manjaro as GPT.
I think, the testdisk restored it wrongly to MBR.
- boot flag wrongly on 315MB ntfs partition. For UEFI, it should be the 100MB, fat32
- 105MB fat32 missing boot and esp flags
Can you confirm, that converting to GPT and adding flags ‘esp’ and ‘boot’ to 100MB partition resolves the issue ?
That shows it is MBR and not GPT
I can’t assist you in converting sorry, that’s too dangerous to try assisting remotely …
Maybe others can be of more assistance.
But you can’t boot in UEFI while using MBR as boot medium
This is not the correct partition type for the ESP, yet you mount it as such…
what is wrong with sda2 ?
You wrote: *
/dev/sda2 616448 821247 204800 b W95 FAT32
This is not the correct partition type for the ESP, yet you mount it as such…
Windows uses 100MB Fat32 partition for UEFI:
[manjaro@manjaro ~]$ sudo mount /dev/sda2 /mnt/a [manjaro@manjaro ~]$ ls -l /mnt/a/EFI/ total 3 drwxr-xr-x 2 root root 1024 Feb 27 15:32 Boot drwxr-xr-x 2 root root 1024 Feb 27 15:38 manjaro drwxr-xr-x 3 root root 1024 Sep 30 2021 Microsoft
Your partition has type
b, See: EFI system partition - ArchWiki
So i have no idea how yours ended up with such a wrong partition-type…
(Note partition-type is not same as filesystem type)
Can you explain exactly how did you “format” the partitions? If you simply hit delete, it’s possible only their partition metadata was erased, in which case testdisk should’ve done the trick. I guess it’s possible that testdisk changed the partition UUIDs too?.. if they existed.
As @TriMoon pointed out, UEFI should be booting from GPT, not MBR. Although some implementations support booting in UEFI mode from MBR partition tables.
First of all, you probably don’t have the space for, but before you do/did any further attempts, you should’ve done a raw image backup of the entire drive. This is to guard you from doing mistakes, to have a safe fallback option in form of a backup.
The Manjaro Live USB has a menu entry at the bottom to detect EFI loaders. Does it work for you?
Assuming the UEFI implementation worked off MBR before, all I can add is this:
- Check that the grub files are really updated when you run the install grub commands, including grub.cfg (see modified times).
- My UEFI ignores the boot order set by “BootOrder” somehow. I suggest you enter the settings and check the “Hard Drive priorities” yourself to ensure “manjaro” is the first choice in priority.
Generally to fix the booting:
- Windows: you need an install or recovery CD. From there you can use bcdboot to restore/register the Windows bootloader. Note that the Windows 7 version of the tool does not support GPT, you need at least Win8 for this. I used this to successfully create a UEFI boot entry after converting my disk from MBR to GPT (I was fully prepared and left extra free space for GPT.)
diskpartto be used for partition manipulation and to mount them
- Linux: there’re multiple ways to boot, I guess you got the grub commands right. If you needed to register that grub as a boot entry, all you need is efibootmgr. However note that my system is UEFI+GPT, not MBR.
Yes, I did an image with ddrescue before. You can forget part of data recovery.
The bigest move forward was convertion of the whole sda from MBR to GPT. It went without problems. Windows tried to boot and failed, as expected. Honestly, following few online steps, I was able to repair windows boot very quickly, whilst I have been struggling with grub for days :frowning (
Yes, I can boot windows without problems, all files are there and working.
However, when I try to repair the grup (after convert sda to gpt).
- there is no grub screen/no choice windows/manjaro.
- only black screen, then laptop vendor log and then it failed at step /dev/sdb2: clean.
It seems, manjaro is selected by default, tries to load and fails…I dont know why
I followed the steps grub-fix-wiki 2-3 times, but still the same issue after reboot.
So previously restored windows boot is gone (I can not see windows, I can not select windows as there is no grub welcom page, so I can not boot windows anymore) and manjaro can not boot.
here are steps, I did
[manjaro@manjaro-cinnamon ~]$ su [manjaro-cinnamon manjaro]# manjaro-chroot -a grub-probe: error: cannot find a GRUB drive for /dev/sdc1. Check your device.map. grub-probe: error: cannot find a GRUB drive for /dev/sdc1. Check your device.map. ==> Mounting (ManjaroLinux) [/dev/sdb2] --> mount: [/mnt] --> mount: [/mnt/boot/efi] --> mount: [/mnt/home] [manjaro-cinnamon /]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS loop0 7:0 0 64.6M 1 loop loop1 7:1 0 1.2G 1 loop loop2 7:2 0 1.6G 1 loop loop3 7:3 0 694.6M 1 loop sda 8:0 0 465.8G 0 disk |-sda1 8:1 0 300M 0 part |-sda2 8:2 0 100M 0 part /boot/efi `-sda3 8:3 0 465.2G 0 part sdb 8:16 0 931.5G 0 disk |-sdb1 8:17 0 1G 0 part |-sdb2 8:18 0 40G 0 part / |-sdb3 8:19 0 60G 0 part /home `-sdb4 8:20 0 830.5G 0 part sdc 8:32 1 7.6G 0 disk |-sdc1 8:33 1 3.6G 0 part `-sdc2 8:34 1 4M 0 part
Yes, I can confirm, that root is 40GB partition and home is 60GB, as well as efi partition do match.
[manjaro-cinnamon /]# pacman -Syu grub :: Synchronizing package databases... core is up to date extra is up to date community 7.6 MiB 7.04 MiB/s 00:01 [######################] 100% multilib is up to date warning: grub-2.06.r261.g2f4430cc0-3 is up to date -- reinstalling :: Starting full system upgrade... resolving dependencies... looking for conflicting packages... Packages (1) grub-2.06.r261.g2f4430cc0-3 Total Installed Size: 46.84 MiB Net Upgrade Size: 0.00 MiB :: Proceed with installation? [Y/n] y (1/1) checking keys in keyring [#############################################] 100% (1/1) checking package integrity [#############################################] 100% (1/1) loading package files [#############################################] 100% (1/1) checking for file conflicts [#############################################] 100% (1/1) checking available disk space [#############################################] 100% :: Running pre-transaction hooks... (1/1) Creating Timeshift snapshot before upgrade... ==> skipping timeshift-autosnap due skipRsyncAutosnap in /etc/timeshift-autosnap.conf set to TRUE. :: Processing package changes... (1/1) reinstalling grub [#############################################] 100% :: GRUB no longer supports side-loading modules when secure boot is enabled. Thus booting will fail unless you have a 'grubx64.efi' executable with bundled modules. :: Running post-transaction hooks... (1/3) Arming ConditionNeedsUpdate... (2/3) Refreshing PackageKit... Error connecting: Could not connect: No such file or directory error: command failed to execute correctly (3/3) Updating the info directory file...
When I ran it first time, it downoloaded and installed about 400MB data. After restart still unable to boot, so I executed the reapair instruction again. This time, only one package 46MB is found, but it seems it fails to install. Or what does mean that error ?
[manjaro-cinnamon /]# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck Installing for x86_64-efi platform. Installation finished. No error reported.
[manjaro-cinnamon /]# grub-mkconfig -o /boot/grub/grub.cfg Generating grub configuration file ... Found theme: /usr/share/grub/themes/manjaro/theme.txt Found linux image: /boot/vmlinuz-5.15-x86_64 Found initrd image: /boot/intel-ucode.img /boot/initramfs-5.15-x86_64.img Found initrd fallback image: /boot/initramfs-5.15-x86_64-fallback.img Warning: os-prober will be executed to detect other bootable partitions. Its output will be used to detect bootable binaries on them and create new boot entries. ERROR: mkdir /var/lock/dmraid grub-probe: error: cannot find a GRUB drive for /dev/sdc1. Check your device.map. grub-probe: error: cannot find a GRUB drive for /dev/sdc1. Check your device.map. Adding boot menu entry for UEFI Firmware Settings ... Root filesystem isn't btrfs If you think an error has occurred, please file a bug report at "https://github.com/Antynea/grub-btrfs" Found memtest86+ image: /boot/memtest86+/memtest.bin done
ERROR: mkdir /var/lock/dmraid
I can see everytime. Is it relevant ?
[manjaro-cinnamon /]# ls -l /etc/default/grub -rw-r--r-- 1 root root 2286 Oct 19 21:25 /etc/default/grub
This is not changed recently…not sure, is that ok or problem ? However efi partition shows recent (today) timestamp:
[manjaro-cinnamon /]# ls -l /boot total 59457 drwxr-xr-x 5 root root 1024 Jan 1 1970 efi drwxr-xr-x 6 root root 4096 Mar 1 18:52 grub -rw------- 1 root root 35143003 Feb 27 16:02 initramfs-5.15-x86_64-fallback.img -rw------- 1 root root 9240187 Feb 27 16:02 initramfs-5.15-x86_64.img -rw-r--r-- 1 root root 5678080 Nov 8 20:02 intel-ucode.img -rw-r--r-- 1 root root 22 Feb 14 20:44 linux515-x86_64.kver drwxr-xr-x 2 root root 4096 Feb 15 15:09 memtest86+ drwxr-xr-x 2 root root 4096 Feb 17 20:22 syslinux -rw-r--r-- 1 root root 10797792 Feb 27 16:02 vmlinuz-5.15-x86_64 [manjaro-cinnamon /]# ls -l /boot/grub/ total 52 drwxr-xr-x 2 root root 4096 Oct 19 21:25 fonts -rw------- 1 root root 7514 Feb 27 16:39 grub.cf -rw------- 1 root root 7514 Mar 1 18:52 grub.cfg -rw-r--r-- 1 root root 1024 Oct 19 21:29 grubenv drwxr-xr-x 2 root root 4096 Mar 1 18:51 locale drwxr-xr-x 3 root root 4096 Oct 19 21:25 themes drwxr-xr-x 2 root root 20480 Mar 1 18:51 x86_64-efi
[manjaro-cinnamon /]# cat /etc/fstab # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a device; this may # be used with UUID= as a more robust way to name devices that works even if # disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> UUID=EC40-E2D4 /boot/efi vfat umask=0077 0 2 UUID=62a959f8-998a-4b75-8c86-54f4a0461707 swap swap defaults,noatime 0 0 UUID=1d12580d-22e2-4db1-abf8-cebbb9ee4c49 / ext4 defaults,noatime 0 1 UUID=fcdff842-3f01-43f7-8655-900b7b489fd8 /home ext4 defaults,noatime 0 2
[manjaro-cinnamon manjaro]# blkid /dev/loop1: TYPE="squashfs" /dev/sdb4: BLOCK_SIZE="512" UUID="4D9687C37DA18DF1" TYPE="ntfs" PARTUUID="94daa3cd-4005-48f9-988d-a3b7b253b3fb" /dev/sdb2: UUID="1d12580d-22e2-4db1-abf8-cebbb9ee4c49" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="c154e254-dd4d-4671-a0bb-2b1e8891e2bf" /dev/sdb3: UUID="fcdff842-3f01-43f7-8655-900b7b489fd8" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="12fcd9a5-b435-49a0-a747-76e1b19f3cce" /dev/sdb1: UUID="62a959f8-998a-4b75-8c86-54f4a0461707" TYPE="swap" PARTUUID="694c2280-6a2b-4b4a-a323-82f66bfa223a" /dev/loop2: TYPE="squashfs" /dev/loop0: TYPE="squashfs" /dev/sdc2: SEC_TYPE="msdos" LABEL_FATBOOT="MISO_EFI" LABEL="MISO_EFI" UUID="DD2E-7463" BLOCK_SIZE="512" TYPE="vfat" /dev/sdc1: BLOCK_SIZE="2048" UUID="2023-01-04-11-35-38-00" LABEL="MANJARO_CINNAMON_220" TYPE="iso9660" /dev/sda2: UUID="EC40-E2D4" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="Microsoft basic data" PARTUUID="815bcfd6-7e68-4386-a0b9-528e4fcabad1" /dev/sda3: BLOCK_SIZE="512" UUID="3CE64355E6430F18" TYPE="ntfs" PARTLABEL="Microsoft basic data" PARTUUID="a082d282-33f3-48ab-9d3c-3e6df47be2ff" /dev/sda1: LABEL="Obnovenie" BLOCK_SIZE="512" UUID="B2A43F98A43F5E53" TYPE="ntfs" PARTLABEL="Microsoft basic data" PARTUUID="c4d2811c-7218-4f0b-af53-5efbc0259937" /dev/loop3: TYPE="squashfs"
I did manage to display the grub menu by adding “menu” to GRUB_TIMEOUT_STYLE in /etc/default/grub and update the grub.
However grub menu does not show windows at all, and manjaro boot fails
cat /etc/default/grub GRUB_DEFAULT=saved GRUB_TIMEOUT=5 GRUB_TIMEOUT_STYLE=menu GRUB_DISTRIBUTOR="Manjaro" GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=UUID=62a959f8-998a-4b75-8c86-54f4a0461707 udev.log_priority=3" GRUB_CMDLINE_LINUX="" # If you want to enable the save default function, uncomment the following # line, and set GRUB_DEFAULT to saved. GRUB_SAVEDEFAULT=true # Uncomment to disable submenus in boot menu #GRUB_DISABLE_SUBMENU=y # Preload both GPT and MBR modules so that they are not missed GRUB_PRELOAD_MODULES="part_gpt part_msdos" # Uncomment to enable booting from LUKS encrypted devices #GRUB_ENABLE_CRYPTODISK=y # Uncomment to use basic console GRUB_TERMINAL_INPUT=console # Uncomment to disable graphical terminal #GRUB_TERMINAL_OUTPUT=console # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command 'videoinfo' GRUB_GFXMODE=auto # Uncomment to allow the kernel use the same resolution used by grub GRUB_GFXPAYLOAD_LINUX=keep # Uncomment if you want GRUB to pass to the Linux kernel the old parameter # format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx" #GRUB_DISABLE_LINUX_UUID=true # Uncomment to disable generation of recovery mode menu entries GRUB_DISABLE_RECOVERY=true # Uncomment this option to enable os-prober execution in the grub-mkconfig command GRUB_DISABLE_OS_PROBER=false # Uncomment and set to the desired menu colors. Used by normal and wallpaper # modes only. Entries specified as foreground/background. GRUB_COLOR_NORMAL="light-gray/black" GRUB_COLOR_HIGHLIGHT="green/black" # Uncomment one of them for the gfx desired, a image background or a gfxtheme #GRUB_BACKGROUND="/usr/share/grub/background.png" GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt" # Uncomment to get a beep at GRUB start #GRUB_INIT_TUNE="480 440 1" # Uncomment to ensure that the root filesystem is mounted read-only so that # systemd-fsck can run the check automatically. We use 'fsck' by default, which # needs 'rw' as boot parameter, to avoid delay in boot-time. 'fsck' needs to be # removed from 'mkinitcpio.conf' to make 'systemd-fsck' work. # See also Arch-Wiki: https://wiki.archlinux.org/index.php/Fsck#Boot_time_checking #GRUB_ROOT_FS_RO=true
So, If I summarize it shortly, there are probably two - three problems:
- pacman -Syu grub returns error: (2/3) Refreshing PackageKit…Error connecting: Could not connect: No such file or directory
- Grub does offer option for windows (I am using dual boot). There is only Manjaro
- Laptop boots Manjaro and it stuck at root partition clean and does not move forward.
Btw. not sure if that matters, however /home is full/out of space. Even if I delete some files, it still shows full. Where are files, deleted from live usb, from origin /home ? Nothing in live-usb trash. But I guess that grub and packages are written only to / it full /home should not matter ?
(Image) Well the kernel itself loads fine, this indicates grub has done its job. I’ve had the kernel panic at the exact same stage (CAPS LOCK LED blinking). However when it ran alright, the kernel was waiting for 2 minutes or so for the missing devices from /etc/fstab. How long have you been waiting for the OS to load at this step? Further I assume there’s a debug parameter to let the kernel show more detailed messages.
I did wait about 15 min and nothing .
Where to enter debug parameter? Because when it stops at the /dev/sdb2 clean, I can not writte any command there.
Because you posted output of commands you already provided:
- Is that last output you posted new and thus changed output with repect to the output you already posted?
- If it is not fresh info: Please remove it, and just quote that part from your previous post, because it confuses the thread and makes it almost UN-followable, because what output should we look at.
- If it is fresh info: Please update the old output and add a note that it was updated.
That way all the relevant info for your problem is in one place, the First post for all readers to look at and try to help.
This most likely means your Linux successfully booted, but has a problem with your graphics driver because it can not initialize your GUI to show you a login prompt…
This could be looked into if we are sure that is the step we need to focus on, but the title of the thread is different, so we might need to change that in that case…
- There is no need to post the listing of
/boot/grubunless explicitly asked for…
- Output of just blkid is useless because it is missing info, always use lsblk --fs --all.
That said, please focus on making Linux boot up and work BEFORE Micro$@$…
The current thread is so confusing because the topic title is inconsistent with what you write as replies…
- Either Grub works or not.
This is a completely different problem from the problem that you are unable to see your Micro$@$ boot entry or able to boot it.
- If your Grub boots your Linux, it means it is already working but you have problems after the Linux kernel boots.
So you need to clearup at what stage your problem actually is at.
- Grub can’t be executed, or has problems acting upon it’s config.
(This is what the topic title implies, but you explain the contrary in your replies.)
- Kernel boots but problems happen in initramfs.
- Linux boots but the GUI is not displayed.
I was even confused how to write this reply to make it clear how confusing this thread is at moment…
as I mentioned in post no. 17. there are 3 problems.
Actually, everytime I fix something, I move forward and new problem appears.
Grub menu is showed now (cool) but is missing Windows in the menu. I followed the official instruction multiple times - no luck.
So focus this threat on grub and how to add windows there.
I am going to open new thread for failed boot.
Quesion: How to add Windows to grub menu ?
Does your Linux bootup properly yet using Grub or not?
AFTER that works you can ask for assistance for integrating Micro$@$ in the menu.
To add Windows to grub menu just run
sudo update-grub once you have booted your Manjaro. For some reason it doesn’t work when booted from the liveUSB.
Can you change to console login with CTRL+ALT+F2 or ALT+F2?
This thread can be closed, it is being continued here:
Dual boot, two disks. By mistake I did format sda (efi boot and windows partitions). I have not touched sdb (manjaro)
testdisk was able to restore partitions with original data, however I was unable to boot and unable to restore grub.
What helped me
Steps 1&2 I performed from live-usb.
- Verify the partition type and flags
sudo parted -l Model: ATA TOSHIBA MQ02ABF0 (scsi) Disk /dev/sda: 500GB Sector size (logical/physical): 512B/4096B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 316MB 315MB primary ntfs boot 2 316MB 420MB 105MB primary fat32 3 555MB 500GB 500GB primary ntfs
Problems are here:
fdisk -las well as
parted -lshowed that the disk sda was msdos. However in my case I did remember, it should be GPT
- boot flag wrongly on 315MB partition. For UEFI, it should be the 100MB, fat32
- 105MB fat32 missing boot and esp flags
I had to convert /dev/sda (the whole disk) to GPT by issuing command:
sudo gdisk /dev/sda
Afterwards, I opened gparted and assigned ESP, BOOT for the 105 MB partition. I removed BOOT flag from the 315 MB partition
This is correct:
[manjaro@manjaro ~]$ sudo parted -l Model: ATA TOSHIBA MQ02ABF0 (scsi) Disk /dev/sda: 500GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 316MB 315MB ntfs Microsoft basic data msftdata 2 316MB 420MB 105MB fat32 Microsoft basic data boot, esp 3 555MB 500GB 500GB ntfs Microsoft basic data msftdata
- Re-install grub
I followed instructions uefi instructions in my case.
However after reboot there was no GRUB menu.
I booted live-usb again and opened grub file:
GRUB_TIMEOUT_STYLEand instead of hidden I entered menu.
So correct is:
Then I updated grub:
After restart, I can see GRUB menu, however there is only Manjaro, (Windows is missing from the menu)
- Add Windows to Grub menu
It seems, the repair from live-usb does not work for 100%. Somehow, Windows is not detected from live usb, os-prober does show anything.
So I did boot Manjaro from grub menu and performed following (this time I dont use live usb):
pacman -Syu grub- this time it didnt report any error (in previous posts you can see errors returned in chroot/live usb)
os-proberthis time detects Windows
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
grub-mkconfig -o /boot/grub/grub.cfg- this time without errors, whilst before (live usb, chroot, see above posts), there were errors
After reboot, I can see GRUB menu with options to select either Manjaro or Windows.
If you see error
grub-install: error: cannot open /boot/efi/EFI/manjaro/grubx64.efi’: Input/output error.` it means the folder is somehow broken. You must boot Windows CMD and either use mountvol or diskpart to access efi partition and either rename or delete ‘manjaro’ folder.
Then, from manjaro, you can recreate the grub.
Thank you all for you help
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.