You are not logged in.

#1 2013-03-06 20:17:49

3000
Member
Registered: 2013-01-18
Posts: 44

[Solved] confused about lvm uefi partition requirements

Hi guys, I want to install arch on an uefi board. I am confused about the partitioning.

I know I need a uefi system partition with a size of at least 512 mb. Will grub be installed on this partition? Or do I need a seperate boot partition?
I want to use lvm.  Everything should reside in one lvm partition - including boot. So how many partitions will I need within lvm?

root, home, uefi AND boot or just root, home and uefi?
I don't need more than root and home. Any other partition I will create is solely for the purpose of getting the system started.

Really confused about this. Couldn't make grub2 start arch without usb or cd ...

thanks in advance

3000

Last edited by 3000 (2013-05-19 22:46:41)

Offline

#2 2013-03-06 20:28:23

s1ln7m4s7r
Member
Registered: 2013-02-22
Posts: 262

Re: [Solved] confused about lvm uefi partition requirements

U can use whatever partitioning scheme you wan't just as you would do in a non uefi system.

The only difference is that you must create a 512 m minimum efi partition formatted in fat32 and then mount it in /boot/efi.

Then you can use one of these efi bootloaders

https://wiki.archlinux.org/index.php/UEFI_Bootloaders (For myself i realy like refind)

Last edited by s1ln7m4s7r (2013-03-06 20:34:05)

Offline

#3 2013-03-06 21:58:09

3000
Member
Registered: 2013-01-18
Posts: 44

Re: [Solved] confused about lvm uefi partition requirements

thanks for the reply, I still don't get it.

Do I need  an efi partition AND boot partition or do I need just the efi partition?

Offline

#4 2013-03-06 22:27:10

s1ln7m4s7r
Member
Registered: 2013-02-22
Posts: 262

Re: [Solved] confused about lvm uefi partition requirements

You don't have to. You can create a Logical volume for / and then create the folder /root/efi.

Then you mount the efi partition under /boot/efi

EDIT: Don't forget you will have to ad some things to your mkinitcpio.conf so lvm can work!

Dont't forget to read this:


https://wiki.archlinux.org/index.php/LVM#Introduction

Last edited by s1ln7m4s7r (2013-03-06 22:31:44)

Offline

#5 2013-03-07 00:18:10

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: [Solved] confused about lvm uefi partition requirements

I think your EFI partition must be outside the lvm. As far as I know, you cannot include that partition in the lvm itself because the firmware needs to find the ESP and it will not know about lvm and such.

/boot can just be a sub-directory of / in the lvm. (Assuming you are not encrypting the disk, of course.)


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#6 2013-03-07 01:23:19

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [Solved] confused about lvm uefi partition requirements

3000 wrote:

Do I need  an efi partition AND boot partition or do I need just the efi partition?

The answer is: It depends.

To clarify, you must understand what's going on. The EFI System Partition (ESP) is a partition that's readable by the firmware and that contains one or more boot loader programs. Several such programs are available that can launch Linux kernels. Much of the "it depends" factor derives from the fact that these programs have differing capabilities about from where they can load Linux kernels. Some (such as the kernel's built-in EFI stub loader and ELILO) read the kernel via EFI system calls, so the kernel must be on an EFI-readable partition. This is normally the ESP, or at least a FAT partition, but with the help of EFI filesystem drivers, ext2/3/4fs and ReiserFS are also options. Others (namely Fedora's patched GRUB Legacy and GRUB 2) include their own filesystem drivers and so can read the kernel from more locations. Currently, only GRUB 2 can read a kernel from within an LVM or RAID setup. What's more, some boot managers (such as gummiboot) can only load kernels from the partition from which they themselves were launched. This all adds up to a complex set of capabilities and limitations.

To further complicate matters, you can mount the ESP at /boot, in which case the ESP is your Linux /boot partition.

Taking this all together, you can see that the either/or distinction you've presented isn't nearly as simple as you'd no doubt hoped it was. You could set your system up in any number of ways. For maximum choice in the future, I recommend this:

  • A 512MiB ESP (FAT32, type code EF00 in gdisk or with the "boot flag" set in parted)

  • A 512MiB partition that you can use as /boot, should you so decide

  • One or more LVM partitions ("more" can be useful if you decide to dual-boot in the future; you can remove just one partition from the volume group to make room for the new OS)

Given today's disk sizes, 512MiB is a small enough space that it's easily sacrificed, should you end up not using it -- or you can add it to the LVM configuration in the future, if you get really tight on space. You might use a separate, Linux-only /boot partition for various reasons, such as if you're dual-booting and you want to make accidental damage to your kernels from another OS less likely, or if you're using kernel maintenance practices that make use of symbolic links or other Linux-style filesystem features on /boot. You could leave /boot as a normal directory in your LVM-resident root (/) partition if you're using GRUB 2 to boot the computer or if you don't mind copying your kernel from /boot to /boot/efi (where you'd probably mount the ESP in this scenario) with every kernel upgrade. (Personally, on an EFI system, I'd want /boot outside of any LVM setup so as to simplify the setup while maximizing my choice of boot loaders.)

Offline

#7 2013-03-07 18:26:25

3000
Member
Registered: 2013-01-18
Posts: 44

Re: [Solved] confused about lvm uefi partition requirements

thanks for all answers,
as I understand, it's a choice I have.

I encountered a problem while formatting ESP. This is what I get when executing the command "mkfs.fat32 -F /dev/mapper/lvm-lvmboot":

"unable to get drive geometry, using default 255/63"

this means, it's not formatted correctly, right?

Offline

#8 2013-03-07 18:48:29

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [Solved] confused about lvm uefi partition requirements

3000 wrote:

I encountered a problem while formatting ESP. This is what I get when executing the command "mkfs.fat32 -F /dev/mapper/lvm-lvmboot":

"unable to get drive geometry, using default 255/63"

this means, it's not formatted correctly, right?

The FAT filesystem is probably OK, but you did not create it on an ESP. You created it on a logical volume within your LVM, but the ESP is a partition, not a logical volume. The EFI doesn't understand LVM, so it won't be able to read anything off a FAT filesystem on a logical volume. You must create the ESP as a GPT partition.

Offline

#9 2013-03-07 19:13:31

3000
Member
Registered: 2013-01-18
Posts: 44

Re: [Solved] confused about lvm uefi partition requirements

so ESP MUST be OUTSIDE of lvm???

Offline

#10 2013-03-07 22:59:03

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: [Solved] confused about lvm uefi partition requirements

cfr wrote:

I think your EFI partition must be outside the lvm. As far as I know, you cannot include that partition in the lvm itself because the firmware needs to find the ESP and it will not know about lvm and such.

And what srs5694, who is the expert, said.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#11 2013-03-08 09:22:08

3000
Member
Registered: 2013-01-18
Posts: 44

Re: [Solved] confused about lvm uefi partition requirements

thanks a lot guys, I will try that. Two partitions. One ESP with 512 MB and one lvm with root and home. I don't think I need more because I am planning to install XEN HVM and on top of that Windows 8, so I won't need a dual boot.

I have been using arch for almost two years now and thanks to the excellent wiki & forum I never needed to actually ask for any help myself.

thanks for enlighten me. I am sure, I will need your help again though ... wink

Offline

#12 2013-03-12 13:16:31

3000
Member
Registered: 2013-01-18
Posts: 44

Re: [Solved] confused about lvm uefi partition requirements

ok, I still couldn't manage to start up my system.

This is what I did:

1. create two partitions with with gdisk:

one UEFI System Partition (EF00) at /dev/sda1 and format with mkfs.vfat -F32 /dev/sda1
one LVM partition (8E00) at dev/sda2:

I created two logical volumes. /dev/mapper/VG-lvm_root and /dev/mapper/VG-lvm_home and formatted them with mkfs.ext4 /dev/mapper/VG-lvm_*

2. now I first mounted root with mount /dev/mapper/VG-lvm_root /mnt then mount /dev/mapper/VG-lvm_home /mnt/home

Now I am getting confused again.

I mounted dev/sda1 with:  mount /dev/sda1 /mnt/boot/efi

is this correct?

3. I chroot into system with arch-chroot /mnt and configured the base system

4. Install and configure a bootloader: grub2 for me (since I will use XEN)

This is where I am getting lost, but I  did this according to grub2 wiki:

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

5. I Generated GRUB2 UEFI Config file

with: grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg

6. finally I exit chroot and unmount /mnt/boot/efi, mnt/home and /mnt


My system fails to start, no bootloader is found. I am sure, I am doing a rookie mistake. I just coudn't figured out with one(s).

I guess it must have something to do with unmounting the efi partition or generating the grub2 config file incorrectly. (maybe the location is wrong, I don't know ...)

Hope you can help me

Last edited by 3000 (2013-03-12 13:23:09)

Offline

#13 2013-03-12 21:50:06

s1ln7m4s7r
Member
Registered: 2013-02-22
Posts: 262

Re: [Solved] confused about lvm uefi partition requirements

Does grub2 menu entry appears on the UEFI boot manager?

As of grub-efi-x86_64 version 2.00, grub-install automatically tries to create a menu entry in the boot manager. If it doesn't, then see Beginners' Guide#GRUB for instructions to use efibootmgr to create a menu entry. However, the problem is likely to be that you haven't booted your CD/USB in UEFI mode

https://wiki.archlinux.org/index.php/Be … Guide#GRUB

Last edited by s1ln7m4s7r (2013-03-12 21:51:35)

Offline

#14 2013-03-12 23:29:33

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: [Solved] confused about lvm uefi partition requirements

You need to modprobe efivars as well as dm-mod. (In fact, I never seem to need to modprobe the latter for some reason but I always need to modprobe the former.)

Assuming you are booted in EFI mode, you just then regenerate grub.cfg and it will take care of things automatically. If you are not, it won't work as s1ln7m4s7r says. But it is at least worth trying the modprobe first because otherwise it won't work whether you are booted in EFI mode or not!


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#15 2013-03-13 18:16:25

3000
Member
Registered: 2013-01-18
Posts: 44

Re: [Solved] confused about lvm uefi partition requirements

I did the modprobe efivars and dm-mod. The thing is, UEFI boot manager doesn't even show up. All I get is "no bootable device is detected" when I turn on my pc.

Offline

#16 2013-03-13 20:06:14

s1ln7m4s7r
Member
Registered: 2013-02-22
Posts: 262

Re: [Solved] confused about lvm uefi partition requirements

3000 wrote:

I did the modprobe efivars and dm-mod. The thing is, UEFI boot manager doesn't even show up. All I get is "no bootable device is detected" when I turn on my pc.

Are you sure you are running in uefi mode?

Also, check in uefi settings page if there appears the grub extra menu entry!!!

If nothing appears, then its because generating the grub uefi config failed. That takes me to the same question:

Does grub2 menu entry appears on the UEFI boot manager?
As of grub-efi-x86_64 version 2.00, grub-install automatically tries to create a menu entry in the boot manager. If it doesn't, then see Beginners' Guide#GRUB for instructions to use efibootmgr to create a menu entry. However, the problem is likely to be that you haven't booted your CD/USB in UEFI mode
https://wiki.archlinux.org/index.php/Be … Guide#GRUB

Offline

#17 2013-03-13 20:21:18

3000
Member
Registered: 2013-01-18
Posts: 44

Re: [Solved] confused about lvm uefi partition requirements

this is how I enabled uefi: In bios I enabled UEFI BOOT and disabled LEGACY BOOT.
Then just before I started the installation process, I run command: modprobe efivars. Then I tested it with ls -1 /sys/firmware/efi/vars/
and I got a huge list.

Is there anything more I need to do to enable UEFI mode? How do I get to the uefi settings page to check if a grub extra menu entry appears?

And did I do everything correctly in those 6 points I mentioned in my post before?

Last edited by 3000 (2013-03-13 20:22:32)

Offline

#18 2013-03-13 20:31:00

3000
Member
Registered: 2013-01-18
Posts: 44

Re: [Solved] confused about lvm uefi partition requirements

and just in case, this is my fstab:

#
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
# /dev/mapper/VG-lvm_root
UUID=345b3fd-edfa-440f-ad40-04u5d0f53d92       /               ext4            rw,relatime,data=ordered        0 1

# /dev/mapper/VG-lvm_home
UUID=250380g9-re90-8c75-8a41-484ec71a2427       /home           ext4            rw,relatime,data=ordered        0 2

# /dev/sda1
#UUID=52B0-6H3W         /boot/efi       vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,
#iocharset=iso8859-1,shortname=mixed,errors=remount-ro$

UUID=52B0-6H3W          /boot/efi       vfat            noatime 0 2

Last edited by 3000 (2013-03-13 20:31:50)

Offline

#19 2013-03-13 20:34:36

s1ln7m4s7r
Member
Registered: 2013-02-22
Posts: 262

Re: [Solved] confused about lvm uefi partition requirements

this is how I enabled uefi: In bios I enabled UEFI BOOT and disabled LEGACY BOOT.
Then just before I started the installation process, I run command: modprobe efivars. Then I tested it with ls -1 /sys/firmware/efi/vars/
and I got a huge list.

I don't fully understand: Does this mean that you ran the arch install media cd in uefi mode? Did you ran the cd directly or did you create an UEFI bootable USB from ISO?

Offline

#20 2013-03-13 20:38:33

swordfish
Member
Registered: 2012-01-14
Posts: 160

Re: [Solved] confused about lvm uefi partition requirements

3000 wrote:

this is how I enabled uefi: In bios I enabled UEFI BOOT and disabled LEGACY BOOT.
Then just before I started the installation process, I run command: modprobe efivars. Then I tested it with ls -1 /sys/firmware/efi/vars/
and I got a huge list.

Is there anything more I need to do to enable UEFI mode?

No, should be ok.

3000 wrote:

And did I do everything correctly in those 6 points I mentioned in my post before?

This looks good, too. Are you able to chroot into your system using the Arch-ISO you've created? If yes, after running "modprobe efivars" could you please give us the output of

# efibootmgr -v

and

# lsblk

Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)

Offline

#21 2013-03-13 20:40:07

3000
Member
Registered: 2013-01-18
Posts: 44

Re: [Solved] confused about lvm uefi partition requirements

yes, I ran the CD directly with the latest arch on it. Then I loaded efivars and installed the system, this is what I understood from the wiki, is this wrong?

Offline

#22 2013-03-13 20:42:25

s1ln7m4s7r
Member
Registered: 2013-02-22
Posts: 262

Re: [Solved] confused about lvm uefi partition requirements

3000 wrote:

yes, I ran the CD directly with the latest arch on it. Then I loaded efivars and installed the system, this is what I understood from the wiki, is this wrong?

Its OK! I just did not understood your early statement!

Offline

#23 2013-03-13 20:43:42

3000
Member
Registered: 2013-01-18
Posts: 44

Re: [Solved] confused about lvm uefi partition requirements

Yes, I am able to chroot into the system,

here is the output of efibootmgr -v:

BootCurrent: 000D
Timeout: 1 seconds
BootOrder: 000D,000E,0000,0004,0009,0003,0007,000C,0000,0002,0006,000A,000B,0008,0000
Boot0000* rEFInd        Vendor(99e275e7-75a0-4b37-a2e6-c5385e6c00cb,)
Boot0001  UEFI : USB : Intenso Rainbow Line 8.07 : PART 0 : OS Bootloader       ACPI(a0341d0,0)PCI(1a,0)USB(1,0)USB(1,0)HD(1,800,1de1800,f45da21c)AMBO
Boot0002* rEFInd        Vendor(99e275e7-75a0-4b37-a2e6-c5385e6c00cb,)
Boot0003* Arch Linux (GRUB)     Vendor(99e275e7-75a0-4b37-a2e6-c5385e6c00cb,)
Boot0004* Arch Linux (GRUB)     Vendor(99e275e7-75a0-4b37-a2e6-c5385e6c00cb,)
Boot0005* rEFInd        Vendor(99e275e7-75a0-4b37-a2e6-c5385e6c00cb,)
Boot0006* rEFInd        Vendor(99e275e7-75a0-4b37-a2e6-c5385e6c00cb,)
Boot0007* rEFInd        Vendor(99e275e7-75a0-4b37-a2e6-c5385e6c00cb,)
Boot0008* arch_grub     Vendor(99e275e7-75a0-4b37-a2e6-c5385e6c00cb,)
Boot0009* Arch Linux (GRUB)     Vendor(99e275e7-75a0-4b37-a2e6-c5385e6c00cb,)
Boot000A* Arch Linux (GRUB)     Vendor(99e275e7-75a0-4b37-a2e6-c5385e6c00cb,)
Boot000B* rEFInd        Vendor(99e275e7-75a0-4b37-a2e6-c5385e6c00cb,)
Boot000C* Arch Linux (GRUB)     Vendor(99e275e7-75a0-4b37-a2e6-c5385e6c00cb,)
Boot000D* UEFI : USB : TSSTcorpBDDVDW SE-506AB TS01 : PART 1 : OS Bootloader    ACPI(a0341d0,0)PCI(1a,0)USB(1,0)USB(1,0)CD-ROM(1,1db3f,f800)AMBO
Boot000E* UEFI : USB : TSSTcorpBDDVDW SE-506AB TS01     ACPI(a0341d0,0)PCI(1a,0)USB(1,0)USB(1,0)Vendor(ba7c46d1-9c5e-4fc8-943d-1a491f23fe01,00ea03000003ea0022001300000000000013000800000000080071030107020900020000010000010100415243485f323031333033202020202020202020202020202020202020202020)AMBO

Last edited by 3000 (2013-03-13 20:45:26)

Offline

#24 2013-03-13 20:44:20

3000
Member
Registered: 2013-01-18
Posts: 44

Re: [Solved] confused about lvm uefi partition requirements

lsblk:

sh-4.2# lsblk
NAME                     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                        8:0    0  59.6G  0 disk
ââsda1                     8:1    0   512M  0 part /boot/efi
ââsda2                     8:2    0  59.1G  0 part
  ââVG-lvm_root (dm-1)   254:1    0    19G  0 lvm  /
  ââVG-lvm_home (dm-2)   254:2    0  40.1G  0 lvm  /home
sr0
sh-4.2#
sh-4.2#
sh-4.2# lsblk
NAME                     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                        8:0    0  59.6G  0 disk
ââsda1                     8:1    0   512M  0 part /boot/efiO10000010100415243485
ââsda2                     8:2    0  59.1G  0 part
  ââVG-lvm_root (dm-1)   254:1    0    19G  0 lvm  /
  ââVG-lvm_home (dm-2)   254:2    0  40.1G  0 lvm  /home
sr0                       11:0    1   4.4G  0 rom
loop0                      7:0    0 216.2M  1 loop
loop1                      7:1    0   1.4G  1 loop
ââarch_root-image (dm-0) 254:0    0   1.4G  0 dm   /etc/resolv.conf
loop2                      7:2    0   1.4G  0 loop
ââarch_root-image (dm-0) 254:0    0   1.4G  0 dm   /etc/resolv.conf

Offline

#25 2013-03-13 20:50:12

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 19,379
Website

Re: [Solved] confused about lvm uefi partition requirements

Please use code tags when you paste to the boards:
https://wiki.archlinux.org/index.php/Fo … s_and_Code


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB