You are not logged in.

#1 2014-03-28 20:31:19

satchmosgroove
Member
From: Long Beach, NY
Registered: 2010-01-13
Posts: 66

[SOLVED] "smartest" partition layout for raid, lvm, uefi

I got a new board with uefi and have three 2tb disks for a htpc/fileserver build. I had a gpt layout like this on all disks before:

  1. 1 mb BIOS Boot, type ef02

  2. 100mb, type fd00, raid1 for /boot

  3. 4gb swap, type 8200

  4. all the rest, type fd00, raid5 for /, /home and /var

The idea was to be able to boot, even with one disk failing -> raid 1 for /boot.

Can I achieve the same with uefi? I can't raid the efi partition, should this be installed to sd[abc]1 then and I do swap raid5 as before? Or has the efi partition to be mounted at all times?

Any good ideas? Wiki seems to be a little incomplete/outdated or too specific for other use cases in terms of uefi/raid/lvm.

Thanks a lot in advance!

Last edited by satchmosgroove (2014-03-30 02:45:40)

Offline

#2 2014-03-28 21:36:02

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [SOLVED] "smartest" partition layout for raid, lvm, uefi

You can have a RAID 1 UEFI ESP and mount that as /boot, then use swap and "rest" as before. See this post: https://bbs.archlinux.org/viewtopic.php … 1#p1390741

Offline

#3 2014-03-28 22:39:30

satchmosgroove
Member
From: Long Beach, NY
Registered: 2010-01-13
Posts: 66

Re: [SOLVED] "smartest" partition layout for raid, lvm, uefi

wow, thanks. will try as soon as possible.

And I thought I searched before I posted :-)

Offline

#4 2014-03-30 02:55:10

satchmosgroove
Member
From: Long Beach, NY
Registered: 2010-01-13
Posts: 66

Re: [SOLVED] "smartest" partition layout for raid, lvm, uefi

Thanks again, brain0. Oder besser: Vielen Dank!

I tried today and it worked like a charm. It's so much nicer not to use Grub ;-)

Isn't that worth an update to the wiki pages? What do you think? All these uefi/raid/lvm related pages seem a little messy to me

Offline

#5 2014-03-30 23:01:25

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

Re: [SOLVED] "smartest" partition layout for raid, lvm, uefi

brain0 wrote:

You can have a RAID 1 UEFI ESP and mount that as /boot, then use swap and "rest" as before. See this post: https://bbs.archlinux.org/viewtopic.php … 1#p1390741

This might work; however:

  • The type code on the ESPs should be set appropriately for an ESP, not for Linux RAID. Some tools may not treat the ESP as such if this isn't done. In theory, an EFI might not read the partition without the ESP type code, although most (maybe all) of the ones in the field aren't that restrictive.

  • You run the risk of data corruption when the EFI, or anything else that doesn't treat the ESPs as a Linux RAID 1, writes to just one of the ESPs. This could happen if you use an EFI shell's text editor to edit a boot loader configuration file or if you save a screen shot from rEFIt or rEFInd, to name just two possible ways this could happen. There might even be a risk of problems if a file's time stamp were modified, although I don't know if this could become serious.

Personally, I don't think I'd risk this. Instead, I'd treat one ESP as the primary one and then set up a cron job or something to ensure it's kept in sync with the others.

Offline

#6 2014-03-31 02:13:07

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: [SOLVED] "smartest" partition layout for raid, lvm, uefi

srs5694 wrote:

This might work; however:
<snip>

I was curious, so I went ahead and set up my ESP as a mdadm RAID1.  On my Thinkpad E430, this works just fine.  (I only set the ESP portion up as the rest of my system runs on a btrfs raid1)

Interestingly, while setting it up, I did a wipefs on my current ESP.  But I also had to change the partition GUID for the second partition, which wouldn't take until a rebooted since it is a disk that is in use.  Without thinking, I rebooted the machine, essentially having a wiped ESP (since I killed the superblock with wipefs).  I thought this was going to cause trouble, but my machine was still able to find the ESP without issue and booted right up.  I always just assumed that it would be more sensitive than this.

Offline

#7 2014-03-31 08:19:07

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [SOLVED] "smartest" partition layout for raid, lvm, uefi

srs5694 wrote:
  • You run the risk of data corruption when the EFI, or anything else that doesn't treat the ESPs as a Linux RAID 1, writes to just one of the ESPs. This could happen if you use an EFI shell's text editor to edit a boot loader configuration file or if you save a screen shot from rEFIt or rEFInd, to name just two possible ways this could happen. There might even be a risk of problems if a file's time stamp were modified, although I don't know if this could become serious.

I was unaware that the firmware would actually permit writing to the ESP. In the original thread, I already noted that you should never try to write to the ESP from outside of Linux.

Offline

#8 2014-03-31 15:56:33

satchmosgroove
Member
From: Long Beach, NY
Registered: 2010-01-13
Posts: 66

Re: [SOLVED] "smartest" partition layout for raid, lvm, uefi

Thanks guys!
All valid points to consider while opting for this approach. This would be an acceptable obstacle, as long as it's save from any corruption from within the OS. In my case, I wouldn't touch it unless I would do a major change involving more hands-on anyway.

Offline

Board footer

Powered by FluxBB