In rhel 5, is it possible to make a volume group on a mirrored disk?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
In rhel 5, is it possible to make a volume group on a mirrored disk?
hi, im a bit new in linux so im wondering if anyone can help me. I have a rhel 4 server that i want to upgrade to rhel 5. i am planning to implement the volume system in rhel 5 to have the flexibility of adjusting the size of your partitions but i also want it to be mirrored onto another disk. Is this possible or am i just making things too complicated?
LVM has, as far as I remember, it's own way to have mirroring.
If you use a software-RAID I'd suggest having a look into this as it might be interesting to compare performance here compared to LVM on RAID.
But of course it is possible to have LVM on a RAID.
Hi lou248, I'm rebuilding my web/database server and I just tested what you are wanting with RHEL5. While installing I created a RAID1 mirror using 2 disks. The first raid (md0) was for the /boot partition (because boot cannot be on an LVM). Then I created a second RAID1 mirror (md1) and put my LVM on that partition. I could then create my filesystems on the LVM.
After I got the server up and running I reaching in and unplugged the power chord on one of the hard drives. Everything was fine. Then I took another hard drive, installed it, recreated partition, added the partitions back to the RAID devices and watched the new disk get rebuilt.
NOTE: I have not done any performance benchmarks on the server and don't intened to. It is working fine and I don't have enough volume to worry about it.
P.S. I can post my notes on this process if you'd like, but they are at home. Let me know if your interrested.
I did a little small-scale benchmarking using Bonnie++ in VM.
The setup was as follows:
First I set up four image-files with each 1GB size (as my space in the VM is quite limited), these I turned into loopback-devices using losetup.
The first two I put into a volume-group and created a mirrored volume, the other two went into a software-RAID.
After the tests with these setups I set up LVM using the RAID, created a regular volume (non-mirrored) and tested that too.
Everything was formatted with ext4.
Hi lou248, I'm rebuilding my web/database server and I just tested what you are wanting with RHEL5. While installing I created a RAID1 mirror using 2 disks. The first raid (md0) was for the /boot partition (because boot cannot be on an LVM). Then I created a second RAID1 mirror (md1) and put my LVM on that partition. I could then create my filesystems on the LVM.
After I got the server up and running I reaching in and unplugged the power chord on one of the hard drives. Everything was fine. Then I took another hard drive, installed it, recreated partition, added the partitions back to the RAID devices and watched the new disk get rebuilt.
NOTE: I have not done any performance benchmarks on the server and don't intened to. It is working fine and I don't have enough volume to worry about it.
P.S. I can post my notes on this process if you'd like, but they are at home. Let me know if your interrested.
Michael Cunningham
RHCE
Hi Michael, thanks for the info. if it is not too much of a bother, i would like to know how you did it. One more thing, when your creating an LVM and VG, can you use the entire size of the physical disk? Thanks again.
Hi Michael, thanks for the info. if it is not too much of a bother, i would like to know how you did it. One more thing, when your creating an LVM and VG, can you use the entire size of the physical disk? Thanks again.
Lou
Lou, I just back in town and this info is at home. I'll get it for you tonight. You can use "almost" the whole disk. The boot partition cannot be on LVM. I made mine 256M which is more than enough. The remaining part of each disk was for the LVM. More tonight.
Hi Michael, thanks for the info. if it is not too much of a bother, i would like to know how you did it. One more thing, when your creating an LVM and VG, can you use the entire size of the physical disk? Thanks again.
Lou
Ok, here it goes. I’ll write it in a step-by-step process.
Assumptions
The computer has two separate hard drive that are NOT configured with hardware raid. For purposes of demonstration the first hard drive will be /dev/hda and the second will be /dev/hdd (because that’s what it is on my system).
Installation
During installation use the custom disk configuration and do the following:
The first raid device will be for the /boot partition and consist of two raid partitions – one on each of the hard drives. This involves creating a raid partition on /dev/hda and another separate raid partition on /dev/hdd. Then create a RAID1 device (/dev/md0) with the two partitions and assign the /boot filesystem name. This sounds confusing, but you should see what I'm talking about when using the GUI for custom disk config.
The second raid device is very similar, but you can use all the remaining space on each of the drives (I’m assuming 2 drives the same size). Follow the same procedure from above until you have a RAID1 device named /dev/md1. Then create an LVM using the /dev/md1 device. During this step you can name your volume group whatever you wish, but I’ll use the name vg01. On this volume group I created the following logical volumes and filesystems (all ext3 except for swap of course).
If you’d like you can configure the /etc/mdadm.conf file with the following parameter so an email will be sent upon any failure of the software devices.
Code:
MAILADDR=emailaddr@domain.com
Step 1)
Examine the software raid configurations with the following commands. Make any notes you want.
Reach in and pull the power chord off one of the drives. At this point you should get 2 emails. If you did not do anything with Step 0 above then check the mail of the root user for the raid failure emails.
Step 3)
Use the mdadm --detail commands from Step 2 above to find which partition has failed for each of the raid devices. For explanation purposes I’ll use /dev/hdd1 and /dev/hdd2 as the failed partitions.
Step 4)
Remove the failed partitions from the raid devices.
For my test I reconnected the old drive, fdisk’ed it to death.
Step 6)
Create two partitions on the new drive of sufficient size. This does not have to be exact, but the new partitions need to be 'at least' as big as the existing partitions.
Step 7)
Add the partitions on the new drive to the raid devices.
I like to start with the largest first so I don’t make a mistake. Linux will give an error if the partition being add is not large enough. For example, if I were to accidentally try and add /dev/hdd1 to /dev/md1 I would get an error.
Code:
mdadm -a /dev/md1 /dev/hdd2
mdadm -a /dev/md0 /dev/hdd1
Step 8)
Monitor the progress of the RAID1 rebuild with the following commands. This can take some time on the larger raid device.
Code:
cat /proc/mdstat
Let me know if anything is confusing and I'll try and do better.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.