You are not logged in.

#1 2015-03-04 15:35:36

LeMarsu
Member
From: Lyon, France
Registered: 2015-03-04
Posts: 3

Switch from HDD to SSD, EFI wont load GRUB

Hi all !

I have an Asus Viviobook X201E. I have installed archlinux without issues. I partitioned my 500 GB disk as follow :

/dev/sda1 - 512   MB - EFI Partition
/dev/sda2 -   8   GB - Swap Partition
/dev/sda3 - 447.3 GB - Root partition - btrfs
/dev/sda4 -  10   GB - ISOs partition - ext4

The last partition is to store ISO of archlinux and other distro to boot them directly from grub.

Everything is working fine, but recently, I bought a 240 GB SSD. I wanted to switch my HDD with my new SSD.

I backed up everything, then, I install my SSD. The two differences between the partition map of the HDD and the SSD is that I inverted the root and ISO partition, and, of course, the root partition is smaller as my SSD is smaller than my HDD :

/dev/sda1 -  512 MB - EFI Partition
/dev/sda2 -    8 GB - Swap Partition
/dev/sda3 -   10 GB - ISOs partition - ext4
/dev/sda4 - ~200 GB - Root partition - btrfs

I then install my latest backup on the SSD. I generate my grub config file with

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

I then reinstall grub with

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub_uefi --recheck

This is the same line found in the wiki, it is the same line I used to install grub on my HDD.

In the end, when a run efibootmgr, I can see an entry for the newly installed grub. All seems well, but when I reboot, the entry vanishes. I'm unable to boot on my SSD.

Instead of reinstalling grub each time, I just tried to add the EFI entry with efibootmgr :

efibootmgr -c -d /dev/sda -w -p 1 -L grub -l \EFI\grub\grubx64.efi

efibootmgr does not complain. When I run efibootmgr without arguments, I can see the new entry added. But after a reboot, I doesn't work on the SSD, but it works well when I put back my HDD.

I tried updating my BIOS with the last version from ASUS, it didn't change a thing.

I can't find a reason why I can't boot on my SSD.

Any ideas ?

Best regards.

Offline

#2 2015-03-04 16:24:01

dice
Member
From: Germany
Registered: 2014-02-10
Posts: 413

Re: Switch from HDD to SSD, EFI wont load GRUB

Is your newly created entry in efibootmgr also the first in the boot order?
It might help if you post the output of efibootmgr


I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do.  (Gune | Titan A.E.)

Offline

#3 2015-03-04 18:20:23

LeMarsu
Member
From: Lyon, France
Registered: 2015-03-04
Posts: 3

Re: Switch from HDD to SSD, EFI wont load GRUB

Yeah, sure, it says its the first entry both times.

This is the output with the SSD:

root@archiso ~ # lsblk /dev/sda
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 223.6G  0 disk 
├─sda1   8:1    0   512M  0 part 
├─sda2   8:2    0     8G  0 part 
├─sda3   8:3    0    10G  0 part 
└─sda4   8:4    0 205.1G  0 part 
root@archiso ~ # efibootmgr 
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0002
Boot0002* UEFI: SanDisk 1.26
root@archiso ~ # efibootmgr -c -d /dev/sda -p 1 -w -l '\EFI\grub\grubx64.efi' -L Grub
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0000,0002
Boot0002* UEFI: SanDisk 1.26
Boot0000* Grub
root@archiso ~ # efibootmgr 
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0000,0002
Boot0000* Grub
Boot0002* UEFI: SanDisk 1.26

The lsblk output is just for information.

And when I reboot, the entry is gone, and I can start over.

This is the output with the HDD:

root@archiso ~ # lsblk /dev/sda
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0   512M  0 part 
├─sda2   8:2    0     8G  0 part 
├─sda3   8:3    0 447.3G  0 part 
└─sda4   8:4    0    10G  0 part 
root@archiso ~ # efibootmgr 
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0001
Boot0001* UEFI: SanDisk 1.26
root@archiso ~ # efibootmgr -c -d /dev/sda -p 1 -w -l '\EFI\grub\grubx64.efi' -L Grub
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0001,0000
Boot0000* \EFI\grub\grubx64.efi
Boot0001* Grub
root@archiso ~ # efibootmgr 
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0000,0001
Boot0000* Grub
Boot0001* UEFI: SanDisk 1.26

And when I reboot, it's boot correctly on the internal disk and not on the usbkey.

I think that the first entry is kept, but something goes wrong, and then EFI removes the entry, and go on. But it's the case only on the SSD. But it's just an idea. I cant't find out what changes between the disks.

Offline

#4 2015-03-04 20:59:01

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,778
Website

Re: Switch from HDD to SSD, EFI wont load GRUB

My firmware was similarly forgetful and would reset itself back to the first entries I made until I manually deleted the files at /sys/firmware/efi/efivars/Bootxxxx-* where xxxx is the bootnumber (followed by an alphanumeric string).

This clears all the NVRAM entries; you will have to make new entries afterwards (either manually or using GRUB), but these should "stick" (well, they did with my firmware anyway).

YMMV.


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB