Ingo Juergensmann: Adding a RAID under a LVM
Just as a personal reminder for the next time I need that:
If there's a machine, for example a Xen host, with just one harddisk and you want to be somewhat safe in case of a disk failure, you can add a second disk and setup a RAID1 (mirroring). It's most simple to shutdown the machine and setup the RAID1 for the dom0. Afterwards you can start the domU VMs again when you're using LVM for their virtual disks. Following these steps will add RAID1 underneath your LVM setup:
0. /dev/sda5 is your current physical volume for your LVM, on the second (equally partitioned) disk /dev/sdb5 will be your starting point for your RAID1 (/dev/md3)
1. create a degraded RAID1 on /dev/sdb5:
2. prepare it for LVM and add it to your virtual group:
3. move the extends from one disk to the other and be verbose to watch the progress:
4. remove the old partition from the virtual group:
5. add the old partition to your raid and set it active:
6. let the RAID1 doing its sync and you're done.
Just as a small side note:
I don't know why the kernel don't want to boot when it get passed root=/dev/md2 as a kernel parameter. It works with root=/dev/sda3, though...
If there's a machine, for example a Xen host, with just one harddisk and you want to be somewhat safe in case of a disk failure, you can add a second disk and setup a RAID1 (mirroring). It's most simple to shutdown the machine and setup the RAID1 for the dom0. Afterwards you can start the domU VMs again when you're using LVM for their virtual disks. Following these steps will add RAID1 underneath your LVM setup:
0. /dev/sda5 is your current physical volume for your LVM, on the second (equally partitioned) disk /dev/sdb5 will be your starting point for your RAID1 (/dev/md3)
1. create a degraded RAID1 on /dev/sdb5:
# mdadm --create /dev/md3 --level=1 -f --raid-devices=1 /dev/sdb5
mdadm: array /dev/md3 started.
# cat /proc/mdstat
md3 : active raid1 sdb5[0]
135540288 blocks [1/1] [U]
2. prepare it for LVM and add it to your virtual group:
# pvcreate /dev/md3
# vgextend /dev/vg /dev/md3
Volume group "vg" successfully extended
3. move the extends from one disk to the other and be verbose to watch the progress:
# pvmove -v /dev/sda5
Finding volume group "vg"
Archiving volume group "vg" metadata (seqno 22).
Creating logical volume pvmove0
Moving 192 extents of logical volume vg/ts2-swap
Moving 1536 extents of logical volume vg/ts2-disk
[....]
Found volume group "vg"
Removing temporary pvmove LV
Writing out final volume group after pvmove
Creating volume group backup "/etc/lvm/backup/vg" (seqno 31)
4. remove the old partition from the virtual group:
# vgreduce /dev/vg /dev/sda5
Removed "/dev/sda5" from volume group "vg"
5. add the old partition to your raid and set it active:
# mdadm --add /dev/md3 /dev/sda5
mdadm: added /dev/sda5
# cat /proc/mdstat
md3 : active raid1 sda5[1](S) sdb5[0]
135540288 blocks [1/1] [U]
# mdadm --grow /dev/md3 --raid-devices=2
# cat /proc/mdstat
md3 : active raid1 sda5[2] sdb5[0]
135540288 blocks [2/1] [U_]
[>....................] recovery = 0.2% (284480/135540288) finish=39.6min speed=56896K/sec
6. let the RAID1 doing its sync and you're done.
Just as a small side note:
I don't know why the kernel don't want to boot when it get passed root=/dev/md2 as a kernel parameter. It works with root=/dev/sda3, though...
According to a recent article, 6 Common Website Mistakes That Cost Money are:
As everyone can see in the
Computer security is generally defined as the following:
I’ve had little time in the four years I’ve lived in Roslindale to get involved in community volunteer efforts. My wife Rachele, however, has devoted several years to efforts such as the Roslindale Community Center,
Update: There are more notes on how aptitude performs as a Sudoku
solver
I have gotten quite some response to 
I just uploaded lenny modules for the current branch of NVIDIA drivers. Only 4 more source packages to go, plus patching 71.86.06 for xen and 2.6.25+.
I got back home from DebConf8 about 11pm last night, having left Mar del Plata at 11am on Sunday morning. 4 hours time difference makes for a 32 hour trip time covering minibus, 2 planes, a coach and a car, 3 time zones (I flew via Madrid) and 4 countries. Not fun, and I'm glad I booked today off to recover. However I'm also exceptionally glad I went to what's probably my best DebConf so far.
When you have a server on the Internet, you get lots of "brute force"
attacks on the SSH daemon, trying plausible logins with a variety of
passwords. Even with good passwords, these attacks might eventually
succeed (and they're annoying even when they don't), so you want to
thwart them.
One way is to use
What I liked
... (at least concerning the Debian Project News):
Often when reading planet I notice something which might be interesting
for the next issue of the
Following the