On 10/27/05, <b class="gmail_sendername">Martin Ebourne</b> <<a href="mailto:lists@ebourne.me.uk">lists@ebourne.me.uk</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Wednesday, October 26, 2005 10:35 PM, Bryan Halter wrote:<br>> As far as I know if you lose a disk in an LVM dies you're SOL.<br><br>Wrong. At least for the LVM, obviously you've lost that disk.<br><br>On Thu, 27 Oct 2005 13:41:28 +0900, David Bennett wrote:
<br>> I have seen the same article about reducing the size on LVM... I guess I'm<br>> just unclear about what I would lose if I lost an LVM'd drive (stemming<br>> from the fact i dont know how LVM data is stored.) Are bits of one file
<br>> stored across multiple drives, or would the loss of a drive result in the<br>> loss of complete files?<br>><br>> I'd be curious to know if anyone has lost any an LVM drive with their Myth<br>> video directory and what happened...
<br><br>If a disk goes down in an LVM set this is what happens:<br><br>1. Your machine will probably not boot because the volume group is<br>incomplete. Make sure you've got a rescue CD to boot off for this<br>eventuality.
<br><br>An alternative that I use (my server has lots of disks, but<br>no CD) is to have two separate volume groups on different disks, each with<br>a root logical volume on. Thus I can boot into either LVM and none of the
<br>disks are shared between volume groups, so one will always boot.<br><br>2. Having booted from the rescue CD you need to activate your LVM:<br><br>vgchange -ay -P<br><br>That activates all logical volumes except any on a missing disk. This is
<br>the key command to get the system up again. -P is for partial volume group.<br><br>At this point any logical volumes entirely on a good disk are totally safe<br>and fully functional. Any logical volumes entirely on the bad disk are
<br>gone of course. Any logical volumes partially on the bad disk are there,<br>but the filesystem will be broken due to it missing a chunk. Best bet is<br>to try to fsck it, mount it readonly, and get the data off quick. YMMV
<br><br>3. Your system should reboot fine now, but without the disk and its<br>logical volumes.<br><br>Key points to learn from this to save your data:<br><br>1. Rescue CD or other means of booting<br><br>2. Don't stripe volumes. The default is not to, so if you didn't do this
<br>intentionally you're ok.<br><br>3. Don't split logical volumes over physical volumes unless you absolutely<br>have to.<br><br>Here I've got 10 logical volumes in 2 volume groups (main and backup),<br>over 5 physical volumes (disks). All but one of those logical volumes are
<br>on one disk only, and the one that's split over disks is only split<br>because it's bigger than any of the disks.<br><br>You can find out how your logical volumes are split by using:<br><br>lvdisplay -m<br><br>That lists the mapping to physical volumes.
<br><br>You can give a physical volume name to lvcreate and lvextend to control<br>the placement in future. You can use pvmove to fix any split logical<br>volumes you already have. (Assuming sufficient disk space to move stuff
<br>around.)<br><br>Cheers,<br><br>Martin.<br><br>_______________________________________________<br>mythtv-users mailing list<br><a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br><a href="http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users">
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users</a></blockquote><div><br><br>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... =_(
<br><br>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' (<a href="http://smartmontools.sourceforge.net/">
http://smartmontools.sourceforge.net/</a>) to monitor the disks, maybe next time I can replace the disk before it completely fails.... <br><br>Greg<br></div><br></div><br>