LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-07-2012, 05:05 AM   #1
sluge
Member
 
Registered: Dec 2006
Location: Russia,52
Posts: 128

Rep: Reputation: 6
Question How to handle if lvm disk fails?


Hello!

I installed linux using LVM logical volumes in /dev/sda, mirror this logical volumes with /dev/sdb

Code:
# pvcreate /dev/sdb2
# vgextend vg_main /dev/sdb2
# lvconvert vg_main/lv_root -m1 -b
# lvconvert vg_main/lv_swap -m1 -b
and removed one of hard drives to check how linux will handle it.

So, linux hands for 2-3 minutes and after it crashed. I'm was suprised-is LVM doesn't support RAID1 mirroring?
Or is it required to make some additional configuration to setup LVM RAID1 mirroring?
 
Old 12-07-2012, 08:14 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Linux LVM doesn't do mirroring itself. It also doesn't do multipathing.

You need to to RAID software mirroring metadisk (see mdadm man page as a start) to setup a mirrored device if these aren't multiple paths to the same device. You then use that mirrored device as your PV in the VG rather than using the individual /dev/sd* devices.

You would need to use Linux multipathing (see multipath man page as a start) if these are multiple paths to the same device on an external hardware mirror (e.g. EMC or Hitachi disk array). You'd then present the multipath device as PV rather than the individual /dev/sd* devices.

From what you wrote it sounds like you're not using the latter.
 
Old 12-07-2012, 09:42 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,680

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
It really does but I have not personally tried it and so it appears that you followed the correct steps. I can only assume that the steps you posted were completed successfully. In addition depending on the size of your VGs it could take many hours to convert and the -b puts this process in the background. Without knowing if this step has completed successfully trying to check the functionality may not work. What linux distribution / version are you running?

Post the output of the command:
lvs -a -o +devices
 
Old 12-09-2012, 01:30 AM   #4
sluge
Member
 
Registered: Dec 2006
Location: Russia,52
Posts: 128

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by MensaWater View Post
Linux LVM doesn't do mirroring itself.
LVM2 supports RAID 0, 1, 5, 6
 
1 members found this post helpful.
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding an LVM hard disk to a system already running/using LVM firewiz87 Linux - Hardware 5 08-15-2010 12:59 AM
Redhat LVM Extend Fails linuxaddict7 Linux - Software 3 03-15-2010 09:48 AM
Mounting LVM Disk to non-LVM disk gak_92 Linux - Hardware 1 08-07-2009 03:34 AM
LVM: If hard disk fails i loose it all? kyriakos Linux - Software 7 12-07-2005 12:05 PM
Restoring LVM when a disk fails enygma Linux - General 1 11-13-2004 07:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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