Boot absolutely fails after reinstalling KDE/Cinnamon

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
zzora

Boot absolutely fails after reinstalling KDE/Cinnamon

Post by zzora »

Hi everyone!
I'm a total Linux newbie and a very stupid one, apparently. This will be a bit long, sorry about that. Two weeks ago I installed KDE 18.3 (I know it's not developed anymore, but this is the one I like the most, so why not give it try) from USB drive without any problems on a brand new laptop with no OS, no dual boot, just Mint. it was running okay, though it crashed frequently (that's probably my own fault) and after a while I kept losing several software's settings, for example Firefox kept resetting itself to the basic settings, which was very frustrating. I wanted to try Cinnamon as a clean install with only keeping my custom /data partition. I really shouldn't have touched anything. Thing is, I've already tried installing Cinnamon and KDE 3 or 4 times, formatting all the other partitions but /data, since there wasn't anything really important on those, being a new system and everything, I wouldn't have minded setting up those few softwares again. Every single time the process runs fine, then at the very end I get that evil "grub-efi-amd64-signed package failed to install into /target" message, then the installer crashes. In Cinnamon I couldn't even close the error message window, KDE can at least close it, not that it would matter.

I tried the following commands in the past days in Live mode with no success:
sudo mount /dev/sda3 /mnt
sudo grub-install /dev/sda
sudo grub-install --root-directory=/mnt/dev/sda (gave the "failed to get canonical path" message and there was a "grub-install.real: error: install device isn't specified" somewhere too)
There was also a longer set of commands ending with a "chroot" command, but I can't find which site i read it right now... this is getting way too confusing.

At this point I can only use Live mode (both Cinnamon and KDE only work in live), but only when the USB drive is first in the boot order, and CSM (Legacy) mode is on. If the HDD is set as first and Legacy is off, it gives me a boot failed message. The partitions are created perfectly, they're seen and accessible in live mode, only the boot is f***ed up. (When everything was working properly, USB was the first in the boot order because I didn't change it after the successful install, and there was nothing wrong with it.) Secure Boot is off, third party softwares are always unchecked during installation. It's getting hard to follow which settings i've modfified so far at all. I've run out of ideas, I hardly even have any experience in installing OSs. I suppose a total formatting of the hard drive could maybe be a quick workaround, but right now I can't do that because i've yet to buy an external drive for backup. What else could I try? I swear, if anything is able to make this damn thing work, I'll never, ever touch the system again.

Specs from terminal:

Code: Select all

mint@mint ~ $ inxi -Fxz
System:    Host: mint Kernel: 4.10.0-38-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: KDE Plasma 5.8.8 (Qt 5.6.1)
           Distro: Linux Mint 18.3 Sylvia
Machine:   System: FUJITSU product: LIFEBOOK A357
           Mobo: FUJITSU model: FJNBB5C v: 752828-01R8101755
           Bios: FUJITSU // Insyde v: Version 2.02 date: 12/28/2017
CPU:       Dual core Intel Core i3-6006U (-HT-MCP-) cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 7968
           clock speeds: max: 2000 MHz 1: 500 MHz 2: 500 MHz 3: 500 MHz
           4: 500 MHz
Graphics:  Card: Intel Sky Lake Integrated Graphics bus-ID: 00:02.0
           Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa)
           Resolution: 1920x1080@60.02hz
           GLX Renderer: Mesa DRI Intel HD Graphics 520 (Skylake GT2)
           GLX Version: 3.0 Mesa 17.0.7 Direct Rendering: Yes
Audio:     Card Intel Sunrise Point-LP HD Audio
           driver: snd_hda_intel bus-ID: 00:1f.3
           Sound: Advanced Linux Sound Architecture v: k4.10.0-38-generic
Network:   Card-1: Intel Wireless 7265 driver: iwlwifi bus-ID: 02:00.0
           IF: wlp2s0 state: up mac: <filter>
           Card-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: 3000 bus-ID: 03:00.0
           IF: enp3s0 state: down mac: <filter>
Drives:    HDD Total Size: 1004.3GB (0.8% used)
           ID-1: /dev/sda model: TOSHIBA_MQ01ABD1 size: 1000.2GB temp: 29C
           ID-2: /dev/sdb model: Name n/a size: 4.1GB temp: 0C
           ID-1: swap-1 size: 8.00GB used: 0.00GB (0%) fs: swap dev: /dev/sda2
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 41.0C mobo: N/A
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 172 Uptime: 34 min Memory: 892.4/3846.2MB
           Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35 

Code: Select all

mint@mint ~ $ sudo parted --list
Model: ATA TOSHIBA MQ01ABD1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  499MB   498MB   ext4
 2      499MB   8498MB  7999MB  linux-swap(v1)
 3      8498MB  18.5GB  9999MB  ext4
 4      18.5GB  53.5GB  35.0GB  ext4
 8      53.5GB  1000GB  947GB   ext4


Warning: The driver descriptor says the physical block size is 2048 bytes, but
Linux says it is 512 bytes.
Ignore/Cancel?

sda1 is my /boot partition
sda3 is /
sda4 is /home
sda8 is /data (numbered 8 because the first installation had more, pretty much unnecessary partitions and I decided to merge those with /home, but it didn't change a thing about the main problem)]

****************************************

Code: Select all

mint@mint ~ $ sudo efibootmgr -v
BootCurrent: 0000                                                                                                                                                                                                                            
Timeout: 0 seconds                                                                                                                                                                                                                           
BootOrder: 2001,0001,2002,0004,2003                                                                                                                                                                                                          
Boot0000* Generic USB Storage   PciRoot(0x0)/Pci(0x14,0x0)/USB(1,0)RC                                                                                                                                                                        
Boot0001* TOSHIBA MQ01ABD100    PciRoot(0x0)/Pci(0x17,0x0)/Sata(0,0,0)RC                                                                                                                                                                     
Boot0002* HL-DT-ST DVDRAM GUD0N PciRoot(0x0)/Pci(0x17,0x0)/Sata(1,0,0)RC                                                                                                                                                                     
Boot0004* Realtek PXE B03 D00   BBS(128,Realtek PXE B03 D00,0x0).......................................................................                                                                                                      
Boot2001* EFI USB Device        RC                                                                                                                                                                                                           
Boot2002* EFI DVD/CDROM RC                                                                                                                                                                                                                   
Boot2003* EFI Network   RC   

*********************************

Code: Select all

mint@mint ~ $ sudo os-prober                                                                                                                                                                                                                 
/dev/sda3:Linux Mint 18.3 Sylvia (18.3):LinuxMint:linux                                                                                                                                                                                      
grub-probe: error: cannot find a GRUB drive for /dev/sdb1.  Check your device.map.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
sleeper12
Level 21
Level 21
Posts: 14514
Joined: Thu May 25, 2017 3:22 pm

Re: Boot absolutely fails after reinstalling KDE/Cinnamon

Post by sleeper12 »

I'm not sure how you are installing Mint (or why you are messing with partitions), but I use Unetbootin to install with no problems yet. If it's not in package manager, you can download it:
https://unetbootin.github.io
User avatar
all41
Level 19
Level 19
Posts: 9518
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Boot absolutely fails after reinstalling KDE/Cinnamon

Post by all41 »

grub-probe: error: cannot find a GRUB drive for /dev/sdb1. Check your device.map.
Seems like it thinks grub is on /dev/sdb. parted shows no sdb.
Perhaps grub was installed to a usb instead of your /boot partition on /dev/sda.

You can boot into an install .iso dvd/usb and copy/paste the following terminal search string. Be sure to click on CODE:SELECT ALL.

Code: Select all

sudo fdisk -l 2>/dev/null | egrep "Disk /|/dev/" | sed "s#^/dev/#Part /dev/#" | awk '{print $2}' | sed 's/://' | xargs -n1 -IX sudo sh -c "hexdump -v -s 0x80 -n  2 -e '2/1 \"%x\" \"\\n\"' X | xargs -n1 -IY sh -c \"case  \"Y\" in '48b4') echo X: GRUB 2 v1.96 ;; 'aa75' | '5272') echo X: GRUB Legacy ;; '7c3c') echo X: GRUB 2 v1.97 or v1.98 ;; '020') echo X: GRUB 2 v1.99 ;; *) echo X: No GRUB Y ;; esac\""
That will search all partitions for instances of grub config files and report the wherabouts (if any)--and of course you can edit /etc/default/grub from there as well.

Also there are boot utilities like Super Grub2 Disk that will supply a temporary
boot into discovered Linux installs, and if you get booted to your Mint you can use the terminal command:
sudo install-grub /dev/s??

Make sure the /dev/s?? designation is correct, and this drive is also the default hd boot device in your bios.
Everything in life was difficult before it became easy.
zzora

Re: Boot absolutely fails after reinstalling KDE/Cinnamon

Post by zzora »

Hi, thanks for the tip. The command shows grub in the right place, on the hard drive:

Code: Select all

/dev/loop0: No GRUB 5695
/dev/sda: GRUB 2 v1.99
/dev/sda1: No GRUB 00
/dev/sda2: No GRUB 00
/dev/sda3: No GRUB 00
/dev/sda4: No GRUB 00
/dev/sda8: No GRUB 00
/dev/sdb: No GRUB f7e1
/dev/sdb1: No GRUB f7e1
/dev/sdb2: No GRUB 696e
(sdb is the USB device)

grub-install and update-grub commands still give the failed to get canonical path 'aufs' message, though at one point I managed to get a this GPT partition label contains no BIOS Boot Partition; embedding won't be possible error message, that one was at least something new.

After a few, already tried commands...

Code: Select all

mint@mint ~ $ sudo mount /dev/sda1 /mnt/boot
mint@mint ~ $ sudo grub-install
grub-probe: error: failed to get canonical path of `aufs'.
Installing for i386-pc platform.
grub-install.real: error: install device isn't specified.
mint@mint ~ $ for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
mint@mint ~ $ sudo chroot /mnt
...it show this:

Code: Select all

mint ~ # grub-install /dev/sda
Installing for x86_64-efi platform.
grub-install.real: error: cannot find EFI directory.
even though the boot partition is EFI:

Code: Select all

mint ~ # fdisk -l
Disk /dev/loop0: 2 GiB, 2121834496 bytes, 4144208 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                                                                                                                                                                                            
                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                             
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors                                                                                                                                                                            
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: 1A817B55-87DC-4D48-AEAE-DC1F8D04DF9E                                                                                                                                                                                        
                                                                                                                                                                                                                                             
Device         Start        End    Sectors   Size Type                                                                                                                                                                                       
/dev/sda1       2048     974847     972800   475M EFI System                                                                                                                                                                             
/dev/sda2     974848   16596991   15622144   7.5G Linux swap                                                                                                                                                                                 
/dev/sda3   16596992   36126719   19529728   9.3G Linux filesystem                                                                                                                                                                           
/dev/sda4   36126720  104474623   68347904  32.6G Linux filesystem                                                                                                                                                                           
/dev/sda8  104474624 1953523711 1849049088 881.7G Linux filesystem    
What's still missing?
hcentaur13

Re: Boot absolutely fails after reinstalling KDE/Cinnamon

Post by hcentaur13 »

It is a simple question! Since Mint 19 the live system boots in default in UEFI mode. UEWFDI requires a GPT partition to create a partition /efi to get inside that a directory to boot the installed system - and another partition(s) for booting another OSes.

It depends at least on the manufactur of your mainboard how to get a system to setup a system in CSM mode.

Each OS, including wwindows and Linux has the ability do boot in compatibiliy (CSM) mode ADN alternatively to boot in UEFI. To be sure to boot the installer in the right (incompatibe) mode you have either to boot BBS or explity by BIOS and selecting there directly way to boot up the the right OS in the right mode. Lool in BIOS which OS can be bootet in which mode!° The BIOS gives you a list ob bootable media with boot names startion WITH UEFI and ther names WITHOUT BIOS. The boot method used to boot up the install mediom defines the boot method using by the final installed medium.

It makes live much easier to use CSM <b>or</b> UEFI for all OSes to be installed.

UEFI requires a new, incompatible partition table named GPT. This type of partition tabelle is incompatible to the old MSDOS one. MSTOS is outdated because of the inability to work with big files and partitions. If the drive you likes to boot from is bigger than 4 TB or you will boot UEFI method you have no choice: UEFI is the only method that is useable. You can make more than 4 standard partitions then.
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: Boot absolutely fails after reinstalling KDE/Cinnamon

Post by fabien85 »

You have at least one confusion : you think sda1 is the EFI partition. It is not.
What you seem to have is a partition for /boot (formatted with a ext4 filesystem). That is possible, but unnecessary on unencrypted system. /boot contains the kernel, initial ramdisk, classically the grub config file and modules, and some other boot stuff.
An EFI partition is formatted with a FAT32, has the "boot" and "esp" flags in gparted, and contains the bootloaders as EFI executable : bootmgfw.efi for windows, for linux you could use grubx64.efi (default of most distros) but there are other choices (refind, elilo,...).

Way to go:
- from the live USB, open the /data partition
- backup everything there to an external disk
- unmount the partition and unplug the external disk
- open gparted and reformat the internal hard drive to gpt, to start fresh
- launch the installer and proceed to a standard install: "erase the disk and install linux mint"
- forget about /home, /data etc, just live with a standard system
- boot the fresh system and copy back the data you had backed up
zzora

Re: Boot absolutely fails after reinstalling KDE/Cinnamon

Post by zzora »

Okay, I now have a proper-looking EFI partition formatted to FAT32, flagged boot and esp (contains the grubx64.efi file as well), but yet again, when I set the HDD first in the boot order and try to start the laptop, all I get is the same "no bootable device / boot failed" error. I'mma go cry in a corner. Probably it was just beginner's luck that I accidentally managed to get everything right back then at the first install.
sleeper12
Level 21
Level 21
Posts: 14514
Joined: Thu May 25, 2017 3:22 pm

Re: Boot absolutely fails after reinstalling KDE/Cinnamon

Post by sleeper12 »

Not sure this will help or confuse you more, but have a look at this thread:

viewtopic.php?t=216890
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: Boot absolutely fails after reinstalling KDE/Cinnamon

Post by fabien85 »

zzora wrote: Sun Dec 16, 2018 5:50 pm Okay, I now have a proper-looking EFI partition formatted to FAT32, flagged boot and esp (contains the grubx64.efi file as well), but yet again, when I set the HDD first in the boot order and try to start the laptop, all I get is the same "no bootable device / boot failed" error. I'mma go cry in a corner. Probably it was just beginner's luck that I accidentally managed to get everything right back then at the first install.
Did you make a standard install as I suggested, or went your own way ? If the latter, please describe exactly what you did. It's not sufficient to create an EFI partition and put grub there, the bootloader also has to be registered in the NVRAM of the computer.
This "no bootable device" error could come from several reasons :
- make sure the boot mode is set to UEFI, and disable secure boot if you can
- some machines (mostly acer) are buggy and refuse to register the linux bootloader, see this page for a fix: https://itsfoss.com/no-bootable-device-found-ubuntu/
- if none of these options works, please boot the live USB, run sudo efibootmgr -v from a terminal and post here the output.
zzora

Re: Boot absolutely fails after reinstalling KDE/Cinnamon

Post by zzora »

I honestly have no idea what the f*** did I do last night, the whole thing is royally screwed to the point that I can't even access the firmware (I wanted to reset it to the factory defaults just in case, though I only started to experiment with the settings after the unsuccessful installations). When trying to boot the HDD, the screen only shows "Checking media", then goes black, then checks media again, black again, and so on, to infinity and beyond; and when I boot the Live USB, the Fujitsu logo doesn't even show up. I haven't even touched the machine since the "no bootable device" thing, so what the hell. Gonna buy some storage tomorrow and start it all over... What bugs me the most that everything worked perfectly in the first round, and I haven't screwed with the boot settings at all after the completed installation. I use the same installer now and still, something's wrong. I wasn't always this stupid, really.

Code: Select all

mint@mint ~ $ sudo efibootmgr -v
BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0001,2001,2002,2003
Boot0000* IPv4 (38-AF-D7-39-2E-E9)      PciRoot(0x0)/Pci(0x1c,0x5)/Pci(0x0,0x0)/MAC(38afd7392ee9,0)/IPv4(0.0.0.0:0<->0.0.0.0:0,0,0)RC
Boot0001* TOSHIBA MQ01ABD100    PciRoot(0x0)/Pci(0x17,0x0)/Sata(0,0,0)RC
Boot0002* HL-DT-ST DVDRAM GUD0N PciRoot(0x0)/Pci(0x17,0x0)/Sata(1,0,0)RC
Boot0003* IPv6 (38-AF-D7-39-2E-E9)      PciRoot(0x0)/Pci(0x1c,0x5)/Pci(0x0,0x0)/MAC(38afd7392ee9,0)/IPv6([::]:<->[::]:,0,0)RC
Boot0004* Generic USB Storage   PciRoot(0x0)/Pci(0x14,0x0)/USB(1,0)RC
Boot2001* EFI USB Device        RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC

Code: Select all

mint@mint ~ $ sudo parted --list                                                                                                                                                                                                             
Model: ATA TOSHIBA MQ01ABD1 (scsi)                                                                                                                                                                                                           
Disk /dev/sda: 1000GB                                                                                                                                                                                                                        
Sector size (logical/physical): 512B/4096B                                                                                                                                                                                                   
Partition Table: gpt                                                                                                                                                                                                                         
Disk Flags:                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                             
Number  Start   End     Size    File system     Name  Flags                                                                                                                                                                                  
 1      1049kB  499MB   498MB   fat32                 boot, esp                                                                                                                                                                              
 2      499MB   8498MB  7999MB  linux-swap(v1)                                                                                                                                                                                               
 3      8498MB  18.5GB  9999MB  ext4                                                                                                                                                                                                         
 4      18.5GB  53.5GB  35.0GB  ext4                                                                                                                                                                                                         
 8      53.5GB  1000GB  947GB   ext4                                                                                                                                                                                                         
                                       
fabien85
Level 7
Level 7
Posts: 1877
Joined: Tue Mar 11, 2014 4:30 pm

Re: Boot absolutely fails after reinstalling KDE/Cinnamon

Post by fabien85 »

zzora wrote: Mon Dec 17, 2018 10:13 am I can't even access the firmware (I wanted to reset it to the factory defaults just in case, though I only started to experiment with the settings after the unsuccessful installations). When trying to boot the HDD, the screen only shows "Checking media", then goes black, then checks media again, black again, and so on, to infinity and beyond; and when I boot the Live USB, the Fujitsu logo doesn't even show up.
wow, not being able to access the firmware is definitely not normal.
No matter what happens on the internal hard drive, you should still be able to access the firmware.
Try disconnecting the hard drive, you should still be able to boot on a live USB in principle. (or there is a deeper hardware problem).
To reset the firmware, you could try removing the CMOS battery for a while and putting it back in. Or look at your computer manual for a way to perform the reset physically.
From you efibootmgr output (which I wonder how you got if you are not able to boot a live USB), there is no boot entry for Linux in the NVRAM. In fact there is no boot entry other than the defaults populated by the firmware. So you dont risk anything resetting the firmware.

So you can try unplugging the hard drive, booting the live USB, plugging the drive (e.g. through a USB enclosure, which is cheap), see if Linux detects the drive and if so install to it. Then shutdown, put the drive back in and reboot.
zzora

Re: Boot absolutely fails after reinstalling KDE/Cinnamon

Post by zzora »

Booting the Live USB does work, it's fully functioning, but after switching the laptop on, it skips the welcome (logo + bios) screen and goes straight to the menu of the installer (where you can choose whether to load it in normal or compatibility mode, I don't know the rest of the options from memory). It's kind of a weird Schrödinger's device that does and does not work at the same time. We'll see whether a full formatting will work, if not, I'll have to take it to a repair shop since it's under warranty.
zzora

Re: Boot absolutely fails after reinstalling KDE/Cinnamon

Post by zzora »

Thanks everyone, so far it seems that a full formatting and a clean reinstall resolved the problem (it still skips the boot splash screen though, but oh well, that's not so bad).
Locked

Return to “Installation & Boot”