Install 11.1: Raid1, LVM or Partition based

I will be installing Opensuse 11.1 on an old Dell 1600sc with two identical 72G scsi drives that I want to software mirror (there is no controller based raid available). Later I will be adding four (4) IDE 500G drives to use in a raid 0, 5, or 6 configuration for serving databases and media to other hosts on the network.

I want to mirror all of the scsi drives, not certain partitions.

On installation I have two options 1) regular partitioning, or LVM installation. I want to be in the mirrored state initially to host the OS and additional software. Can anyone with experience in LVM, RAID and Partitioning give me some suggestions how to proceed? Should I just take the default partitioning and mirror later, since I will only be using the mirrored drives for OS, user data, and a few other software packages - if so how do I create the mirror in this case. The same question for the LVM option.

There will be no dual boot this will be purely an opensuse install.

Thanks,

I have found it very difficult, if not impossible to mirror entire drives, rather than partitions. The reason is linux (still) needs a “non-mirrored” /boot partition, that has to exist outside of LVM.

I’m fairly certain there’s a way to use LVM to create mirrors, but I don’t know off of the top of my head (I use LVM on top of raid 5, but this method will also work with raid1).

(disclaimer, this is much more straightforward from the command line, as opposed to the yast tools)

To create LVM on top of raid1, I would advise you to ignore the suggestions and create your own layout. Create a 100MB partition on each disk to house /boot. I didn’t mirror /boot during install, it’s easy enough to do once the system is finished installing.

Then create a second partition on each disk and allocate the rest of the space. Set the partition type to raid for this second partion. You’ll have something like:

/dev/sda1 100MB
/dev/sda2 72GB RAID
/dev/sdb1 100BM
/dev/sdb2 72GB RAID

Format /dev/sda1 to ext3 and mount it as /boot.

I think one of the options in the new partitioner allows you to create a raid volume. Use it create /dev/md0 as raid1.

The partitioner should have an LVM section. Here you can import /dev/md0 as your physical volume, create a volume group, and carve it up into whatever logical volumes you would like.

When you’re satisfied, continue with the installation.

Once the install is done, and you’re booted into the new system, it’s time to set up another mirror for /boot (so you can still boot the system if a drive fails).

Copy the data in /boot somewhere (MANDATORY):

rsync -av /boot /tmp/

(note the trailing slashes and lack thereof)

umount /boot
parted /dev/sdb

In parted, set the 100MB partition on /dev/sdb to be bootable an raid, and set /dev/sda1 to be raid also:

set 1 boot on
set 1 raid on
select /dev/sda
set 1 raid on
quit

Now create /dev/md1 to house the new boot:

mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1

Now format the new array:

mke2fs -j /dev/md1

Mount it and copy the data back:

mount /dev/md1 /boot
rsync -av /tmp/boot/ /boot/

Now isntall grub to the MBR of both disks. Type grub and at the prompt:

find /boot/grub/stage2

It should return:

(hd0,0)
(hd1,0)

Setup grub on each disk:

root (hd0,0)
setup (hd0)
root (hd1,0)
setup (hd1)

(if the find gives you different output, use those for the root command instead)

Finally change /etc/fstab to mount /dev/md1 as /boot instead of the long /dev/disk/by-id/<string> device.

You should set up the software RAID partitions on the 72G disks from the start. Converting later involves reformatting.

You don’t need LVM for such small disks since you can move your data to the big disks later.

And install a boot on each disk like the previous poster explained so that it will boot off either disk. It’s worth doing it manually in grub, I think I have seen that the installer sometimes fails to install on both disks.

The 500GB disk setup you can worry about later.