Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 05-12-2006, 05:52 AM   #1
LQ Newbie
Registered: Sep 2005
Posts: 4

Rep: Reputation: 0
Convert to SW RAID with LVM2 on existing disk


I just got a Dell 2850 workstation coming in with RHEL 4 installed. It has two identical disk, /dev/sda & /dev/sdb. The system is installed in /dev/sda, & unfortunately (or fortunately?) it has LVM2 installed already.

Now I planned to convert the system to SW RAID-1 configuration. And I planned to follow the simple way as suggested in the RedHat knowledge base, which basically uses one single command to create RAID. Please refer to kbase of redhat, FAQ_43_2812
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hda3 /dev/hdc3
Then I realized that with LVM2 installed on existing disk, the situation might be not the same 'cause the PV will be in a fully different device.

Can I change the PV to the RAID device without losing the data? Or, what's the proper procedure to be taken here to accomplish the task?

I had also been thinking of a new installation of the system, which might make the life easier. But there is one concern: I'm not sure whether the RHEL4 has all the right & updated drivers for Dell 2850?

Any suggestion will be greatly appreciated.


For reference, I copied the output of Fdisk/lvs/pvs here.

[root@kou etc]# fdisk -l /dev/sda

Disk /dev/sda: 146.8 GB, 146815733760 bytes
255 heads, 63 sectors/track, 17849 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 5 40131 de Dell Utility
/dev/sda2 6 528 4200997+ 8e Linux LVM
/dev/sda3 * 529 553 200812+ 83 Linux
/dev/sda4 554 17849 138930120 5 Extended
/dev/sda5 554 17849 138930088+ 8e Linux LVM
[root@kou etc]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 lvm2 -- 4.00G 4.00G
/dev/sda5 VolGroup00 lvm2 a- 132.47G 106.47G
[root@kou etc]# lvs
LV VG Attr LSize Origin Snap% Move Copy%
LogVol00 VolGroup00 -wi-ao 4.00G
LogVol01 VolGroup00 -wi-ao 2.00G
LogVol02 VolGroup00 -wi-ao 8.00G
LogVol03 VolGroup00 -wi-ao 4.00G
LogVol04 VolGroup00 -wi-ao 4.00G
LogVol05 VolGroup00 -wi-ao 4.00G
Old 05-14-2006, 11:40 PM   #2
LQ Newbie
Registered: Sep 2005
Posts: 4

Original Poster
Rep: Reputation: 0

I guess there is no easy way to work around here. There are two options in my humble mind.

Option A, move system/data to one part of the disk; keep it; create RAID on the unused part; move all system/data to RAID; create new RAID on the rest of the disk; steps are like following:
1. Shrink LV, then shrink LVG; -- easy
2. Shrink PV, free up unused PE; -- Doable, with risk;
3. Shrink partition size; -- Doable, with bigger risk;
4. create new partition & new RAID device; -- easy;
5. copy system/data to RAID; --easy
6. create new RAID on the old part of disk; --easy
7. create new PV and add to VG -- easy

I tried this option and stop in step 2, no further with step 3. because I found it too trouble some. So I essentially turn to the Option B, which turn out to be easy & fast.

Option B, reinstall the system.

Hope this experience can be helpful for those who looking for similar solutions.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
RAID 1: adding a new SCSI disk to existing disk.... help mgy Linux - Enterprise 4 04-17-2006 03:56 AM
Is it possible to convert from using hardware RAID to software RAID? kindredstar Linux - Hardware 2 12-19-2005 09:13 AM
Installing Suse onto existing SATA RAID 0... Lucid_Angel-TLSC SUSE / openSUSE 5 11-26-2005 09:42 AM
using mdadm to grow an existing RAID 1 array kevburger Linux - Hardware 1 08-18-2005 08:17 AM
Adding ide drive to existing raid 5 help koj333 Linux - Hardware 3 09-28-2003 12:28 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration