Gentoo Archives: gentoo-user

From: Thomas Harold <tgh@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] raid1 + lvm2
Date: Sat, 10 Dec 2005 16:11:01
Message-Id: 439AFC49.8080702@tgharold.com
In Reply to: [gentoo-user] raid1 + lvm2 by Jarry
1 Jarry wrote:
2
3 > Hi,
4 >
5 > I'm going to re-install gentoo on a small hobby-server and because
6 > I need both redundancy and flexibility, I thought in addition to
7 > raid1 (2x 160GB ata-disk) this time I would also use lvm2:
8 >
9 > /dev/md0 /boot (~50MB)
10 > /dev/md1 / (2GB)
11 > /dev/md2 <swap> (2GB)
12 > /dev/md3 lvm2 (rest for /var /tmp /usr /opt /chroot /home)
13
14 That's how I typically setup my small office servers. I create about 6
15 LVM volumes during the initial installation. The downside is that it
16 makes recovery more difficult (additional volumes that have to be
17 mounted). I've also done a server where I made the root volume larger
18 (16-24GB) and didn't bother with LVM2 during the initial install.
19
20 I also have a server where I did something slightly trickier with
21 RAID1/LVM2:
22
23 hda1+hdc1 -> /dev/md0 /boot (~128MB)
24 hda2+hdc2 -> /dev/md1 (swap) (2GB)
25 hda3+hdc3 -> /dev/md2 / (root) (16GB)
26 hda4 -> /music (rest of disk), non-redundant
27 hdc4 -> /musicbackup (rest of disk, non-redundant)
28
29 Every few days (whenever I add new music), I update the contents of
30 /musicbackup with what is stored on /music, then unmount /musicbackup
31 again. So, accidental deletions in my /music folder become easy to
32 recover from. And I don't care if my music is offline for a few
33 hours/days before I can swap in a new drive.
34
35 > Is this generaly advisable solution (lvm2 over raid1), or is there
36 > some risk in using raid1 together with lvm2 ?
37
38 The only issue I've heard *rumor* of is that 2.6.14 kernels may not be
39 playing nicely with LVM2. (I'm using 2.6.13 on my servers at the
40 moment.) One of these days, I'll update to 2.6.14 and find out for sure.
41
42 > One more question concerning partition type:
43 > If I want to use raid1, I have to set all those 2x4 (hda+hdc) primary
44 > partitions as type fd (raid autodetect). Is it not problem later for
45 > lvm2 when preparing and creating volume-group? Because lvm-guide says
46 > something about setting partition type to 8e (linux lvm), which I can
47 > not do, if I want to use raid1...
48
49 All partitions end up as "fd", because the raid arrays need to be built
50 prior to LVM2 getting a look at them.
51 --
52 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] raid1 + lvm2 Jim Burwell <jimb@××××.cc>