• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

RAID, partitions and LVM

lunatic59

Moderati ergo sum
Moderator
Situation: Setting up a basic server for testing a couple of software packages. I picked up a stripped down Dell R200 refurb. It did not have hardware RAID but I wanted some fault tolerance so I went with a software RAID1 array.

I found a bunch of instructions using standard partitions but CentOS puts the root, swap and home partitions in a single logical volume. After sifting through a few older tutorials and a few about setting up RAID using LVM and a few restarts, I came up with the following process:

Setup_RAID1_CentOS6.pdf

Now to the question.

In step 2 preparing the disks for RAID1 you copy the partition table from the active drive to the new drive.

Code:
sfdisk -d /dev/sda | sfdisk
 
IME it's not unusual for modern-day Linux installers to mount existing partitions to see what's on them, and use this data in doing automated installs. You might want to run `mount' to see what's mounted at any given time. IME you can safely umount any partition that's not being prepared for system installation.

My /dev/sda died yesterday, and I'm constantly having to tell my installer to not format my other drive (which has all of my backups on it) to be my root partition for no other reason than because it has a Linux partition on it. And they call this progress... :pcguru:
 
I purposely left the physical drive out of the server until the initial install had been completed and I was ready to build the array. Before I installed it, I booted with a live CD and wiped any partitions and the MBR so I was working from a clean slate. It's when I copied the partition table from the active device (in this case /dev/sda to /dev/sdb) that the fun began. The first time before there had been a RAID array on either of the devices, everything worked fine. After subsequent installs /dev/sdb would always show as busy even though it wasn't mounted.

I guess I should zero out the superblock on /dev/sda before copying the partition table since I'm going to be building a new array anyway. I'll have to give that a try later this week.
 
I'm pretty sure that the filesystems on each physical drive must be identical. The UUID codes must be...unique, but they should be bit-perfect clones at the filesystem level.

IIRC I was able to build a non-raid system on one drive, then `dd if=/dev/sda of=/dev/sdb' and then switch the partition types to `Linux RAID'. But if the installer will do all that for you, I'd let it. :)
 
Back
Top Bottom