Talk:LVM on software RAID

From ArchWiki
Latest comment: 14 June 2015 by TwoD in topic Introduction table

This article is an updated version of the Installing with Software RAID or LVM article. That page has been redirected to this page. The most recent revision of the old article can be found here.

Update mdadm.conf

The current instruction fails: the correct method is:

 # mdadm --examine --scan > /mnt/etc/mdadm.conf

I'll edit the page if a) someone can confirm it (it does work for me), and b) it should be added here or on Kynikos's page... Jasonwryan 17:23, 20 February 2012 (EST)

Hi Jason, can you explain why you believe that is the correct directory? The man page states that /etc/mdadm.conf and /etc/mdadm/mdadm.conf are the only defaults. Otherwise you would need to use the -c or --config flag. And why would you add that edit to Kynikos's User page? ~ Filam 23:37, 20 February 2012 (EST)
I recently reinstalled with Raid/LVM/LUKS and when manually updating files from outside the installer (ie, another TTY), I had to preface the directory with /mnt/ to access the correct file - I assumed it had to do with the way the installer sets up a chroot. I meant Kynikos's alternate RAID page (sorry, that wasn't clear) Jasonwryan 23:56, 20 February 2012 (EST)
I don't think it's clear yet... Maybe a link will drive away any doubt :) -- Kynikos 07:18, 21 February 2012 (EST)
Perhaps I am hallucinating: I thought you had a version of this page under development? Jasonwryan 16:21, 21 February 2012 (EST)
Do you mean the RAID article? Both articles should make note of it. Unfortunately, I don't have time to reproduce it. Am I right in assuming that reproducing it would require someone to build a new RAID using the Arch Linux installation media?
Yes: that is correct. This blog article is what tipped me off Jasonwryan 16:21, 21 February 2012 (EST)
Ok, I made a couple changes to the RAID article. Jason, can you append a paragraph to RAID#Update RAID configuration to the effect of "If you are updating the configuration file from the Arch Linux installation media you may need to ...". And then append a brief note template to Software RAID and LVM#Update RAID configuration with a link to the RAID article?
Thanks for taking the time to start a discussion section! ~ Filam 13:41, 21 February 2012 (EST)
Yes - no problem Jasonwryan 16:21, 21 February 2012 (EST)

Much adon't about [/]swap

Assumption 1: '/swap' is a horribly confused way of referring to swap space.

Assumption 2: The md1 array (and only the md1 array) is intended to be used for '/swap'.

If my assumptions are correct, I expect this guide has unwittingly led a lot of people to put their '/swap' on md0 and spread their /home across md0 and md1.

The following command does what the guide seems to intend: devote all free PEs of md1 to lvswap:

lvcreate VolGroupArray -l 100%PV /dev/md1 -n lvswap

- Alphaniner (talk) 18:43, 22 April 2013 (UTC)Reply

Hi Alphaniner, I really appreciate your input to this article. I haven't looked at this article in a while, but I believe I understand what you're talking about.
It looks like arrays are created for the swap space (md1) and root filesystem (md0), but the former is never used later in the article. Instead a swap partition is created on the VG that sits on top of md0. Is that why you would think a reader would setup the swap space on md0?
Can you explain why /home would be spread across md0 and md1? It doesn't look like md1 is added to the Volume Group or even referenced in the article after its creation (which seems to be a related issue).
~ Filam (talk) 15:54, 30 April 2013 (UTC)Reply
The wording of the article - ie. "Make the RAIDs accessible to LVM by converting them into physical volumes" and "Next step is to create a volume group (VG) on the PVs" - suggests both RAIDs are to be 'made into' PVs, and both PVs are to be 'put into' the VG. Sure, the commands don't reflect this, but they don't exclude it either. And this is Arch, after all... one can't expect one is being fed all necessary commands. OTOH, the fact that the creation of lvswap is optional contradicts this interpretation, all the way back to the creation of md1.
How ever I look at it, though, I think this article has some fundamental flaws. And I think rectifying these will involve a lot of rework. Seeing as I've never done any significant wiki-work, I figured it would be sensible to have a discussion.
- Alphaniner (talk) 18:56, 30 April 2013 (UTC)Reply
I completely agree and certainly appreciate that you started the discussion.
The question I'm left with is whether it makes sense to add the swap array to the LVM at all. The only benefit I can think of is that the user can then reduce the swap space if the RAM is upgraded. If less swap space is required then that would allow the root filesystem to use part of the swap array and then there is no separation between the swap space and the root filesystem on the disc.
And then if you ignored the LVM, does it makes sense to use a different RAID level for the swap partitions than the root partitions?
~ Filam (talk) 15:11, 1 May 2013 (UTC)Reply
I think the practical thing would be to remove all references to md1 and just describe a simple one RAID configuration, with the creation of lvswap remaining optional. Maybe the "Swap space" section could be expanded a bit to describe other ways of dealing with swap (separate array, discrete physical partitions), but I don't think even that is necessary.
-Alphaniner (talk) 19:04, 2 May 2013 (UTC)Reply
Sounds good to me. But isn't the following statement from the article valid?
"Creating the swap space on a separate array is not intended to provide additional redundancy, but instead, to prevent a corrupt swap space from rendering the system inoperable, which is more likely to happen when the swap space is located on the same partition as the root directory."
~ Filam (talk) 20:43, 2 May 2013 (UTC)Reply
I had forgotten about that. The article is the only place I'd ever heard it, so I don't know if it's true or not. If it is true - and a legitimate concern - then certainly we shouldn't be making any suggestions that would result in that. I guess this would mean either the md1 method or using physical partitions.
- Alphaniner (talk) 21:57, 2 May 2013 (UTC)Reply

Optimum RAID link now goes to paid site

Under Software_RAID_and_LVM#Prepare_hard_drive is an external link, "Optimum RAID", at, which hosted the article in HTML format until sometime in the last couple weeks. It now requires a paid subscription to view the article as PDF, which is about as far from "open source community" as it gets.  :-\ The link should probably be removed.

In its place... I dunno. Is there a good writeup elsewhere about measuring and figuring out the best stripe/width/etc mkfs parameters to use with RAID and LVM? For that matter, is it still required or is mkfs smart enough to Do The Right Thing when confronted with a device like this? Superblocked (talk) 17:43, 22 May 2013 (UTC)Reply

How about this FAQ? In general, I think that mdadm does the Right Thing to get decent performance when it's on top of LVM etc... I don't have the references right now to back that up, though. Giddie (talk) 08:50, 23 May 2013 (UTC)Reply

Introduction table

The tables describing the on-disk layout of partitions, arrays, and VGs/LVs makes little sense to me. If I understand the directions correctly, we would end up with a structure like this:

LVM Logical Volumes / /var /home Swap is optionally mirrored for safety or used as independent partitions without RAID (/dev/md1). Mirrors /boot so either disk can be booted from.
LVM Volume Groups Group 1
LVM Physical Volumes Volume 1
RAID Arrays /dev/md0 (main) /dev/md1 (swap) /dev/md2 (/boot)
Physical partitions grouped by use /dev/sda3 /dev/sdb3 /dev/sdc3 /dev/sda2 /dev/sdb2 /dev/sdc2 /dev/sda1 /dev/sdb1 /dev/sdc1

Below are physical disk structures, above are logical structures.

Partitions /dev/sda1 /dev/sda2 /dev/sda3 /dev/sdb1 /dev/sdb2 /dev/sdb3 /dev/sdc1 /dev/sdc2 /dev/sdc3
Disks /dev/sda /dev/sdb /dev/sdc

Am I correct? TwoD (talk) 17:02, 14 June 2015 (UTC)Reply