Comments on How To Set Up Software RAID1 On A Running LVM System (Incl. GRUB Configuration) (Debian Etch)

How To Set Up Software RAID1 On A Running LVM System (Incl. GRUB Configuration) (Debian Etch) This guide explains how to set up software RAID1 on an already running LVM system (Debian Etch). The GRUB bootloader will be configured in such a way that the system will still be able to boot if one of the hard drives fails (no matter which one).

4 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Anonymous

Works perfectly on Debian "lenny" with a 250gig SATA array.

Copied commands almost verbatim with the exception of a slight difference to the default partition structure.  No sda5, just sda1 and sda2.  Simply replace all instances of sda5 with sda2 and you're off.


By: Mike Halliday

I could not get this to work after a standard (LVM) install of Focal Fossa (see below) - but I'd love to hear from someone who has made it work with that release.

Problems: (1) standard install formats boot partition VFAT and pvcreate /dev/md0 warned about metadata preventing boot. (2) /etc/mtab is a link to /proc/self/mounts which is not writeable and has zero bytes - but displays correctly (I don't understand this at all). (3) /boot/grub/menu.lst does not exist (again, this was after a standard install)

By: Pete S

Theren't no need to use mdadm.  LVM can be use to mirror LVs.  For many OSes, this is much easier than dealing with mdadm at install time, if the installer even supports setting up mdadm at all.  Check out the lvconvert --type raid1 command.

From the manpage:

Convert LV to raid1 or mirror, or change number of mirror images.       lvconvert -m|--mirrors [+|-]Number LV           [ -R|--regionsize Size[m|UNIT] ]           [ -i|--interval Number ]           [    --mirrorlog core|disk ]           [ COMMON_OPTIONS ]           [ PV ... ]

And if we need to remove the RAID1, that's possible too. Do that with mdadm.  Or we can added a 2nd/3rd mirror if we have more disks, then break the extra and take it to another system for use their.

By: jamminjames

I've followed the instructions, but when it comes to the "mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/sdh1" command, I get:mdadm: partition table exists on /dev/sdh1mdadm: partition table exists on /dev/sdh1 but will be lost or       meaningless after creating arraymdadm: Note: this array has metadata at the start and    may not be suitable as a boot device.  If you plan to    store '/boot' on this device please ensure that    your boot-loader understands md/v1.x metadata, or use    --metadata=0.90Continue creating array? ...I answer no at that point, but what should I do? My OS is AlmaLinux, but I would think the instructions would apply. It uses an LVM partition system, but other instructions I've found that include LVM have the same steps.Thanks for any help.