You are not logged in.

#1 2016-06-13 02:45:49

KarlKori
Member
Registered: 2016-04-16
Posts: 16

Faced with problems while trying to restore bootloader

Hello,

I have a laptop with installed Windows 10, Ubuntu and ArchLinux. Yesterday I have decided to remove Ubuntu, so I simply joined partitions used only by Ubuntu to partition, mounted by Arch as /home.
̶O̶b̶v̶i̶o̶u̶s̶l̶y̶  it met with a lack of understanding on the part of bootloader - GRUB, in my case.
So I have loaded using LiveUSB and followed instructions from wiki -- https://wiki.archlinux.org/index.php/GRUB#UEFI_systems
But faced with several problems - after root changing command grub-install (and all commands provided, as I understand, by grub package) is not found.
Without root changing grub-install reports that EFI partition is not found (rightly - it is not mounter yet).
Pacman after root changing returns with the next error: "failed to initialize alpm library (could not find or read directory: /var/lib/pacman/ -- to be precise /var is empty).
And my question is - what the reason of disappearance of grub-install after root changing? Or maybe I'm doing something completely wrong?

P.S. After previous experiments with the system, bleeding-edge Arch kernel failed to boot, so after a week of everynight f*ck with it I have migrated to LTS kernel. How can I create new bleeding-edge kernel, based on stable? I have not found any information in google, sorry.

Thank you in advance.

Offline

#2 2016-06-13 04:02:23

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: Faced with problems while trying to restore bootloader

/var being empty is a pretty serious problem and is most likely causing all the effects you have mentioned.  What filesystem is /var on, and did you possibly delete that directory?

You can build a new kernel with https://wiki.archlinux.org/index.php/Arch_Build_System but there really isn't a point unless you need to reconfigure it.  Otherwise, it will just create the same kernel that is in the repos.

Offline

#3 2016-06-13 07:15:30

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Faced with problems while trying to restore bootloader

KarlKori wrote:

after root changing command grub-install (and all commands provided, as I understand, by grub package) is not found.

Please post the exact "root changing command" that you used.

Did you try calling the full path to the GRUB binary?


Jin, Jîyan, Azadî

Offline

#4 2016-06-13 10:01:47

KarlKori
Member
Registered: 2016-04-16
Posts: 16

Re: Faced with problems while trying to restore bootloader

circleface wrote:

/var being empty is a pretty serious problem and is most likely causing all the effects you have mentioned.  What filesystem is /var on, and did you possibly delete that directory?

You can build a new kernel with https://wiki.archlinux.org/index.php/Arch_Build_System but there really isn't a point unless you need to reconfigure it.  Otherwise, it will just create the same kernel that is in the repos.

My fault - I should mount apropriate partition (it was separate) to /var.
After this has been done there is no problem with pacman (except that I'm too lazy to configure Internet in terminal, as it had when I installed Arch), but grub-install still does not recognized as command.

About kernel... as I realized in the morning, it is a wrong question, it should be reformulated to "is everything will be ok with data on storages if I will try to install new kernel on existing partitions?". Sounds like newbie question, but google betrayed me again.

Offline

#5 2016-06-13 10:21:03

KarlKori
Member
Registered: 2016-04-16
Posts: 16

Re: Faced with problems while trying to restore bootloader

Head_on_a_Stick wrote:
KarlKori wrote:

after root changing command grub-install (and all commands provided, as I understand, by grub package) is not found.

Please post the exact "root changing command" that you used.

# mount /dev/sda11 /mnt             #root partition.
# mount /dev/sda2 /mnt/boot/efi  #boot partition
# arch-chroot /mnt

Head_on_a_Stick wrote:

Did you try calling the full path to the GRUB binary?

There is no grub binary on the system.
find -name '*grub*' shows that there is only a folder /var/abs/core/grub

Could you please clarify another strange situation -- it seems that it is a root of problem with boot:
There is no partition mounted to /boot, only for /boot/efi. After mounting /boot has the next hierarchy:

EFI
|--Boot--....
|--Microsoft--....
|--OEM--....
|--ubuntu--|
                 |--grub.cfg
                 |--grubx64.ef
                 |--....
cat /boot/EFI/ubuntu/grub.cfg shows:

search.fs_uuid UUID_MISSING_IN_FSTAB root hd0,gpt8
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

As I understand, on deleted root partition of Ubuntu was /boot with correct grub.cfg. Strange, how could I configure such a crooked system.
Am I right? What the next steps should I do?

Last edited by KarlKori (2016-06-13 13:59:03)

Offline

#6 2016-06-13 20:33:39

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Faced with problems while trying to restore bootloader

KarlKori wrote:

[there is no problem with pacman (except that I'm too lazy to configure Internet in terminal, as it had when I installed Arch), but grub-install still does not recognized as command.

You should attempt to install the GRUB package (with `pacman`) and then install the GRUB bootloader to the disk as per https://wiki.archlinux.org/index.php/GR … allation_2

It would probably be better to mount the ESP to /boot to allow the use of systemd-boot or EFI_STUB booting as well as GRUB; flexibility when booting is always a good thing.


Jin, Jîyan, Azadî

Offline

#7 2016-06-13 23:16:45

KarlKori
Member
Registered: 2016-04-16
Posts: 16

Re: Faced with problems while trying to restore bootloader

Head_on_a_Stick wrote:
KarlKori wrote:

[there is no problem with pacman (except that I'm too lazy to configure Internet in terminal, as it had when I installed Arch), but grub-install still does not recognized as command.

You should attempt to install the GRUB package (with `pacman`) and then install the GRUB bootloader to the disk as per https://wiki.archlinux.org/index.php/GR … allation_2

It would probably be better to mount the ESP to /boot to allow the use of systemd-boot or EFI_STUB booting as well as GRUB; flexibility when booting is always a good thing.

I will try, but why grub (and all related commands) was available before root changing?

Last edited by KarlKori (2016-06-13 23:17:12)

Offline

#8 2016-06-14 07:08:57

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Faced with problems while trying to restore bootloader

KarlKori wrote:

why grub (and all related commands) was available before root changing?

Because those packages are present on the Arch live ISO.


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB