LinuxQuestions.org
Visit the LQ Articles and Editorials section
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, 06:05 AM   #1
sluge
Member
 
Registered: Dec 2006
Location: Russia,52
Posts: 104

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, 09:14 AM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
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, 10:42 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,172

Rep: Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784
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, 02:30 AM   #4
sluge
Member
 
Registered: Dec 2006
Location: Russia,52
Posts: 104

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


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 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 01:59 AM
Redhat LVM Extend Fails linuxaddict7 Linux - Software 3 03-15-2010 10:48 AM
Mounting LVM Disk to non-LVM disk gak_92 Linux - Hardware 1 08-07-2009 04:34 AM
LVM: If hard disk fails i loose it all? kyriakos Linux - Software 7 12-07-2005 01:05 PM
Restoring LVM when a disk fails enygma Linux - General 1 11-13-2004 08:58 AM


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

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration