LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-13-2010, 06:56 AM   #1
mr_minning
LQ Newbie
 
Registered: Dec 2008
Location: Gothenburg, Sweden
Distribution: Fedora, CentOS 7, Ubuntu, Arch, Raspbian
Posts: 19

Rep: Reputation: 10
Question Fileserver (at home) strategy with LVM?


Hi,
I need som advice. I have a CentOS machine at home serving mainly as a fileserver. It has a few hard drives for this purpose alone - mounted as /mnt/media0, /mnt/media1, /mnt/media2.

What I'd like is to have all of these drives act as one big "file pile" - but I don't want raid or jbod because I don't want one disk failure to kill the whole "array". I don't have anything on these drives that is very important or hard to replace, therefore I don't want to use any redundancy.

I have been looking at LVM with intent to mount all tree drives as one LV and VG (i.e. /mnt/filepile). But I can't really make out what will happen if one or more of the drives fail (breaks down/won't start). What will happen?
Are all files lost, or just the files on the failing pysical drive?
How do I recover files from the other drives in case of failure? Or do I need to?
Can I just recreate the VG without the broken drive and just see which files were lost and replace them from backups?

Thank you for your input.
 
Old 10-14-2010, 03:50 AM   #2
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
With RAID you try to get redundancy (usually) out of disks. With LVM you allocate disk space flexibly. If you want redundancy, use RAID. If you want flexibility, use LVM. If both, use LVM over RAID. Sometimes RAID capability is part of LVM. In many situations you need flexibility and therefore LVM.


RAID is used to join several drives as a single volume. Different RAID schemes let you increase capacity, speed, reliability, or all. In the end, you get with something that is just like one bigger, faster, better drive.

LVM is a very flexible volume manager. Although it has a couple of RAID modules, if you want RAID's redundancy or speed, put LVM on top of a RAID (or several). The purpose of LVM is joining several volumes (can be drives or RAIDs or a mix) into a 'Volume Group'. Then, you create new 'Logical Volumes' from the group. That gives you a lot of flexibility because you can later reassign capacity between the Logical Volumes, and add or remove Physical Volumes from the Volume Group. It really lets you think in a different way about storage.

For "recover files from the other drives in case of failure"LVM on top of a RAID is the solution.
 
Old 10-14-2010, 06:50 AM   #3
kaushalpatel1982
Member
 
Registered: Aug 2007
Location: INDIA
Distribution: CentOS, RHEL, Fedora, Debian, Ubuntu, LinuxMint, Kali Linux, Raspbian
Posts: 166

Rep: Reputation: 10
Why dont you go with LVM over RAID (Hardware RAID).

It will give your flexibility of LVM and Redundancy of RAID.

This is win-win situation. If any of your drive gets corrupted, You can easily replace it without loosing your data.

Last edited by kaushalpatel1982; 10-14-2010 at 06:52 AM.
 
Old 10-15-2010, 12:59 AM   #4
mr_minning
LQ Newbie
 
Registered: Dec 2008
Location: Gothenburg, Sweden
Distribution: Fedora, CentOS 7, Ubuntu, Arch, Raspbian
Posts: 19

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by prayag_pjs View Post
With RAID you try to get redundancy (usually) out of disks. With LVM you allocate disk space flexibly. If you want redundancy, use RAID. If you want flexibility, use LVM. If both, use LVM over RAID. Sometimes RAID capability is part of LVM. In many situations you need flexibility and therefore LVM.


RAID is used to join several drives as a single volume. Different RAID schemes let you increase capacity, speed, reliability, or all. In the end, you get with something that is just like one bigger, faster, better drive.

LVM is a very flexible volume manager. Although it has a couple of RAID modules, if you want RAID's redundancy or speed, put LVM on top of a RAID (or several). The purpose of LVM is joining several volumes (can be drives or RAIDs or a mix) into a 'Volume Group'. Then, you create new 'Logical Volumes' from the group. That gives you a lot of flexibility because you can later reassign capacity between the Logical Volumes, and add or remove Physical Volumes from the Volume Group. It really lets you think in a different way about storage.

For "recover files from the other drives in case of failure"LVM on top of a RAID is the solution.
I'm familiar with RAID and how it works. But I'm really curious about the workings of LVM. I do not require redundancy (all movies and music from my filepile are backed up). RAID seems a bit unflexible too. If I go out and ge myself another drive, I'll have to rebuild the whole array (right?). It's just a question weather I have to restore 6GB or just 1GB in case of hardware failure.

I wanted to compare LVM to RAID (JBOD or RAID 0) in this case. I know it's really bad if one drive (or the disc controller in hw-raid for that matter) fails if you got a raid system.
But what happens if a drive in a LVM volume fails? Is the whole array lost?
The bottom line beeing: Do I have to restore 6GB or just 1GB?

Cheers!

Last edited by mr_minning; 10-15-2010 at 01:02 AM.
 
Old 10-15-2010, 02:47 AM   #5
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
Hi,

You can restore as per this link:

LVM is pretty cool and stores backup configs on the first 512 blocks of every LVM partition. These configs tell LVM what is stored where, and you can use them to restore your device. So, the first part of recovery is to find these configs. To do this you'll need to boot off the live cd. If you installed LVM you probably know this but the default cd doesn't have LVM on it.
 
Old 10-15-2010, 04:22 AM   #6
mr_minning
LQ Newbie
 
Registered: Dec 2008
Location: Gothenburg, Sweden
Distribution: Fedora, CentOS 7, Ubuntu, Arch, Raspbian
Posts: 19

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by prayag_pjs View Post
Hi,

You can restore as per this link:

LVM is pretty cool and stores backup configs on the first 512 blocks of every LVM partition. These configs tell LVM what is stored where, and you can use them to restore your device. So, the first part of recovery is to find these configs. To do this you'll need to boot off the live cd. If you installed LVM you probably know this but the default cd doesn't have LVM on it.
Thanks! Interesting reading. So, if I got this correctly... What one would do in case of disc faliure is to create a new volume group, based on the old one (same names and ids, which you collect with the dd command), but omitting the failing disk. After that you just do a "fsck". And what you see after that, is all the complete files that weren't on the crashed disc?!

Seems simple enough if I got that right. Did I?

Cheers!
 
Old 10-15-2010, 04:47 AM   #7
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
Hi,

You can test what ever mentioned in that link and confirm if its simple. Give it a try.
 
  


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
LVM Strategy for a fault tolerant server chrisinspace Linux - Server 1 01-22-2010 10:11 PM
Ubuntu firewall setup for home fileserver lrt2003 Linux - Newbie 3 03-20-2009 06:22 PM
home server - backup strategy - Linux Help wo2caisley Linux - Newbie 1 05-30-2008 10:24 AM
Selecting distro for home network router/trafic shaper/fileserver/misc muggizuggi Linux - Newbie 12 08-08-2006 02:27 AM
Stable Motherboard for Home Fileserver - Semperon 754 ??? ckristof Linux - Hardware 1 10-09-2005 10:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:56 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
Open Source Consulting | Domain Registration