Difference between revisions of "Talk:Software RAID and LVM"

From ArchWiki
Jump to: navigation, search
(Installation image: re)
(Archive old sections, add note template)
Line 1: Line 1:
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 [https://wiki.archlinux.org/index.php?title=Installing_with_Software_RAID_or_LVM&oldid=154628 here].
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 [https://wiki.archlinux.org/index.php?title=Installing_with_Software_RAID_or_LVM&oldid=154628 here].
== Performance of Swap Array ==
{{note|Numerous sections on this talk page were archived to [[/Archive 1]] on May 22, 2012.}}
It was pointed out here:
that software RAIDing your swap is not useful, and even slows performance.
: I added a title to the above comment by [[User:Jstech|Jstech]] on [https://wiki.archlinux.org/index.php?title=Talk:Installing_with_Software_RAID_or_LVM&oldid=5390 1 November 2005]. Although, the above link is broken, it is supported by the [http://en.gentoo-wiki.com/wiki/RAID/Software#Create_the_Swap_Partition Gentoo Wiki article]. This is a reminder to make a note of it in the article. ~ [[User:Filam|Filam]] 22:09, 29 August 2011 (EDT)
== bug in /etc/rc.sysinit?? ==
I think there is a problem with /etc/rc.sysinit as it not loads the module for the device mapper. This is lvm specific. I just modified the file like this:
if [ "$USELVM" = "yes" -o "$USELVM" = "YES" ]; then
if [ -f /etc/lvmtab -a -x /sbin/vgchange ]; then
    # Kernel 2.4.x, LVM1 groups
    stat_busy "Activating LVM1 groups"
    /sbin/vgchange -a y
  elif [ -x /sbin/lvm -a -d /sys/block ]; then
    # Kernel 2.6.x, LVM2 groups
    stat_busy "Activating LVM2 groups"
    /sbin/modprobe dm_mod # <<-----Here is my change
    /sbin/lvm vgscan --ignorelockingfailure
    /sbin/lvm vgchange --ignorelockingfailure -a y
i use the standard arch kernel
== What about root on LVM ? ==
I can't figure out how to make it...
mkinitrd variable LVM_ROOT= what to set here??
i am using grub and partition is like this:
  /dev/sda1 ext2 /boot
  /dev/sda2 LVM
        vg_name: linux
        lv_name:    system  /    ext3
                      home  /home ext3
                      swap  none  sw
I've tryed
grub kernel ... root=/dev/mapper/linux-system or root=/dev/linux/system
i have USELVM=YES and in initrd LVM is enabled...
lvm partitions was made with lvm2 - but i can activate and mount them manually
where am i wrong??? -
still blocked in bussybox with err - can't mount root - or so... or can't switch [don't remember] -
lvm partitions are disabled - i have to enable and mount them manually
--[[User:Suw|Suw]] 06:24, 8 April 2006 (EDT)
:The topic of how to stack LVM and RAID is covered in [http://serverfault.com/questions/217666/what-is-better-lvm-on-raid-or-raid-on-lvm What is better LVM on RAID or RAID on LVM?] on [[Wikipedia:Server Fault|Server Fault]]. I added a link to the resource section earlier today. ~ [[User:Filam|Filam]] 22:12, 29 August 2011 (EDT)
== Lousy guide ==
This has to be the worst, most crappy designed guide i have seen in all of my time with OpenSource, restructure this thing, and strip the old stuff for 7.1, it is VERY outdated. I must say that i would feel more confident just jumping head on out into raid on my own, than following this guid, get som structure in it. --[[User:Kbutcher5|Kbutcher5]] [https://wiki.archlinux.org/index.php?title=Talk%3AInstalling_with_Software_RAID_or_LVM&action=historysubmit&diff=23700&oldid=11010 13:23, 4 May 2007]
:I did an install today and used this guide as a guideline, next to my common sense and other documentation on the mighty internet. Looking at this guide from an abstract point of view one will find that the principles are still the same. Going into basic details, you'll also get the gist. But several specifics are inaccurate and the overall structure could be improved. The guidance goes flaky once you get to the "Install and Configure Arch" part and beyond. Because it is so outdated.
:That's where I had to use outside sources and apply my own knowhow to get the system running.
:Perhaps i'll edit some bits here and there to patch it up a little. I have a general idea of what I did to get it right. And i'll enter a new GRUB example, because the kernel with the mdadm hook can detect arrays, or get it right by reading /etc/mdadm.conf. --[[User:Ultraman|Ultraman]] 2:47, 3 May 2009 (CEST)
::I added a signature to [[User:Kbutcher5|Kbutcher5]]'s original comment and formatted [[User:Ultraman|Ultraman]]'s post to reflect the fact that it was a response to ''Kbutcher5''. More importantly, I wanted to note that it is important to contribute to the article. If we don't contribute it will remain outdated. Even if you don't have time to make numerous edits, at least leave a link to a better tutorial or guide in the [[Installing with Software RAID or LVM#Additional Resources|Additional Resources]] setion. ~ [[User:Filam|Filam]] 22:22, 29 August 2011 (EDT)
== rebuild from chroot to avoid getting dropped to ramfs after grub install ==
for some reason the initcpio was not giving me my raid volumes after i tried to boot into the new system as instructed by the article.  this problem went away after i used the install cd to boot, loaded raid1, raid5, and dm_mod modules manually, assembled arrays, activated the volume group, mounted the partitions, chrooted into the new system and rebuilt kernel26 (and therefore the initcpio).  notably, i needed to mount /sys in addition to /proc and /dev prior to chrooting in order to get this to work.  i only mention this because it seems like this article and several others omit /sys as a source of device files when instructing users to chroot.  assuming that grub desires some access to devices when installing, i am wondering why only /proc and /dev are sufficient in the example outlined in the article but not in my case?
NB- in the course of my troubleshooting i added definition of the raid1 array on which my / is located to the kernel line in menu.lst and i can say that this alone is insufficient to confer bootability to the installation as defined in the article.  i have not tried my configuration without this (it shouldn't be necessary with the mdadm hook in mkinitcpio.conf)
--[[User:Poopship21|Poopship21]] 21:24, 28 June 2009 (EDT)
== The "mdadm"  approach doesn't work well with raid0 ==
Note that loading the "mdadm" hook doesn't always work with raid0. I've found out the hard way that this wiki just isn't complete.
I had to load the "raid"  hook instaid of the "mdadm" hook and had to load it ''before'' autodetect for it to work, like so:
HOOKS="base udev raid autodetect pata scsi sata filesystems"
I puzzled this together by combining the wiki together with a "how to set up RAID during installation" guide I found on the ARCH forums.
I had to do this in a chroot and only really used the setup for the packages.
--[[User:Thajan|Thajan]] 13:07, 24 July 2009 (EDT)
I had a similar problem with RAID1. This page says that the "old style" requires kernel parameters, but nowadays it doesn't. As of 2010.05, I still need a kernel line like
kernel /vmlinuz26 root=/dev/md3 ro md=1,/dev/sda1,/dev/sdb1 md=3,/dev/sda3,/dev/sdb3
to get it to boot, even though the mdadm hook is in /etc/mkinitcpio.conf.
More info here: http://www.linuxquestions.org/questions/showthread.php?p=4147009
--[[User:MALDATA|MALDATA]] 10:44, 02 November 2010 (CST)
== Migrating from PATA w/o RAID to SATA with Software RAID (mdadm) ==
After recreating the /dev nodes (null, console and random), tried to set up a software raid0 with two SATA disks.
It was a ''royal pain in the ass'', but playing around with hooks, what really worked was:
HOOKS="base udev sata mdadm filesystems autodetect".
Note the order: sata '''before''' mdadm, not after (as is said over there).
MSI Neo4-F and two SATA disks (western digital and seagate) connected through SATA (non sata2), ArchLinux x64 and a root partition RAIDed 0. Kernel 2.6.30-4.
--[[User:PeGa!|PeGa!]] 01:31, 18 August 2009 (EDT)----
== "archive your partition scheme" ==
I agree that this is a good idea, but I would caution against dumping the exact partition table back onto a new disk unless you know the disk to be physically identical in all respects to the old one. Usually you'll have a disk from a different manufacturer or a different production run and the total number of sectors (and thus the geometry) will be a little different.
It's best to re-do the partition table, so that you can make sure it's all nice & aligned with the geometry (some things don't like it when partition boundaries aren't aligned, e.g. you'll get warning messages on boot and cfdisk will hate you).
If you're re-adding the new partitions to existing RAID arrays, make sure you err on the side of making them a little bigger rather than a little smaller -- it sucks when they don't fit :)
== Fixed mdadm --scan calls. ==
As per discussion on the arch-general mailing list, it was clear that the calls to mdadm happened at the wrong time.
Mdadm --scan has to be called '''after''' mounting (which probaly happens while the installer is already running), but before mkinitcpio runs, so that mkinitcpio can incorporate mdadm.conf into the initrd.
Therefore, I have moved the first mentioned call from running before /arch/setup to running during the setup on a 2nd terminal.
I have removed the 2nd call after grub setup entirely dince by then it would already be too late.
--[[User:Jinks|Jinks]] 18:34, 13 January 2010 (EST)
== <s>Transform and Update Article - 2011</s> ==
This article could prove to be extremely helpful, but it is outdated. Although that fact has been noted numerous times here and in the forums that task hasn't been taken on in earnest. I believe it should be transformed into a Software RAID specific article, with a short section referencing the more thorough and accurate [[LVM]] article. A lot of the information in this article is redundant, and outdated compared to the [[LVM]] article. Some steps to be taken:
# Rename article to '''Software RAID'''
# Reference other more current/detailed articles, remove redundant information
# Remove the [[Installing with Software RAID or LVM#Outline|Outline]] section
# Add '''Required Software''' in summary template
~ [[User:Filam|Filam]] 08:21, 30 August 2011 (EDT)
:I flagged the article as out-of-date. Rather than slowly make major revisions, which could cause the article to become inconsistent, I've created a new version in my user space, [[User:Filam/RAID]]. You're welcome to contribute edits there. ~ [[User:Filam|Filam]] 11:44, 31 August 2011 (EDT)
== Create sysfs partition ==
''If you are using an Arch Linux install CD <= 0.7.1, you have to create and mount a sysfs partition on /sys, to keep lvm from getting cranky. Otherwise you can skip this mounting of sysfs, unless you run into trouble. If you forget to do this, instead of giving you an intelligent error message, lvm will simply Segmentation fault at various inconvenient times.''
''To mount the sysfs partition, do:''
# mkdir /sys
# mount -t sysfs none /sys
:I will be removing the preceding text from the main article as it is no longer relevant, but wanted to keep an easily accessible and searchable record of it. ~ [[User:Filam|Filam]] 16:13, 31 August 2011 (EDT)
== Kernel parameters ==
''Then specify the raid array you are booting from in /mnt/boot/grub/menu.lst like:''
# Example with /dev/array/root for / & /dev/md1 for /boot:
  kernel /vmlinuz-linux root=/dev/array/root ro  md=1,/dev/sda1,/dev/sdb1,/dev/sdc1 md=0,/dev/sda3,/dev/sdb3,/dev/sdc3
:Again, I will be removing the preceding text from the main article as it is no longer relevant, but wanted to keep an easily accessible and searchable record of it. ~ [[User:Filam|Filam]] 17:20, 31 August 2011 (EDT)
== Install Grub with pre-2009 ISOs ==
''This is the last and final step before you have a bootable system!''
''As an overview, the basic concept is to copy over the grub bootloader files into /boot/grub, mount a procfs and a device tree inside of /mnt, then chroot to /mnt so you are effectively inside your new system.  Once in your new system, you will run grub to install the bootloader in the boot area of your first hard drive.''
''Copy the GRUB files into place and get into our chroot:''
# cp -a /mnt/usr/lib/grub/i386-pc/* /mnt/boot/grub
# sync
# mount -o bind /dev /mnt/dev
# mount -t proc none /mnt/proc
# mount -t sysfs none /mnt/sys
# chroot /mnt /bin/bash
''At this point, you may no longer be able to see keys you type at your console. I am not sure of the reason for this (NOTE: try "chroot /mnt /bin/<shell>"), but it you can fix it by typing <code>reset</code> at the prompt.''
''Once you have got console echo back on, type:''
# grub
''After a short wait while grub does some looking around, it should come back with a grub prompt. Do:''
grub> root (hd0,0)
grub> setup (hd0)
grub> quit
''That is it.  You can exit your chroot now by hitting <code>CTRL-D</code> or typing <code>exit</code>.''
:Once again, I will be removing the preceding text from the main article as it is no longer relevant, but wanted to keep an easily accessible and searchable record of it. ~ [[User:Filam|Filam]] 11:00, 1 September 2011 (EDT)
== Installation image ==
== Installation image ==

Revision as of 17:50, 22 May 2012

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.

Note: Numerous sections on this talk page were archived to /Archive 1 on May 22, 2012.

Installation image

Which installation image should be used (i.e. Netinstall or Core)? As lilsirecho writes on the forum: "This action occurs when utilizing ftp install which installs the latest kernel rather than the very old kernel in the 2010-05 .iso. ... If you are not using ftp install grub2 may not be compatible with the kernel in 2010-05 .iso." ~ Filam 13:54, 1 September 2011 (EDT)

I don't know a thing about groub2 or RAID, but we now have new official images, from 2011.08.19 - the forum discussion you mention took place 2 weeks before their release. -- Karol 14:14, 1 September 2011 (EDT)
What's the status of this issue? We may have a new official image soon. -- Karol (talk) 20:41, 7 May 2012 (UTC)

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 http://yannickloth.be/blog/2010/08/01/installing-archlinux-with-software-raid1-encrypted-filesystem-and-lvm2/ 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)