RAID1, LVM2 and a hard disk failure

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

RAID1, LVM2 and a hard disk failure

Postby mengoshmink » Sat Oct 26, 2013 2:57 pm

Hi,

I'm hoping I have a simple problem but I can't figure out what to do.

Linux distrobution: CEntOS 6.4

Asus motherboard: M4A78LT-M
http://www.asus.com/Motherboards/M4A78LTM/

Original setup:
DVD-ROM via the IDE port
Two 1.5Tb drives on SATA1 and SATA2
RAID1 the two disks, with 3 partitions:
    sda1 ext4 / 20Gb
    sda2 swap 2Gb
    sda3 lvm /mnt/store

When hard disk space was running low I added two new 3.0Tb disks and did a fresh install of the latest version of CEntOS to one of them. I extended the LVM of the original disk(s) to include the new hard disk.
    sda1 ext4 not mounted 20Gb
    sda2 swap 2Gb
    sda3 lvm /mnt/store
    sdc1 ext4 / 20Gb
    sdc2 swap 2Gb
    sdc3 lvm /mnt/store


Life was good until SMART warned me one of the original hard disks was failing.

My question:
How do I now replace the original 1.5Tb disks? Would this be a good time to migrate to OpenSUSE and BTrFS?

I really can not see a way forward so any questions, advise or help would be greatly received. I miss my server and the facilities it gave me :-(

mengo
Sharing knowledge is the best way to learn.
User avatar
mengoshmink
 
Posts: 9
Joined: Sun Oct 20, 2013 3:17 pm

Postby nelz » Sat Oct 26, 2013 4:07 pm

If you are using RAID, surely the device names would be md1, md2 etc? Or do you have a true hardware RAID controller?

I'd combne the two new disks as another RAID1 device, create a PV on it and add it to your volume group. Then use pvmove to move everything from the PVs on the old RAID to the new one, followed by vgremove to take the old RAID out of the volume group. Then you can unplug the old drives and use them as doorstops.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby mengoshmink » Sat Oct 26, 2013 4:59 pm

I couldn't remember the md assignments so I was using sd to simplify my explanation.

Maybe I am missing something but I can't physically see how to do that.
SATA1: 3.0Tb new disk (no RAID1 yet)
SATA2: 1.5Tb good disk (broken RAID1)
SATA3: 3.0Tb old good disk (RAID1)
SATA4: 3.0Tb old good disk (RAID1)

My 'store' LVM spans the disks in SATA2 and SATA3 (mirrored to SATA4). So if I remove disk in SATA2, SATA3 or SATA4 will it not break the LVM?
Sharing knowledge is the best way to learn.
User avatar
mengoshmink
 
Posts: 9
Joined: Sun Oct 20, 2013 3:17 pm

Postby nelz » Sat Oct 26, 2013 10:32 pm

3 and 4 are mirrored so you can remove either of them, but not both. You need to get everything off SATA2 with lvmove, then you can add SATA1 to the RAID array.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby mengoshmink » Sun Nov 03, 2013 2:17 pm

Huzzah! I have almost accomplished what I wanted.

Thanks to nelz I removed half of the mirrors so that I could fit the new disks.

I mounted my old / and backed up all that I thought was important, forgetting my mythtv database - doh!

I then realised I had created volume groups and logical volumes with the same names as my original setup, creating a conflict. Unfortunately I couldn't remove the duplicates with the command line or gparted but I could with the Anaconda installer with Scientific Linux. I left Anaconda with any what I felt unnecessary RAID partitions removed and the important one left ready for lvm; this time with a blank physical volume but no volume groups created.

Back on the command line in my new install I extended my old volume group:
# vgextend -v vg_phantom /dev/md2
Then moved the data from my old disk to my new one(s)
# pvmove -v /dev/md126 /dev/md2
and finally removed the old disk:
# vgreduce -v vg_phantom /dev/md126

One of my remaining problems is my RAID seems to start at md12x not mdx but I believe I can fix this, reading here:
http://ubuntuforums.org/showthread.php? ... st10907831
http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/
http://askubuntu.com/questions/209702/w ... ng-ignored
http://serverfault.com/questions/399571 ... -initramfs

Okay, I have lost m mythtv database but I maybe able to recover it from the old good disk. However the recordings are still intact so I may just manually re-encode them.

Finally I have found that the lvm on the new disk(s) is not using all of the available space, but I think some reading and I should be able to fix that too.

I appreciate this is not the clearest conclusion but I feel leaps and bounds ahead of where I was. Thank you.
Sharing knowledge is the best way to learn.
User avatar
mengoshmink
 
Posts: 9
Joined: Sun Oct 20, 2013 3:17 pm


Return to Help!

Who is online

Users browsing this forum: No registered users and 1 guest