[mythtv-users] An LVM'd drive died! What do I do...
geflatt at gmail.com
Thu Oct 27 08:23:57 EDT 2005
On 10/27/05, Martin Ebourne <lists at ebourne.me.uk> wrote:
> On Wednesday, October 26, 2005 10:35 PM, Bryan Halter wrote:
> > As far as I know if you lose a disk in an LVM dies you're SOL.
> Wrong. At least for the LVM, obviously you've lost that disk.
> On Thu, 27 Oct 2005 13:41:28 +0900, David Bennett wrote:
> > I have seen the same article about reducing the size on LVM... I guess
> > just unclear about what I would lose if I lost an LVM'd drive (stemming
> > from the fact i dont know how LVM data is stored.) Are bits of one file
> > stored across multiple drives, or would the loss of a drive result in
> > loss of complete files?
> > I'd be curious to know if anyone has lost any an LVM drive with their
> > video directory and what happened...
> If a disk goes down in an LVM set this is what happens:
> 1. Your machine will probably not boot because the volume group is
> incomplete. Make sure you've got a rescue CD to boot off for this
> An alternative that I use (my server has lots of disks, but
> no CD) is to have two separate volume groups on different disks, each with
> a root logical volume on. Thus I can boot into either LVM and none of the
> disks are shared between volume groups, so one will always boot.
> 2. Having booted from the rescue CD you need to activate your LVM:
> vgchange -ay -P
> That activates all logical volumes except any on a missing disk. This is
> the key command to get the system up again. -P is for partial volume
> At this point any logical volumes entirely on a good disk are totally safe
> and fully functional. Any logical volumes entirely on the bad disk are
> gone of course. Any logical volumes partially on the bad disk are there,
> but the filesystem will be broken due to it missing a chunk. Best bet is
> to try to fsck it, mount it readonly, and get the data off quick. YMMV
> 3. Your system should reboot fine now, but without the disk and its
> logical volumes.
> Key points to learn from this to save your data:
> 1. Rescue CD or other means of booting
> 2. Don't stripe volumes. The default is not to, so if you didn't do this
> intentionally you're ok.
> 3. Don't split logical volumes over physical volumes unless you absolutely
> have to.
> Here I've got 10 logical volumes in 2 volume groups (main and backup),
> over 5 physical volumes (disks). All but one of those logical volumes are
> on one disk only, and the one that's split over disks is only split
> because it's bigger than any of the disks.
> You can find out how your logical volumes are split by using:
> lvdisplay -m
> That lists the mapping to physical volumes.
> You can give a physical volume name to lvcreate and lvextend to control
> the placement in future. You can use pvmove to fix any split logical
> volumes you already have. (Assuming sufficient disk space to move stuff
> mythtv-users mailing list
> mythtv-users at mythtv.org
I lost a HD on my LVM last week and ended up losing everything, I wasn't
able to get my data off the drive no matter what I did. My recordings were
recorded over two drives. I was using the -P switch but wasn't able to
access the vg that was split across the two drives so I couldn't fsck it.
Maybe I missed a step suggested here... =_(
I guess when I replace the disk I'll try LVM again, but test a recover by
unplugging a drive and see if I can recover the remaining data... Since the
failure I decide to install 'smartmontools' (
http://smartmontools.sourceforge.net/) to monitor the disks, maybe next time
I can replace the disk before it completely fails....
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mythtv-users