adding Raid1 to Raid0

Latest response

All,

I am using RHEL 5.7 and need to setup a Raid0 on3 drives, in the near future I will be adding 3 more drives in an external chassis. I will then be setting these up in a Raid0 and would like to do Raid1 on the two Raid0

Question is when I do the second Raid0 and then the Raid1 will I lose any data?

Will be unable to backup since these are TB drives storing my DB data

Thanks for any assistance,

Jamie

Responses

Ooof... a 3TB database partition that you're not backing up? That's bad juju, right there.

VERITAS used to call what you're looking to do a "layered volume". At any rate, I can't remember if LVM is capable of doing what you're suggesting unassisted. What you might need to do is leverage a hybrid mdadm/LVM configuration. Use mdadm to create your RAID0 devices and then use LVM to mirror the two devices.

Haven't done anything like what you're suggesting without the use of VxVM (outside of a lab scenario) so can't really speak to ease of management using just free tools. On the plus side, Storage Foundation Basic (if Symantec's still making it available) would allow you to easily accomplish what you're looking to do and would allow you to do it in an online mode (no downtime to convert from one RAID-type to another) using their online-relayout option.

Interesting problem, though. Makes me want to see if I can simulate it in a lab VM.

The drives are actually 10TB each, I will be putting three internal to the server and soon will be getting an external chassis for the other three. This is why I need to setup the two Raids seperate and then mirror.

Would have been nice with all the pieces from the get go,

Ok, so, just for clarity: the three internal to the server are just for your application data, not for OS data. And you're looking to create an ≈ 30TB single mountpoint/filesystem to put your application's data files in?

That is correct, the 30TB is just for the DB application and data files

Actually, I take the above back. Looks like you can keep it all in LVM by using the `lvconvert` tool. I just did it with a VM. =)

Basically, you'll want to:

  1. Present your first three disks to the host system
  2. Use fdisk to set up each of those three disks as LVM-usable devices
  3. Create your application data VG (e.g. `vgcreate AppVG /dev/sdb1 /dev/sdc1 /dev/sdd1`
  4. Note how many PEs are available in that VG
  5. Multiply that number of PEs by 0.9
  6. Do an `lvcreate -i 3 -I <preferredstripewidth> -l <NumberFromStep5> -n <VolumeName> <VGname>`
  7. Do your mkfs on the logical volume
  8. Mount the logical volume/filesystem
  9. Go about your business...

Once you're ready to expand:

  1. Add your three new disks to the system 
  2. Use fdisk to set up each of those three disks as LVM-usable devices
  3. Use `vgextend` to add those new devices to your VG
  4. Do an `lvconvert -m 1 /dev/<VGname>/<VolumeName>`: you'll get output that looks like the following:
    OradataVG/OradataVol: Converted: 1.4%
      OradataVG/OradataVol: Converted: 86.1%
      OradataVG/OradataVol: Converted: 100.0%
    
  5. Verify your new configuration with `lvdisplay /dev/<VGname>/<VolumeName>`. Output should resemble the following:
    --- Logical volume ---
      LV Name                /dev/OradataVG/OradataVol
      VG Name                OradataVG
      LV UUID                qUxmm2-nQNO-89pb-czzj-1Qyk-5OkU-vBPegl
      LV Write Access        read/write
      LV Status              available
      # open                 1
      LV Size                288.00 MB
      Current LE             72
      Mirrored volumes       2
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     768
      Block device           253:7
    

    Notice that there's a "Mirrored volumes" line and it says "2".

Assuming your system supports hot-add of disks, everyting in the second set of steps is doable without downtime or interruption of your application's use of the filesystem. The `lvconvert` operation can be done online.