# mounting a LVM volume's member partitions.

## ferg

Hi all,

this may seem like a naive question, but does anybody know if you can mount a partition (i.e. /dev/sda1) that was the sole member of a LVM

array?  This is a non-root storage only device.

Currently the device is /dev/mapper/vg-tv. I want to mount the partition itself using /dev/sda1.

Is this possible without any corruption?  The actual filesystem is ext3, and should only extend to the parition itself. Right?

Cheers

ferg

----------

## Hu

To be sure I understand correctly:

/dev/sda1 contains an LVM volume group.  Within that volume group is a single logical volume.  That single logical volume is currently under the name /dev/mapper/vg-tv.  The filesystem on that logical volume is ext3.  You want to mount the logical volume to gain access to its files, but you do not want to activate the LVM code.  As far as I know, this is not possible.  LVM metadata for describing the extents of the logical volumes is stored as a header on the physical volumes, such as /dev/sda1.  Therefore, /dev/sda1 does not start with a valid ext3 header and cannot be mounted as an ext3 volume.  On the positive side, I believe mount would have warned about this and failed the mount without corrupting your data.

----------

## ferg

Hi Hu,

you understand me perfectly.  Thanks for taking the time to look at this.

LVM is something I know little about and I'm not too keen on having to learn.  I setup a LVM group for a MythTV box with the intention of adding drives in the future.  However, the fact that it seems to be fairly fragile (i.e. you lose 1 drive you lose the entire volume), and that Mythtv has recently added multiple recording directories, made me never expand this volume beyond a single partition. Since this having this as a volume rather than a single partition adds complexity I wondered if I could get rid of the LVM part.  But obviously not.

When I have a rainy sunday with nothing todo I might back up this drive and repartition it.  But not until then!

Cheers

Ferg

----------

## tld

I currently have a big LVM partition accross two 500 GB drives for mythtv, and recently upgraded to 0.21.  I'd also like to eventually get rid of the LVM...I just have to find someone who has a nice empty 1TB usb drive I can borrow  :Very Happy: .

Tom

----------

## ferg

I know the feeling.  The trouble with Mythtv and large drives is that you are always literally months behind in your viewing schedule  

 :Smile: 

Cheers

Ferg

----------

## robinmarlow

Having just suffered a drive failure (bloody samsung drives _again_) I've since rather gone off LVM as I lost all my recordings.  Will be looking into RAID... but that means more drives and more noise.

Robin

----------

## ferg

Ouch.  I hope you were not too behind on watching!

I have two sata drives in my machine in some of these drive boxes.  

http://www.acousticpc.com/gup_japan_silent_cool_drive.html

Very, very quiet, although quite expensive.

Not raided though.  I've thought about it, and I do use Linux software raid on all my other machines. (RAID 10 and 1).  But you need a minimum of 3 drives to do anything other than pure mirroring.  Unless you have a big box under the stairs I would avoid it.

Cheers

Ferg

----------

## robinmarlow

750Gb behind.  I was in one of those boxes... was very impressed - until the drive just suddenly didn't spin up.

Am trying to figure out how i can put the back end not in the livingroom.

Robin

----------

## Hobbes-X

 *ferg wrote:*   

>  However, the fact that it seems to be fairly fragile (i.e. you lose 1 drive you lose the entire volume), and that Mythtv has recently added multiple recording directories...

 

Actually, it is possible to recover the rest of the volume group if one drive dies. See: http://www.novell.com/communities/node/1502/recovering+lost+lvm+volume+disk

You're still borked for whatever was on that drive, and it's bad news if it's the drive with the superblock on it, but it's possible.

----------

## ferg

Interesting.  Thanks!

cheers

Ferg

----------

## lyallp

I have never had a problem with LVM.

If you lose one drive, you don't lose everything, unless you use RAID0 - http://en.wikipedia.org/wiki/RAID

I found that LVM was quite rugged, actually, when I had problems with a SATA cable causing regular timeouts of the drive - XFS suffered more (what my system uses).

I don't bother using a ramdisk so I have a non-lvm Boot and Root partition - keeps things simple. Everything else is LVM managed, which is great, run out of room in a Filesystem? Easy, add more space.

I only recently setup a raid of 100G for my linux area over 2 750G drives and left the remaining 650G on each drive as unmirrored 'scratch' areas. (after a futile attempt at having them as a mirrored NTFS partition which both Linux and Windows XP would recognise - a subject in another thread).

----------

## ferg

Hi,

So you are saying that if you have a 2 disc LVM volume, and you lose one of those discs, then the volume is still OK and mountable, albeit with only the information from that drive that's still working?

I'm not talking about a raid layer, just a normal filesystem on top of a 2 drive LVM volume.

Cheers

Ferg

----------

## lyallp

LVM is capable of doing RAID itself (or at least, that is my understanding)

But, if you don't setup the 2 disk LVM volume as RAID, then if one disk fails, fat chance of getting your data back.

That said, XFS, from my light reading, stores data in 'areas' to improve concurrent throughput - it may be possible, if using XFS, to recover stuff from the remaining 'areas'.

----------

## Hobbes-X

 *ferg wrote:*   

> 
> 
> So you are saying that if you have a 2 disc LVM volume, and you lose one of those discs, then the volume is still OK and mountable, albeit with only the information from that drive that's still working?

 

That's what I was getting at... it's not a guarantee though. You get the physical volumes back, but there's still the matter of a potentially damaged filesystem.

From the link I posted above:

 *Quote:*   

> Disk Permanently Removed
> 
> This is the most severe case. Obviously if the disk is gone and unrecoverable, the data on that disk is likewise unrecoverable. This is a great time to feel good knowing you have a solid backup to rely on. However, if the good feelings are gone, and there is no backup, how do you recover as much data as possible from the remaining disks in the volume group? No attempt will be made to address the data on the unrecoverable disk; this topic will be left to the data recovery experts.
> 
> Symptom:
> ...

 

This is a little more elegant than the instructions I found a few years ago when I had a drive die, but I'll get a chance to test them out, since I just had one of my myth volume group's drives die.    :Evil or Very Mad:   :Evil or Very Mad:   :Evil or Very Mad:  At least it's the oldest and smallest.

IIRC in the past, my drive wasn't completely dead, the kernel could still detect it, so there was a /dev entry for the drive, even though it didn't respond. I used pvmove and just let it timeout for a few hours on the bad drive. Don't know if that was the best way, but it worked to preserve the data on the other drive.

----------

## ferg

Interesting. Sorry to hear about your dead disc.  Good luck with the recovery.

Incidentally I'm having good experiences with the Disc Group function.  When I added the 2nd partition the other was 98% full.  So far it's balanced out recordings so that both are now running at 76% full.  What I would like to know is if you record two or more streams at the same time, whether they are to separate discs. That would be good.

Cheers

Ferg

----------

## drescherjm

 *Quote:*   

> What I would like to know is if you record two or more streams at the same time, whether they are to separate discs. That would be good. 

 

I am pretty sure storage groups has done this for a over a year now.

----------

## ferg

 *drescherjm wrote:*   

>  *Quote:*   What I would like to know is if you record two or more streams at the same time, whether they are to separate discs. That would be good.  
> 
> I am pretty sure storage groups has done this for a over a year now.

 

I meant Storage Groups not Disc groups!  I've only just upgraded to 0.21 so I'm only just getting used to the extra functions.

Now that you mention it I have noticed reduced thrashing when recording multiple streams and watching TV.  That is pretty cool!

Mythtv just keeps on getting better and better!!

Cheers

Ferg

----------

## drescherjm

I did mean storage groups. I have been using 0.21 svn since mid to late 2006 if my memory serves me well. I believe the reasons for moving from 0.20 to the svn code at that time were a combination of a broken mytharchive (av /sync problem) and storage groups. The av / sync was not fixed with 0.21 for a long time so I developed my own solution using projectx, however I am told that projectx code is now in mytharchive.

----------

## ferg

 *drescherjm wrote:*   

> I did mean storage groups..

 

I know you meant those.  I was wrong before, and I mean to say (in my usual unclear way!) that you was right and I'd called them the wrong name   :Smile: 

Cheers

Ferg

----------

## drescherjm

Sorry, When I read that yesterday I knew exactly what you were talking about to the point that I forgot you called it that. I did get a little stumped on your reply but I would like to say I had not had my coffee yet and it was early in the morning and I definitely not a morning person..  :Laughing: 

BTW, Storage groups got me in trouble last week so I would like to warn you of what happened to me. I was running out of space (apparently 700GB is not enough for my recordings...) so I added an additional drive to my storage groups but I forgot to change the permissions on the storage group so the permissions was root:root rwxr--r-- and to make a long story short since this drive was empty mythtv wanted to place all new shows here but since it could not write there I lost 3 days of recordings. I have since fixed the permissions issue and all is well. 

BTW2, With storage groups you can move recordings between the groups with no ill effects if you want. I have my storage groups sitting on top of LVM. My usage of lvm is only 1 drive per volume group - I never let LVM span disks.  So I have used this method a few times to reorganize my recordings so that I could allocate space for some other usage (programming) than myth.

----------

