Difference between revisions of "Talk:GRUB"

From ArchWiki
Jump to: navigation, search
(Need simplified steps: new section)
(use https for links to archlinux.org)
(30 intermediate revisions by 13 users not shown)
Line 1: Line 1:
 +
== GRUB Legacy stuff should be removed ==
 +
 +
I mean, seriously, the page is loaded with too much information anyway. And also because of this: https://www.archlinux.org/news/grub-legacy-no-longer-supported/ --[[User:DSpider|DSpider]] ([[User talk:DSpider|talk]]) 17:41, 29 August 2012 (UTC)
 +
 
== EFI ==
 
== EFI ==
  
Line 87: Line 91:
  
 
Both grub2 and grub-legacy write to the space between the end of the MBR and the beginning of the first partition.  I'm no expert on this matter; I just learned about it today.  That said, it makes me question the usefulness of the dd backup/restore method in the [https://wiki.archlinux.org/index.php/GRUB2#Backup_Important_Data Backup Important Data] section. --[[User:Alphaniner|Alphaniner]] ([[User talk:Alphaniner|talk]]) 20:07, 25 July 2012 (UTC)
 
Both grub2 and grub-legacy write to the space between the end of the MBR and the beginning of the first partition.  I'm no expert on this matter; I just learned about it today.  That said, it makes me question the usefulness of the dd backup/restore method in the [https://wiki.archlinux.org/index.php/GRUB2#Backup_Important_Data Backup Important Data] section. --[[User:Alphaniner|Alphaniner]] ([[User talk:Alphaniner|talk]]) 20:07, 25 July 2012 (UTC)
 +
:As far as I know, only GRUB2 uses the post-MBR gap. GRUB2 will notice when there is not enough space at the post-MBR gap and return a warning message (without overwriting anything, see [[https://wiki.archlinux.org/index.php/GRUB2#msdos-style_error_message]]) [[User:6arms1leg|6arms1leg]] ([[User talk:6arms1leg|talk]]) 15:45, 22 August 2012 (UTC)
  
 
== GRUB2 + Windows 7 TrueCrypt-encrypted partition ==
 
== GRUB2 + Windows 7 TrueCrypt-encrypted partition ==
Line 139: Line 144:
  
 
In my case, I only did the backup, install grub-bios, install os-prober, [[GRUB2#Install_to_440-byte_MBR_boot_code_region]], edit {{ic|/etc/grub.d/40_custom}}, and finally grub-mkconfig. My computer is dual-boot with Windows 7.
 
In my case, I only did the backup, install grub-bios, install os-prober, [[GRUB2#Install_to_440-byte_MBR_boot_code_region]], edit {{ic|/etc/grub.d/40_custom}}, and finally grub-mkconfig. My computer is dual-boot with Windows 7.
 +
 +
--[[User:Allencch|Allencch]] ([[User talk:Allencch|talk]]) 00:23, 1 August 2012 (UTC)
 +
 +
== encrypted /boot ==
 +
 +
Just so I remember when I come back to edit the article, grub-install (2.00) currently requires the GRUB_CRYPTODISK_ENABLE environment variable be set to "y". --[[User:Buhman|Buhman]] ([[User talk:Buhman|talk]]) 05:58, 10 October 2012 (UTC)
 +
 +
== Possible mistake? ==
 +
 +
Hi there,
 +
since I do not feel familiar with Grub2 yet, you might check that:
 +
 +
[[GRUB2#Install_to_Partition_or_Partitionless_Disk]]
 +
 +
# grub-install --target=i386-pc --recheck --debug --force /dev/sdaX
 +
Should /dev/sdaX be /dev/sdX?
 +
 +
--[[User:Mrln|Mrln]] ([[User talk:Mrln|talk]]) 14:13, 1 March 2013 (UTC)
 +
: This section is about installing to partition. So it is indeed /dev/sdaX. -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 08:43, 4 March 2013 (UTC)
 +
 +
 +
--But the section does also have "Partitionless Disk" in its name, and there is the following text snippet just before the example given: "  to a partitionless disk (also called superfloppy) or to a floppy disk".
 +
I am not sure, but afaik for a Partitionless Disk the syntax given is indeed wrong (should be /dev/sdX). Not sure how the section could be reworded to make it not-confusing. Giving two separate examples runs the danger of making the whole article too bloated. [[User:Bwid|Bwid]] ([[User talk:Bwid|talk]]) 09:35, 4 March 2013 (UTC)
 +
 +
== Boot Arch iso from LVM (LVM hook in Arch iso?) ==
 +
 +
I added the following in /etc/grub.d/40_custom:
 +
 +
menuentry "archlinux-2013.03.01-dual.iso" --class iso {
 +
    insmod loopback
 +
    insmod iso9660
 +
    insmod part_gpt
 +
    insmod lvm
 +
    insmod ext2
 +
    set root='lvm/vg0-arch'
 +
    set isofile='/home/jordy/data/isos/archlinux-2013.03.01-dual.iso'
 +
    loopback loop $isofile
 +
    linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201303 img_dev=$root img_loop=$isofile earlymodules=loop
 +
    initrd (loop)/arch/boot/x86_64/archiso.img
 +
}
 +
 +
My / is on LVM, the iso boots, but it can't mount the loop device (the iso) because the LVM hook hasn't been run before that. Is there a way to fix this and enable the LVM hook in the iso (without modifying it)
 +
 +
[[User:Jordz|jordz]] ([[User talk:Jordz|talk]]) 22:34, 24 March 2013 (UTC)
 +
 +
==<s>Move to GRUB</s>==
 +
 +
I suggest we move this article to GRUB, as that is the name of the bootloader, and that page already redirects here. -- [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 16:31, 26 April 2013 (UTC)
 +
 +
: I agree, but doing this properly would require moderator intervention, because the target already exists. --[[User:Buhman|Buhman]] ([[User talk:Buhman|talk]]) 18:53, 26 April 2013 (UTC)
 +
 +
:: Agreed. I've [[User talk:Kynikos#Move request|asked a mod]]. -- [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 20:50, 26 April 2013 (UTC)
 +
 +
:::Done, the name of the bootloader doesn't include any version number, see https://www.gnu.org/software/grub/ -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 04:44, 27 April 2013 (UTC)

Revision as of 07:17, 28 April 2013

GRUB Legacy stuff should be removed

I mean, seriously, the page is loaded with too much information anyway. And also because of this: https://www.archlinux.org/news/grub-legacy-no-longer-supported/ --DSpider (talk) 17:41, 29 August 2012 (UTC)

EFI

Is there any reason why grub should be installed to /boot/efi/efi/grub and not to /boot/efi? UEFI wants to have the efi-image unter <EFI SYSTEM PARTITION>/efi/name, so /boot/efi/grub should do the trick. Additionally, mounting (e.g.) /dev/sda1 to /boot/efi and just placing the grub there will possibly conflict with having a LVM+LUKS setup, where /boot will then be encrypted. At the moment I'm running a funtoo installation on a thinkpad x121e with /dev/sda1 (200MB, fat32, sectors 1 - 201) mounted to /boot and /dev/sda2 being a LUKS encrypted system. /boot contains the bzImage and /boot/efi/boot/bootx64.efi is the grub-image.

Note: there should possibly be a section/table here containing information what firmware expects what name. having /boot/efi/grub/grub.efi didn't work for me, and as noted in the thinkwiki for an x220, /boot/efi/boot/bootx64.efi works fine. --Rochus 13:59, 16 August 2011 (EDT)


@Rochus: You have mounted your EFISYS partition at /boot ir you are using same part as both EFISYS and /boot and it is FAT32 formatted. The actual path is <EFI_SYS_PART>/efi/grub/grub.efi wherein <EFI_SYS_PART> is usually /boot/efi or in your case /boot itself.

But I do not understand your argument about mounting EFISYS at /boot/efi conflicting with LVM+LUKS. I don't have such a config in my system to understand what you are coming to say. <EFI_SYS_PART>/efi/boot/bootx64.efi is just a fallback path incase there's no boot entry in UEFI Boot Manager (see efibootmgr section). I already mentioned in the article that "If you have mounted EFISYS part at a different mountpoint, replace /boot/efi with that mountpoint in all the commands". I suppose that explains it. It is better to have /boot separate from EFISYS partition. I have /dev/sda1 as 200 MiB FAT32 EFISYS mounted at /boot/efi and /dev/sda3 as 400 MiB ext4 /boot part. For /boot/efi/grub/grub.efi to work you have to add a boot entry to grub.efi in the UEFI Boot Manager using efibootmgr utility. -- Keshav P R 23:15, 28 August 2011 (IST)

GRUB_GFXMODE may not work with a depth parameter

I'm installing on an i5 system with Intel graphics, and found that I could not get a background image if I used any depth parameter in GRUB_GFXMODE=; if I used the 0x value I got the same errors. I would get a black screen with a blue box, titled "Out of Range" and some H. Frequency and V. Frequency parameters. The boot continued in the background, and eventually I got the normal scroll of information during the boot. What I found was that if I just used a resolution, e.g., 800x600, with nothing more, it worked fine. Not sure if this is something for the wiki here or elsewhere, or something to post in the forums; but it should be somewhere to save the next person the hassle of figuring it out, I think. -- Timm 13:08, 29 October 2011 (EDT)

Custom keyboard layout

Hi. Could we add a section explaining how you can set your preferred keyboard layout within GRUB2? As i found here, we need the ckbcomp script, which can be obtained from Debian console-setup package.

Here's how I made things work:

ckbcomp it | grub-mklayout -o /boot/grub/it.gkb

Then, I manually edited /boot/grub/grub.cfg, adding the following lines:

/boot/grub/grub.cfg

terminal_input at_keyboard
keymap (hd0,2)/boot/grub/it.gkb

This worked for me, but as of now, i think it's a very dirty method. Is there some support for keyboard layouts within /etc/default/grub?

Cheers. --Hilinus 12:50, 26 December 2011 (EST)


I followed instructions on the grub-devel mailing list. First you insert

/etc/default/grub

GRUB_TERMINAL_INPUT=at_keyboard

in /etc/default/grub. Then you get ckbcomp Perl script from Ubuntu or Debian and execute (for Slovene layout)

$ ckbcomp si | grub-mklayout -o si.gkb
Unknown key KP_Comma
Unknown key KP_Comma
Unknown key KP_Comma
Unknown key KP_Comma
Unknown keycode 0x79
$ sudo mv si.gkb /boot/grub/

After that you add

/etc/grub.d/40_custom

insmod keylayouts
keymap /boot/grub/si.gkb

to /etc/grub.d/40_custom and finally generate new grub.cfg with

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

Cheers. --drevo 17:47, 6 January 2012 (EST)



The version of ckbcomp I got from Debian Squeeze kept giving this error:

Unknown name $sun_t6_custom

The Ubuntu Precise version worked out of the box.

A temporary solution for layouts would be an AUR package for ckbcomp or to distribute .gkb files somehow, but the proper solution would be for grub-mklayout to accept keymaps(5) files.

--Schizius (talk) 18:44, 26 July 2012 (UTC)

Please make the different options for changing the MBR more clear

The three options here are only separated by a bit unclear titles, and if people follow the links, they might be confused.Jasper1984 (talk) 16:03, 20 July 2012 (UTC)

Backing up grub-legacy bootcode

Both grub2 and grub-legacy write to the space between the end of the MBR and the beginning of the first partition. I'm no expert on this matter; I just learned about it today. That said, it makes me question the usefulness of the dd backup/restore method in the Backup Important Data section. --Alphaniner (talk) 20:07, 25 July 2012 (UTC)

As far as I know, only GRUB2 uses the post-MBR gap. GRUB2 will notice when there is not enough space at the post-MBR gap and return a warning message (without overwriting anything, see [[1]]) 6arms1leg (talk) 15:45, 22 August 2012 (UTC)

GRUB2 + Windows 7 TrueCrypt-encrypted partition

here is a link to my notes from my experience going thru this and Ubuntu Forum post which helped me a GREAT DEAL with this issue - below is a quick HOWTO ::

# ls -al /mnt/win7drive/Users/me/Documents/TrueCrypt\ Rescue\ Disk.iso
   -rwx------ 2 me users 1835008 Sep  5  2011 /mnt/win7/Users/me/Documents/TrueCrypt Rescue Disk.iso
# sudo cp /mnt/win7/Users/me/Documents/TrueCrypt\ Rescue\ Disk.iso /boot/
# mv /boot/TrueCrypt\ Rescue\ Disk.iso /boot/truecryptDesktop.iso
# pacman -S syslinux
# cp /usr/lib/syslinux/memdisk /boot/
# ls -alt /boot
   total 26388
   drwxr-xr-x  5 root root     4096 Jul 29 04:01 .
   -rw-r--r--  1 root root    26140 Jul 29 04:01 memdisk
   -rwx------  1 root root  1835008 Jul 29 03:59 truecryptDesktop.iso
            ....   ....
#mount | grep /boot
   /dev/sda3 on /boot type ext3 (rw,relatime,data=ordered)
# vi /etc/grub.d/40_custom

menuentry "Microsoft Windows 7 x64 Home Premium" {
   insmod part_msdos
   set root='(hd0,msdos3)'
   linux16 ($root)/memdisk iso raw
   initrd16 ($root)/truecryptDesktop.iso
}
# sudo grub-mkconfig -o /boot/grub/grub.cfg

--Fnord0 (talk) 17:59, 30 July 2012 (UTC)

grub-mkconfig with several os

I use several OS (Windows, Arch, Ubuntu, Gentoo) on different partitions. os-prober only found Arch, Windows and Ubuntu -- strangely not Gentoo. But when I mount the gentoo partition, it's found. I don't know, whether this is the case, because I resized the partition, gentoo lives on, or whether this is the `default' behaviour. If so, should the Wiki mention that mounting the partitions help?

--Skunk (talk) 19:46, 30 July 2012 (UTC)

Need simplified steps

I think GRUB2#Preliminary_Requirements_for_GRUB2 part is optional in some cases. If so, it should be noted as optional.

os-prober is quite useful, it should be put at the beginning of the articles, such as preparation.

In my case, I only did the backup, install grub-bios, install os-prober, GRUB2#Install_to_440-byte_MBR_boot_code_region, edit /etc/grub.d/40_custom, and finally grub-mkconfig. My computer is dual-boot with Windows 7.

--Allencch (talk) 00:23, 1 August 2012 (UTC)

encrypted /boot

Just so I remember when I come back to edit the article, grub-install (2.00) currently requires the GRUB_CRYPTODISK_ENABLE environment variable be set to "y". --Buhman (talk) 05:58, 10 October 2012 (UTC)

Possible mistake?

Hi there, since I do not feel familiar with Grub2 yet, you might check that:

GRUB2#Install_to_Partition_or_Partitionless_Disk

# grub-install --target=i386-pc --recheck --debug --force /dev/sdaX

Should /dev/sdaX be /dev/sdX?

--Mrln (talk) 14:13, 1 March 2013 (UTC)

This section is about installing to partition. So it is indeed /dev/sdaX. -- Fengchao (talk) 08:43, 4 March 2013 (UTC)


--But the section does also have "Partitionless Disk" in its name, and there is the following text snippet just before the example given: " to a partitionless disk (also called superfloppy) or to a floppy disk". I am not sure, but afaik for a Partitionless Disk the syntax given is indeed wrong (should be /dev/sdX). Not sure how the section could be reworded to make it not-confusing. Giving two separate examples runs the danger of making the whole article too bloated. Bwid (talk) 09:35, 4 March 2013 (UTC)

Boot Arch iso from LVM (LVM hook in Arch iso?)

I added the following in /etc/grub.d/40_custom:

menuentry "archlinux-2013.03.01-dual.iso" --class iso {

   insmod loopback
   insmod iso9660
   insmod part_gpt
   insmod lvm
   insmod ext2
   set root='lvm/vg0-arch'
   set isofile='/home/jordy/data/isos/archlinux-2013.03.01-dual.iso'
   loopback loop $isofile
   linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201303 img_dev=$root img_loop=$isofile earlymodules=loop
   initrd (loop)/arch/boot/x86_64/archiso.img

}

My / is on LVM, the iso boots, but it can't mount the loop device (the iso) because the LVM hook hasn't been run before that. Is there a way to fix this and enable the LVM hook in the iso (without modifying it)

jordz (talk) 22:34, 24 March 2013 (UTC)

Move to GRUB

I suggest we move this article to GRUB, as that is the name of the bootloader, and that page already redirects here. -- Lonaowna (talk) 16:31, 26 April 2013 (UTC)

I agree, but doing this properly would require moderator intervention, because the target already exists. --Buhman (talk) 18:53, 26 April 2013 (UTC)
Agreed. I've asked a mod. -- Lonaowna (talk) 20:50, 26 April 2013 (UTC)
Done, the name of the bootloader doesn't include any version number, see https://www.gnu.org/software/grub/ -- Kynikos (talk) 04:44, 27 April 2013 (UTC)