Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


Search this Thread
Old 12-06-2005, 06:34 PM   #1
Registered: Dec 2005
Location: Greece, Xanthi
Distribution: Red Hat 9, FreeBSD 5.4
Posts: 38

Rep: Reputation: 15
LVM: If hard disk fails i loose it all?

I have tree simple questions about LVM that just could not be answered after 4 hours of search in LVM howto, Google, Linux questions and linux-lvm Archives.

I have a small file server with 600Gbytes in one liner volume group consisting of 3 200 Gbyte Hard disk. My questions are:

1. If one hard disk fails (hardware) do I loose all the data stored on the VG?

2. Can I add a new hard disk in the VG without having to format it before? (I mean if it is full of data can I just add it?)

3. In case of failure can I recover the data from a single disk on another box?

Thanks in advance
Old 12-06-2005, 06:44 PM   #2
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,156

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
I think you can remove volumes from LVM control without destroying them, so remove the good devices.

Another thing I've had to do (not your question, but somewhat related) was to convert an ext3 volume to an ext2 one when a sector in the journal file area went bad.
Old 12-06-2005, 07:11 PM   #3
Registered: Dec 2005
Location: Greece, Xanthi
Distribution: Red Hat 9, FreeBSD 5.4
Posts: 38

Original Poster
Rep: Reputation: 15
there is an option to reduce the vg,and to move the VG from one disk to another to remove the bad disk. but that is before it fails and i am no prophet to know when on disk is going to fail.
Old 12-06-2005, 07:19 PM   #4
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
"The failure or removal of a drive that LVM is currently using will cause problems with current use and future activations of the VG that was using it." - TLDP LVM2 FAQ

If you don't do some kind of RAID (other then a straight strip) then there is no mechanism to ensure no data loss when you loose a disk.

RAID 5 is the common way of combining 3 disks in a fast yet safe manner. It works by doing a strip across two disks and uses the third for parity. This way if any one disk fails you either have all the data still or can easily calculate what the data previously was.

Last edited by jtshaw; 12-06-2005 at 07:20 PM.
Old 12-07-2005, 07:03 AM   #5
Registered: Dec 2005
Location: Greece, Xanthi
Distribution: Red Hat 9, FreeBSD 5.4
Posts: 38

Original Poster
Rep: Reputation: 15
Thanks jtshaw

it seems to me that i have to go for raid 5. the controlers are expensive so i will try it in software. Back to studining. 2 quick questions.

1. can I do it with different size disks?

2. The usable/real space ratio is 4/5? (if i have 5 200GB HD i will have 800 GB space) Is there another raid with better ratio and more disks?
Old 12-07-2005, 11:14 AM   #6
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,535

Rep: Reputation: 1207Reputation: 1207Reputation: 1207Reputation: 1207Reputation: 1207Reputation: 1207Reputation: 1207Reputation: 1207Reputation: 1207
Which is more expensive... a controller-card, or your data? Consider your moves carefully so that you are not "penny wise and pound foolish." Hardware-RAID is no panacea, but it does tend to be a good bit more efficient.

Notice, however, that hardware-efficiency is most important for the "first-tier" data; the data which is accessed most frequently (continuously...) and which needs the fastest delivery-time. Your logical-volume structure may contain other storage areas which are somewhat less speedy, and it may contain external devices such as FireWire or USB-2.0 units. These might be appropriate for the use of software-RAID.

One of the goals of an LVM is to allow data to be migrated off a drive so that the drive can be taken out of the installation even while the storage-cluster is running. But the data on any drive is subject to the vagaries of the device itself. If the device fails, and there is no RAID and/or no current, usable backup, then the data is gone no matter what you do.

Hard drives have built-in diagnostic capabilities, such as SMART (see man smartd, man smartctl) which can be set up for periodic polling by the operating system to alert you to possible failures. If you are managing a large storage cluster, you should have this in place.
Old 12-07-2005, 12:09 PM   #7
Senior Member
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
Related to post #1:

1) You should be able to recover the data on the other disks, but there are no guarantees. Look at the options in “man lvm”.

2) Yes, you can add an entire disk as a physical volume, but not the data (there may be some exceptions if the drive was already a physical volume on another system). You would need to mount the drive/partitions as usual and copy the contents into the LVM.

You need to zero out the initial clusters to make an entire drive into a physical volume. That’s kind of tough on the partition/filesystem structure. Look at the warning early in “man pvcreate”.

3) Huh?

Related to post #5:

1) The drives can be different sizes, unless you’re doing a scattered lvm (essentially a raid0).

2) Regarding increased reliability issues, software raid is a lot cheaper than a hardware raid controller, but it takes a lot of CPU power to do fast writes to a software raid5. On the flip side, the reads from a software raid5 tend to be blazingly fast, similar to the case for raid1 reads.

If you have limited CPU power, a good option is software raid10, where you write as a raid0 to pairs of raid1 drives. Obviously, you would need twice as many drives as you would need for a non-raid situation.

Another software raid option is to separated heavily used folders onto different raid1 devices, but it takes a lot of advanced planing to get it right. For instance, in the case of a web server, putting /var on one pair of raid1 drives and putting /usr (or “/”) on a different pair of raid1 drives, tends to give decent write rates and fast read rates. For a user file server, you might want to separate /home from /usr. Again, you have to think through it and plan for future needs before you set it up.
Old 12-07-2005, 01:05 PM   #8
Registered: Dec 2005
Location: Greece, Xanthi
Distribution: Red Hat 9, FreeBSD 5.4
Posts: 38

Original Poster
Rep: Reputation: 15
First of all thanks to sundialsvcs and WhatsHisName your help was helpfull.

I'm now considering hardware solutions with hardware controler raid 5. The problem is quite simple acctually i have a budget of 3000 euros (about 3500$) to make 3 or 4 Terrabyte file server. this file server is no very demanding in bandwith since it will mainly consist of movies and mp3s, there wont be more than 400 persons to use. and we are all connected to 100mbits interfaces so max b/w of all network will be 8 builting * 100mbits per builting = 800Mbits. one option i was considering is this

but it seems to me its very complex so i was thinking of going like the rest of the world with 16 port SATA contoler and cheap 300GB disks

i will start searching about what filesystem i'll use and os. I'am between FC4 and FreeBSD 6. many things to worry...

thanks again


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
Cloning 1 hard disk to smaller hard disk, dd or ghost? fireman949 Linux - Hardware 8 12-23-2012 01:51 AM
LVM - adding a new scsi hard disk ddaas Red Hat 1 07-28-2005 03:13 AM
Restoring LVM when a disk fails enygma Linux - General 1 11-13-2004 08:58 AM
oops! took out second hard disk--fs fails to load! sick-o-windoze Linux - Hardware 1 11-29-2003 10:54 PM
Hard Disk question - Making a big hard disk MrAnonym Linux - General 2 09-15-2003 07:08 PM

All times are GMT -5. The time now is 02:15 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 @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration