You are not logged in.

#1 2012-04-05 12:14:23

dhave
Member
Registered: 2012-04-05
Posts: 3

UEFI+GPT+GRUB2 installation

Twice in the past year I've managed to install Arch on a GPT-formatted SSD which boots via UEFI using Grub2. It wasn't easy, but I succeeded.

Now I'm faced with the same challenge, but I can't repeat my success, even though I made a few notes. I also suspect the relevant Archwiki entries may have changed a bit; either that, or I've lost more brain cells in the past year than I thought.

At any rate, I'm wondering if anyone has streamlined this process for Archbang. I normally enjoy editing config files and doing a lot of under-the-hood work when installing Arch, but right now (tax season), I just don't have the time.

Thanks.

Offline

#2 2012-04-07 09:19:58

viktor845867
Member
Registered: 2012-04-07
Posts: 2

Re: UEFI+GPT+GRUB2 installation

Okay, so i wanted to use Arch instead of Fedora, i use GPT, i always did and worked no problem on Fedora 15/GRUB 0.97
I really got anoyed that the installer didn't warn me about GPT and GRUB legacy being incompatible and i wasted allot of bandwith of what we had on a failed net install.
The Arch Wiki is a bit Vague

Basically you have to do allot of thinking.

What i have managed to do so far:
0. Use a cd with gparted to create partitions on GPT including 2MiB efi partition (i think 1MiB is enough)
1. Install of cd without grub legacy
2. After exiting installer, configure network
3. Uncomment a pacman mirror in /etc/pacman.d/mirrorlist
4.
# mount -o bind /dev /mnt/dev
# mount -t proc /proc /mnt/proc/
# mount -t sysfs /sys /mnt/sys/
# chroot /mnt bash
5. pacman-db-upgrade
6. pacman -Syy
7. attempt pacman -S grub2-efi-x86_64 but really only update pacman
8. make a newroot in chroot because pacman wont install unless it "finds mountpoints" so eg:
mkdir /mnt/newroot
mount /dev/sda3 /mnt/newroot                ##mount the root /
mount /dev/sda2 /mnt/newroot/boot        ##mount the boot /boot
mkdir /newroot/boot/efi                             ##create efi (boot partition mount point)
mount /dev/sda1 /mnt/newroot/boot/efi   ##mount efi partition (I only found out it has to be formatted vfat near the end of the guide)
etc..
9. pacman -S -r /mnt/newroot grub2-efi-x86_64
10. modprobe dm-mod
11. grub-install --directory=/usr/lib/grub/x86_64-efi --target=x86_64-efi --root-directory=/boot/efi --boot-directory=/boot --bootloader-id=arch_grub --recheck --debug
12. grub-mkconfig -o /boot/grub/grub.cfg
13. this loaded grub with just GRUB and a french c with a line on the bottom symbol, i tried to boot uefi shell but didnt find "shellx64.efi" on any partition, so:
14. cp /boot/efi/efi/arch_grub/grubx64.efi /boot/efi/shellx64.efi
15. I am able to boot the system from UEFI shell via BIOS option, yay, partial success!

This is just what i did so far but there seems to be hope now! Too late now though, i will try to do it better tommorow and post my steps.

Last edited by viktor845867 (2012-04-07 09:21:50)

Offline

#3 2012-04-07 09:23:59

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: UEFI+GPT+GRUB2 installation

Hope you do not mind, but I am moving this thread to Arch Discussions as its not really related to Archbang installation


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#4 2012-04-07 10:18:21

dhave
Member
Registered: 2012-04-05
Posts: 3

Re: UEFI+GPT+GRUB2 installation

@viktor845867: Wow! Thanks for the step-by-step. Very useful.

@Mr. Green: Sure, I understand. I'm delighted to get Viktor's how-to for Arch, but I was really asking if Archbang's installation sequence had been customized for UEFI+GPT+GRUB2 installation. There seem to be a good many people stymied by this.

Offline

#5 2012-04-07 10:35:35

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: UEFI+GPT+GRUB2 installation

It looks from the details above that you are creating the partitions and filesystems then running installer, before you drop out of installer are you checking fstab for example? Also during abinstall its a good idea to add a new user to allow mkinitcpio to run.

There maybe other routes to use 'install via arch system' or 'archbootstrap' more work setting up configs etc...

My only knowledge of GPT was from FreeNAS, not even sure of the advantages of using it [more reading to do!]


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#6 2012-04-07 21:16:24

viktor845867
Member
Registered: 2012-04-07
Posts: 2

Re: UEFI+GPT+GRUB2 installation

I got it working!!! big_smile
So...
The EFI boot partition has to be fat16 (or at least my bios can't read fat32)
once you have installed grub2 and booted from bios option the shellx64.efi (at least on newer ASUS bioses it lets you search for a EFI shell), you need to follow the efibootmgr steps and done!
basically you have to go from one guide to another and then back to the first one and skip some bits while reading other bits...

https://wiki.archlinux.org/index.php/Un … _Partition (i had to use fat16 not 32 and 1MiB is more than enough)
https://wiki.archlinux.org/index.php/GR … stallation (don't go on to 2.2.1 but do the UEFI instructions, not bios)
Don't forget:
    make a newroot in chroot because pacman wont install unless it "finds mountpoints" so eg:
    mkdir /mnt/newroot
    mount /dev/sda3 /mnt/newroot                ##mount the root /
    etc..
    and then add the -r /mnt/newroot to pacman commands
https://wiki.archlinux.org/index.php/GR … _systems_2 (Stop at Apple Mac EFI systems, pay attention to non-Apple systems just before because you need the bios to find shellx64.efi to boot from bios menu to load shell)
https://wiki.archlinux.org/index.php/GR … onfig_file
now boot via bios option to load EFI shell (next step will setup system so you don't have to do this)
https://wiki.archlinux.org/index.php/Un … efibootmgr (remember to mount the EFI partition)

I wasn't expecting to UEFI boot but this is how I managed to boot from a GPT disk.
It's pretty cool though, My bios shows "Arch Linux (GRUB2)" in the boot list now.

Last edited by viktor845867 (2012-04-07 21:25:34)

Offline

#7 2012-04-08 04:21:53

pablokal
Administrator
From: Nijmegen, Holland
Registered: 2010-10-12
Posts: 3,634
Website

Re: UEFI+GPT+GRUB2 installation

This is something for the Wiki under specific hardware solutions.
You need Admin rights to edit the TOC page though.
Will have to look into this later or somebody else of the mods who feels comfortable at the Wiki may do that.


Getting your questions answered here at ArchBang Forums
Please! Always give hardware info, if there is a chance that 's relevant: #lspci -vnn
On Arch(bang) and Openbox: http://stillstup.blogspot.com/

Offline

#8 2013-06-06 19:48:15

JCChristian
Banned
Registered: 2013-06-02
Posts: 55

Re: UEFI+GPT+GRUB2 installation

viktor845867 wrote:

I got it working!!! big_smile
So...
The EFI boot partition has to be fat16 (or at least my bios can't read fat32)
once you have installed grub2 and booted from bios option the shellx64.efi (at least on newer ASUS bioses it lets you search for a EFI shell), you need to follow the efibootmgr steps and done!
basically you have to go from one guide to another and then back to the first one and skip some bits while reading other bits...

https://wiki.archlinux.org/index.php/Un … _Partition (i had to use fat16 not 32 and 1MiB is more than enough)
https://wiki.archlinux.org/index.php/GR … stallation (don't go on to 2.2.1 but do the UEFI instructions, not bios)
Don't forget:
    make a newroot in chroot because pacman wont install unless it "finds mountpoints" so eg:
    mkdir /mnt/newroot
    mount /dev/sda3 /mnt/newroot                ##mount the root /
    etc..
    and then add the -r /mnt/newroot to pacman commands
https://wiki.archlinux.org/index.php/GR … _systems_2 (Stop at Apple Mac EFI systems, pay attention to non-Apple systems just before because you need the bios to find shellx64.efi to boot from bios menu to load shell)
https://wiki.archlinux.org/index.php/GR … onfig_file
now boot via bios option to load EFI shell (next step will setup system so you don't have to do this)
https://wiki.archlinux.org/index.php/Un … efibootmgr (remember to mount the EFI partition)

I wasn't expecting to UEFI boot but this is how I managed to boot from a GPT disk.
It's pretty cool though, My bios shows "Arch Linux (GRUB2)" in the boot list now.

So, let me see if I understood correctly:

1. Make a Live USB (MBR scheme for BIOS/UEFI system) as Archbang doesn't support USB EFI boot out-of-the-box
1.1. Put an EFI Shell in the USB for later use.

2. Make a ESP (EFI System Partition) FAT16/32 with 1MiB ~ 5MiB

3. Create, format and mount the partitions ( [/], [/home], [swap], [ESP] )

4. Add -r /mnt/newroot to pacman commands (How can I do that, I didn't understood?)

5. Start installation script, configure time/clock, skip the "Disk preparation", install the system, configure the system, skip "Bootloader install"

6. Do:

# pacman -S grub-efi-x86_64

# mkdir -p /boot/efi
# mount -t vfat /dev/sdXY /boot/efi (Not really necessary, as we have already done that in step 3)

# modprobe dm-mod
# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --recheck --debug
# mkdir -p /boot/grub/locale
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo

# grub-mkconfig -o <boot-directory>/grub/grub.cfg

7. Boot the EFI shell you put in the USB step 1

8. Do:

# modprobe efivars
# efibootmgr -c -w -d /dev/sdX -p Y -l '\EFI\grub\' -L "Arch Linux (GRUB2)"

9. Finish

-----------------------------

Please, I'm getting crazy, I need Arch. I can install the Arch ("original", not Archbang), and get it working fine, but I really don't want to configure all the Desktop Environment and Window Manager by hand, with Archbang I get what I need (Openbox + XFCE), the problem is the lack of out-of-the-box UEFI support. =/

-----------------------------

Please explains your method in greater detail. Thanks!


Dell XPS14 | Arch x64 | Gorilla Glass HD+ | i7 3517U | GT 630M | 4GB DDR3 1333Mhz | Momentus Thin (500GB) | mSATA Samsung (32GB) | Centrino Advanced-N 6235 + BT4.0
Sager NP9370 | W8 Enterprise x64 | Full HD Matte | i7 3840QM | GTX 680M SLi | 16GB DDR3 1600Mhz | Vertex 4 (256GB) | Momentus XT (750GB) | Blu-ray RW | Killer Wireless-N 1202 + BT4.0

Offline

#9 2013-06-07 10:57:11

scjet
Member
From: Canada
Registered: 2010-12-01
Posts: 1,468

Re: UEFI+GPT+GRUB2 installation

@JCChristian
If it's any consolation, I tried to follow "viktor845867"'s steps including jumping around the 6 different arch wiki links and it's been hours of failure, and confusion for me.
I can easily build a USB archbang-UEFI-LIVE (using FAT32, ...), but, for example, where does he get the need for fat16, ..., I dunno ?
I'm happy for "viktor845867" if it's working for him.

But ya, @viktor845867, please explain in "detail" if you would be so kind.  smile

Nevertheless, the good folks here at archbang are working hard at trying to build a uefi-archbang, ... it's slowly coming.

Last edited by scjet (2013-06-07 10:57:51)

Offline

#10 2013-06-07 11:06:22

JCChristian
Banned
Registered: 2013-06-02
Posts: 55

Re: UEFI+GPT+GRUB2 installation

scjet wrote:

@JCChristian
If it's any consolation, I tried to follow "viktor845867"'s steps including jumping around the 6 different arch wiki links and it's been hours of failure, and confusion for me.
I can easily build a USB archbang-UEFI-LIVE (using FAT32, ...), but, for example, where does he get the need for fat16, ..., I dunno ?
I'm happy for "viktor845867" if it's working for him.

But ya, @viktor845867, please explain in "detail" if you would be so kind.  smile

Nevertheless, the good folks here at archbang are working hard at trying to build a uefi-archbang, ... it's slowly coming.

How can you make a UEFI Live USB?

I tried Rufus to make a Live USB, and if I choose GPT Partiton for UEFI System, the program says the .ISO loaded doesn't support.

Last edited by JCChristian (2013-06-07 11:06:56)


Dell XPS14 | Arch x64 | Gorilla Glass HD+ | i7 3517U | GT 630M | 4GB DDR3 1333Mhz | Momentus Thin (500GB) | mSATA Samsung (32GB) | Centrino Advanced-N 6235 + BT4.0
Sager NP9370 | W8 Enterprise x64 | Full HD Matte | i7 3840QM | GTX 680M SLi | 16GB DDR3 1600Mhz | Vertex 4 (256GB) | Momentus XT (750GB) | Blu-ray RW | Killer Wireless-N 1202 + BT4.0

Offline

#11 2013-06-07 11:21:03

scjet
Member
From: Canada
Registered: 2010-12-01
Posts: 1,468

Re: UEFI+GPT+GRUB2 installation

Basically, I just created a FAT32 parttion of around 2 Gigs, sdx1, on a usb stick.

then -> http://bbs.archbang.org/viewtopic.php?pid=23847#p23847

But it doesn't install successfully, which is what I'm trying to do uefi-wise. The "abinstall"script tries to install standard-MBR grub2, ...,
  it's just a uefi-bootable Live-version only, of archbang-rc

Last edited by scjet (2013-06-07 11:31:31)

Offline

#12 2013-06-07 11:46:57

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: UEFI+GPT+GRUB2 installation

Anyone bothered to test new uefi iso?. Have a feeling it is not going to boot but if you get grub or whatever then will work from there. Iso also includes:

grub-efi-x86_64
gummiboot
refind-efi
gptfdisk

Of course abinstall will not install bootloader out of the box. Would rather get iso booting first....


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#13 2013-06-07 11:52:07

scjet
Member
From: Canada
Registered: 2010-12-01
Posts: 1,468

Re: UEFI+GPT+GRUB2 installation

Yes, it boots Live, and in UEFI, but I had to create a FAT32 2gig partition on a usb stick, ...,  copy  the loop mounted AB-rc-uefi iso over to this usb fat32 partition, as mentioned above and elsewhere, for it to boot in uefi mode.
I mean, it could also be a 1Gig fat32 parttion on the usb stick, it doesn't really matter.

Last edited by scjet (2013-06-07 11:55:51)

Offline

#14 2013-06-07 12:00:55

scjet
Member
From: Canada
Registered: 2010-12-01
Posts: 1,468

Re: UEFI+GPT+GRUB2 installation

Mr Green wrote:

Anyone bothered to test new uefi iso?. Have a feeling it is not going to boot but if you get grub or whatever then will work from there. Iso also includes:

grub-efi-x86_64
gummiboot
refind-efi
gptfdisk

Of course abinstall will not install bootloader out of the box. Would rather get iso booting first....


maybe also include the "efibootmgr" package as well, if it's not included already. ?

Last edited by scjet (2013-06-07 12:01:16)

Offline

#15 2013-06-07 12:13:21

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: UEFI+GPT+GRUB2 installation

pacman -Q | grep efi
efibootmgr 0.6.0-3
grub-efi-x86_64 2.00-1
refind-efi 0.6.11-1

Oh yeah.....

@scjet its odd you had to create fat part. I just dd'ed iso to usb .... part of build script has....


make_efiboot() {
    mkdir -p ${work_dir}/iso/EFI/archiso
    truncate -s 31M ${work_dir}/iso/EFI/archiso/efiboot.img
    mkfs.vfat -n ARCHISO_EFI ${work_dir}/iso/EFI/archiso/efiboot.img

Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#16 2013-06-07 12:24:53

scjet
Member
From: Canada
Registered: 2010-12-01
Posts: 1,468

Re: UEFI+GPT+GRUB2 installation

According to this, as I mentioned: https://wiki.archlinux.org/index.php/Un … B_from_ISO
that's basically it, except I simply substituted the official_Arch_201306 media/iso with your latest archbang-rc-uefi iso,.... and it boots Live, fine.

Unfortunately, it's seems to be the present "UEFI" mentality, depending on your hardware manufacturer,  that searches bootable media for only the "fat32/fat16" partition crap. It's almost like we have to go backwards in time, technologically speaking, just for this UEFI shit in Linux to work ?!

If UEFI is supposed to be an opensource standard of some sorts, like certain folk say,  then why is LINUX way behind the times with this. why fat16/32 dependability here. ?!
Why not ext*, ???, in other words the filesystems should be more transparent.
mmm oh ya, I forgot, Microsoft/Windows still controls everybody -hehehe, and hardware robots/puppets from "Asus to -> Zoltran" simply follow the leader, sadly enough for us.
  What a f__K_n joke.!
I'm sorry, but I absolutely H8 Windows/M$  sad

Also, this usb-created archbang-rc-uefi boots from both UEFI, or standard MBR-Legacy-Bios.
I'm posting this with it right now. by booting live with both either uefi enabled, Or disabled.

Needless to say, this is just the tip of the iceberg for you, but it's definitely scriptable.
wink

Last edited by scjet (2013-06-07 12:46:56)

Offline

#17 2013-06-07 12:50:33

scjet
Member
From: Canada
Registered: 2010-12-01
Posts: 1,468

Re: UEFI+GPT+GRUB2 installation

Mr Green wrote:
@scjet its odd you had to create fat part. I just dd'ed iso to usb .... part of build script has....

ya but juist dd'ing your AB-rc-uefi iso to a usb drive isn't enough, it doesn't boot via uefi.

That script of yours is looking better though, slowly.

Last edited by scjet (2013-06-07 12:54:21)

Offline

#18 2013-06-07 12:50:46

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: UEFI+GPT+GRUB2 installation

The laptop I bought has a secure boot option [which I disabled] strange it states at top of settings screen the word BIOS!!!! with secure boot turned off arch media started but then got kernel panic. This time I FATed the usb drive first to fat32 as per wiki. Not tried archbang-uefi yet.

What was bothering me is does it boot syslinux [archbang boot menu] or grubby?

I have scanned wiki on grub and you could write a script to do the job.. but there are so many options.

Anyway one step at a time....


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#19 2013-06-07 13:28:52

JCChristian
Banned
Registered: 2013-06-02
Posts: 55

Re: UEFI+GPT+GRUB2 installation

Thanks for mentioning [archbang-rc-uefi-07.06.2013-x86_64], I didn't know that an UEFI .ISO existed. Now I can easily create a Live USB using Rufus:

> GPT Partition for UEFI System
> FAT32

Boot without problems in UEFI mode on my XPS 14 (They changed the default theme =p).

Reading this topic I came to conclusion that using the default installer, you get a MBR Partition, no matter if you have formatted it in GPT before, right? So, is there a way to make a "custom install": format, partition, mount, by hand and the rest using the installer?

----------

My partition scheme would be:

500GB HDD
/dev/sda1 = swap (8GB)
/dev/sda2 = /home (492GB)

32GB mSATA
/dev/sdb1 = ESP (256MB)
/dev/sdb2 = / (~31.7GB)

A good partition scheme, or is there a flaw in my thinking?

Last edited by JCChristian (2013-06-07 13:32:52)


Dell XPS14 | Arch x64 | Gorilla Glass HD+ | i7 3517U | GT 630M | 4GB DDR3 1333Mhz | Momentus Thin (500GB) | mSATA Samsung (32GB) | Centrino Advanced-N 6235 + BT4.0
Sager NP9370 | W8 Enterprise x64 | Full HD Matte | i7 3840QM | GTX 680M SLi | 16GB DDR3 1600Mhz | Vertex 4 (256GB) | Momentus XT (750GB) | Blu-ray RW | Killer Wireless-N 1202 + BT4.0

Offline

#20 2013-06-07 13:38:53

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,920

Re: UEFI+GPT+GRUB2 installation

Open a terminal [in archbang live] and run 'sudo abinstall -h' might be an option that will help. gptdisk is included and grubby stuff [see post #15].... swap what is that? wink


Comments, suggestions please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#21 2013-06-07 13:46:58

JCChristian
Banned
Registered: 2013-06-02
Posts: 55

Re: UEFI+GPT+GRUB2 installation

Mr Green wrote:

Open a terminal [in archbang live] and run 'sudo abinstall -h' might be an option that will help. gptdisk is included and grubby stuff [see post #15].... swap what is that? wink

Didn't I need SWAP Partition, even if I only have 4GB RAM? (I intend to upgrade to 8GB later, but 4GB is enough by now).

UPDATE:

I'm trying to install like this:

1. Format using mkfs.ext4 -> / and /home ||| mkfs.vfat -F32 -> ESP
2. Make and active swap
3. Mount the disks in /mnt/install -> / ||| /mnt/install/home -> /home ||| /mnt/install/boot/efi -> ESP
4. Click "Install system" in the installer

I noticed that Archbang automatically put Gummiboot in the /mnt/install/boot/EFI folder, so I did: # gummiboot install --path=/mnt/install/boot/efi (because I mounted the ESP here)

But when I check /etc/fstab, it's empty, why?

------------------

Another thing: If I do # pacman -Syyu from Live USB, I get "error: failed to update {core / extra / community} (no servers configured for repository)", why? (Internet fully working, ethernet)

Fixed: I forgot to uncomment the servers. ¬¬

Last edited by JCChristian (2013-06-07 21:28:22)


Dell XPS14 | Arch x64 | Gorilla Glass HD+ | i7 3517U | GT 630M | 4GB DDR3 1333Mhz | Momentus Thin (500GB) | mSATA Samsung (32GB) | Centrino Advanced-N 6235 + BT4.0
Sager NP9370 | W8 Enterprise x64 | Full HD Matte | i7 3840QM | GTX 680M SLi | 16GB DDR3 1600Mhz | Vertex 4 (256GB) | Momentus XT (750GB) | Blu-ray RW | Killer Wireless-N 1202 + BT4.0

Offline

Board footer

Powered by FluxBB