You are not logged in.
Pages: 1
I'm having trouble selecting Arch being first option in the GRUB menu.
I've tried reading about it on wiki: https://wiki.archlinux.org/index.php/GRUB but all the instructions (I think) are for new systems (creating grub.cfg, adding entries etc.)
I might be just lost. I have Ubuntu, Win7 and Arch installed. Right now (been for few months cause I'm lazy and didn't want to check how GRUB works) Ubuntu is listed as first entry when spining up the computer, but when I check in grub-customizer and /boot/grub/grub.cfg section with arch is first under /etc/grub.d/10_linux section and all other OSs under ../30_os-prober. And same "sorting" is used in Customizer.
What I have trouble finding is where list of how OSs are listed in GRUB. I can set Arch as being default in grub-cutomizer but I'm looking for option where I will be able to choose which entry is First or Second. Right now as I said in Grub Ubuntu is the top option.
Thanks for the anwser in advance.
Last edited by christooss (2017-04-21 10:33:58)
Offline
...cause I'm lazy and didn't want to check how GRUB works...
Being lazy is not the ideal mentality to use Arch with. Nor does it provide an excuse to ignore the forum rules. Please replace your image by a thumbnail. As for your problem: A quick Google search suggests this.
Offline
I changed the picture to link.
I'm not asking how to change what default is. I want to change sorting of the list in GRUB. I found that link too but doesn't solve my issue that is I want to learn how to change order of listings in GRUB and yeah I can be lazy and just do grub default=number but why if I want to learn something new.
Offline
Oh I got it. Sorry for misunderstanding your issue. Regarding the order of the entries in the boot menu, you seem to have taken the right steps.
Can you post the output of
ls /etc/grub.d/and, if the scripts are named appropriately (see link), confirm that you did indeed run
update-grub?
Does the problem still persist?
Offline
This is the output. And everywhere I read it shoud start with 10 and then go to 41 but on my system it goes 30, 10
And then second option in 30 is first one in grub.
drwxr-xr-x 99 root root 4096 Apr 21 11:08 ..
-rwxr-xr-x 1 root root 8871 Mar 16 22:15 00_header
-rwxr-xr-x 1 root root 10208 Mar 16 22:15 10_linux
-rwxr-xr-x 1 root root 10455 Mar 16 22:15 20_linux_xen
-rwxr-xr-x 1 root root 11301 Mar 16 22:15 30_os-prober
-rwxr-xr-x 1 root root 214 Mar 16 22:15 40_custom
-rwxr-xr-x 1 root root 216 Mar 16 22:15 41_custom
-rw-r--r-- 1 root root 483 Mar 16 22:15 READMEDid you mean grub-mkconfig cause update-grub is not present and is I think ubuntu thingy.
Last edited by christooss (2017-04-21 12:19:55)
Offline
I realize that you may not like my suggestion but anyway. The easiest way is to use a self-made grub.cfg and not to use the scripts; the entries will appear in order they are set. Moreover, all of these scripts give plenty (rescue, etc...) entries that make no sense and usually don't work. You may also consider using a simpler bootloader. For Bios system, syslinux works well, for uefi refind or systemd-boot. Anyway, I put an example of self-made grub.cfg below.
insmod efi_gop
insmod efi_uga
insmod ext2
terminal_input console
terminal_output console
search --fs-uuid --set=root <UUID1> # UUID of the boot partition.
set default=0
set timeout=3
set rootdev="<UUID2>" # UUID of the partition of the root filsesystem.
menuentry "Archlinux" {
linux /boot/vmlinuz-linux root=${rootdev} rw ipv6.disable=1 intel_pstate=disable
initrd /boot/initramfs-linux.img
}Last edited by olive (2017-04-21 12:31:06)
Offline
@olive that might just be the only solution I will have and not a bad one. I did that in grub 1 and it was explained to me that grub2 does everything automagicaly and now (few years
) I don't know how to change anything. And even grub.cfg looks like it should put arch at top but doesn't ![]()
It's really wierd to me that there are menuentries in grub.cfg and then are scripts in /etc/grub.d/ I always thought it's one or the other. But now I see that scripts are used to create grub.cfg's menuentries.
EDIT: And I want to learn how to do stuff with GRUB thats why I'm asking and autobooting to arch is option I will enable just want to try to configure other stuff.
Last edited by christooss (2017-04-21 12:38:06)
Offline
Did you mean grub-mkconfig cause update-grub is not present and is I think ubuntu thingy.
That's precisely what I meant.
And everywhere I read it shoud start with 10 and then go to 41 but on my system it goes 30, 10
Given that I guess olive's suggestion of editing grub.cfg appears to be the most reasonable (provided that you want to stick to GRUB). In that case keep in mind to have a backup of your costum grub.cfg, in case grub-mkconfig is run for some reason.
Last edited by robg (2017-04-21 12:39:54)
Offline
insmod efi_gop insmod efi_uga insmod ext2 terminal_input console terminal_output console search --fs-uuid --set=root <UUID1> # UUID of the boot partition. set default=0 set timeout=3 set rootdev="<UUID2>" # UUID of the partition of the root filsesystem. menuentry "Archlinux" { linux /boot/vmlinuz-linux root=${rootdev} rw ipv6.disable=1 intel_pstate=disable initrd /boot/initramfs-linux.img }
efi_gop would work for most UEFI boot, and there's all_video.
I don't recall you really need to load any filesystem module yourself, not even ntfs. In case you want to do it anyway, it is for the filesystem where the kernel or so is.
terminal_input and terminal_output should not be crucial. (Truth is I don't even remember what they are for).
You don't really need to "search" / "switch root" if the grub directory is in /boot, unless you have multiple /boot.
You need to add UUID= either before <UUID2> or after root=. (This is not needed for the search command.)
Whether the path in the linux and initrd lines should be prefixed with /boot depends on whether the specific /boot is on a separate partition.
Off-topic: hmm, disable intel_pstate? Don't forget intel-ucode btw.
On-topic again: screw grub-mkconfig and wrappers!
Last edited by tom.ty89 (2017-04-21 12:51:07)
Offline
efi_gop would work for most UEFI boot, and there's all_video.
Probably, I I just wanted something that works, Loading an extra module makes no noticeable difference.
I don't recall you really need to load any filesystem module yourself, not even ntfs. In case you want to do it anyway, it is for the filesystem where the kernel or so is.
You need to load the modules related to the filesystem where you need to see files, notably where the kernel resides. In my example, the kernel resided on an ext2 partition, so I needed it. You normally don't have to read files on ntfs partitions, either you chainload the volume boot record (Bios System) or you chainload the windows efi loader that usually resides on the efi fat32 partition.
terminal_input and terminal_output should not be crucial. (Truth is I don't even remember what they are for).
Grub does "fancy" things with the console and the resolution that sometimes work and sometimes cause problems. This configuration leaves the console in text mode which works in all cases without problems.
You don't really need to "search" / "switch root" if the grub directory is in /boot, unless you have multiple /boot.
In my example, I loaded the kernel in a different partition that the one where grub resides. I had grub in the EFI partition and the kernel in the main partition. So I needed to locate it.
You need to add UUID= either before <UUID2> or after root=. (This is not needed for the search command.)
Euh? I set a grub variable rootdev to be UUID2 and I pass it to the kernel via the "root=" option. I follow here the convention to use variable when possible (make adaptation easier).
Whether the path in the linux and initrd lines should be prefixed with /boot depends on whether the specific /boot is on a separate partition.
I have set the root variable with a search command and use absolute paths. This setting works but variations are possible.
Off-topic: hmm, disable intel_pstate? Don't forget intel-ucode btw.
I don't use grub anymore (I use refind now). The disabling intel_pstate was for a specific reason (a small tablet that had problem with it). Indeed intel-ucode is a good idea. Don't forget it was just an example. My configuration was not destinated to be a copy-pasted without knowing what you do. It is just usually much simpler to adapt an example than to make such configuration from scratch.
On-topic again: screw grub-mkconfig and wrappers!
As I said, I have thrown away grug entirely in favor of refind. Grub is way too complex for its intended purpose IMHO, which is putting the kernel in memory and that's it.
Last edited by olive (2017-04-21 13:23:42)
Offline
You need to load the modules related to the filesystem where you need to see files, notably where the kernel resides. In my example, the kernel resided on an ext2 partition, so I needed it. You normally don't have to read files on ntfs partitions, either you chainload the volume boot record (Bios System) or you chainload the windows efi loader that usually resides on the efi fat32 partition.
In my experience grub has most/all filesystem modules loaded automatically. I don't recall I ever needed an insmod line for that. Same case for the partition table ones. ntfs is needed for chainloading NTLDR/bootmgr.
Grub does "fancy" things with the console and the resolution that sometimes work and sometimes cause problems. This configuration leaves the console in text mode which works in all cases without problems.
I think they are the default though.
In my example, I loaded the kernel in a different partition that the one where grub resides. I had grub in the EFI partition and the kernel in the main partition. So I needed to locate it.
Yeah I do --boot-directory $esp myself too, if that's what you mean.
Euh? I set a grub variable rootdev to be UUID2 and I pass it to the kernel via the "root=" option. I follow here the convention to use variable when possible (make adaptation easier).
You are still missing it. You need to specify that it's a UUID when you pass an UUID to root=. Same case for LABEL and so on. And precisely when you have an initramfs, root= doesn't go to the kernel.
I have set the root variable with a search command and use absolute paths. This setting works but variations are possible.
That's not the point. Consider if you have a separate /boot partition, what do you think would happen if you look for a "/boot" when it is the "/".
Btw some of these stuff are not even grub-specific. Also I was picky on extra lines just because I don't want to be grub-mkconfig in live. You can always add when prompt anyway.
Grub is way too complex for its intended purpose
I never find it complex anymore ever since I am aware that this whole grub-mkconfig is pure silliness. It's indeed a bit more capable though, which is handy/necessary when you need to perform some complex booting (e.g. booting an image _file_).
Last edited by tom.ty89 (2017-04-21 19:29:06)
Offline
In my experience grub has most/all filesystem modules loaded automatically. I don't recall I ever needed an insmod line for that. Same case for the partition table ones. ntfs is needed for chainloading NTLDR/bootmgr.
In EFI mode you need to chainload boofwmgr which resides in the EFI partition. You don't need NTFS drivers for that. in UEFI mode chainloding just mean executing an efi executable. That's what the firmware do in a default "Windows only" configuration. In BIOS mode the most reliable way is to chainload the volume boot record of the Windows partition. For some reasons, the grub developers support directly loading a Windows ntdlr file. The protocol varies from Windows versions and was not intended to use directly.
I confirm that my setup worked for me (UUID2 should indeed be in the form of "UUID=...", which is understood by the initramfs ). In my example the kernel was not in a separate /boot partition nor in the UEFI one but on the main one (I keep everything including /boot in a single partition) under the /boot directory. In some situations, I may have inserted a few extra modules though. In EFI mode at least, I don't even have installed grub with grub-install but have copied the needed files myself and created an EFI boot entry with efibootmgr.
As I said, this is only an example, you need to adapt it according to the situation. My precise reason to use grub was to boot a Linux 64 bits on a UEFI 32 bits. I had created a 32 bits grub-standalone from a 64 bits machine and used it to boot my 64 bits installation. I have also modified the boot media for this (basically using the 32 bits grub).
Last edited by olive (2017-04-26 09:04:49)
Offline
Pages: 1