<br><br>
<div><span class="gmail_quote">On 9/23/08, <b class="gmail_sendername">Peter A. Castro</b> <<a href="mailto:doctor@fruitbat.org">doctor@fruitbat.org</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span class="q">On Tue, 23 Sep 2008, Larry Dickson wrote:<br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Bob,<br><br>Notes interpolated.<br><br>On 9/23/08, Peter A. Castro <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:doctor@fruitbat.org" target="_blank">doctor@fruitbat.org</a>> wrote:<br>

<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>On Tue, 23 Sep 2008, Bob Bell wrote:<br><br>Greetings, Bob,<br><br>I'm up a creek, and hoping someone out there can help rescue my data, or at<br>

<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">least tell me what went wrong so that I don't have a repeat event.  I'm<br>starting with this question on linux-lvm, though let me know if you think<br>
the discussion needs to be on linux-raid as well.<br><br>I'm setting up a new server running Ubuntu's Hardy Heron release.  `lvm<br>version` reports:<br>LVM version:     2.02.26 (2007-06-15)<br>Library version: 1.02.20 (2007-06-15)<br>
Driver version:  4.12.0<br>`uname -a` reports:<br>Linux sherwood 2.6.24-16-server #1 SMP Thu Apr 10 13:58:00 UTC 2008 i686<br>GNU/Linux<br><br>I initially created an md RAID5 device with only two components (matching<br>320 GB SATA HDDs).<br>
</blockquote><br><br></blockquote>This is puzzling, since by the usual definition, there is no such thing as a<br>2-disk RAID5. Your description of its virtual size indicates it is a RAID1,<br>or equivalent.<br></blockquote>
<br></span>While it's unusual to have only 2 disks in a "RAID5" (usally you want 3<br>drives min), it is possible, if unreliable (can you say<br>"half-of-a-mirror" ?)</blockquote>
<div> </div>
<div>If you are meaning a degraded 3-disk RAID5, then he should have had a virtual size of 640GB. He reported 320GB which would be the value expected of a RAID1. You can apply the RAID5 algorithm to 2 disks, but then you just get the equivalent of a RAID1, since a parity sector made so the XOR sum of it and ++ one ++ data sector is zero must equal that data sector.</div>

<div> </div>
<div>Larry</div><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><span class="q">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"> I created a single Physical Volume using the entirety of that md device<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">(320 GB), and then created several Logical Volumes for different filesystems<br>(all ext3).  This was done using the Ubuntu installer.  After installing I<br>
used lvresize to increase the size of a few of the Logical Volumes, as I was<br>conservative regarding the size during installation.  These filesystems hold<br>data that is not a critical part of the system (mail, music, video, etc.).<br>
</blockquote><br><br></blockquote>The LVs live atop the virtual md device so this should not have done<br>anything essentially disturbing.<br></blockquote><br></span>Yep, I have several VG's with LV's on top a several MDs without any trouble. 
<div><span class="e" id="q_11c91bc796a97e2a_4"><br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>(I also have a similar setup with a couple of IDE drives that I use for the<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">system (/home, /var, /boot, /), but I haven't touched those since the<br>install and they continue to work fine.)<br>
<br>I then copied data from a third matching 320 GB SATA HDD to one of the<br>Logical Volume filesystems on the md device.  After freeing up that drive<br>(by relocating its contents to the LVM/MD setup), I added the drive to the<br>
md device, which brought the total to 2 active devices and 1 spare device.<br> I then grew the number of devices to 3 and waited for  the reshape to<br>finish (increasing the capacity to 640 GB).<br></blockquote><br><br></blockquote>
If this is a reshape in md, then LVM should have seen nothing (since the 320<br>GB it knew about should still be there).<br><br> I bumped the values in /proc/sys/dev/raid/ so that I wouldn't have to<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">wait as long.<br><br></blockquote><br>My understanding of RAID5 is that once you configure the set of disks to<br>
the array, you can't just add an additional disk to it.  Attempting to do<br>so does more than just "reshape" the array, it changes the logical layout<br>of the sectors completely.  It's no wonder that LVM can't find anything,<br>
since it's data (if it survived the reorg) is no longer where it should<br>be.  And, once you've done this, there's really no going back to recover.<br>This is assuming my understanding of RAID5 is correct.<br>
</blockquote><br>I disagree, because assuming the md reshape operates intuitively, the old<br>320 GB of data should still be visible as the first 320 GB of data on the<br>new VIRTUAL 640GB device. And LVM should know nothing about the underlying<br>
RAIDing, so it should be happy to look there. However, I have no idea what<br>"bumped the values in /proc/sys/dev/raid/" means, or if it causes LVM to<br>look in the wrong places for things.<br></blockquote><br>
</span></div>I don't believe the MD/RAID5 operates in this way.  He started with a<br>2-disk RAID5 (effectively having the data logically interleaved between<br>the two drives), then he added an additional disk.  The way RAID works,<br>
it doesn't just add the disk space to the end of the array (that would<br>not create a recoverable scenario should it or one of the others fail),<br>it re-integrates and effectively re-interleaves the logical sectors to<br>
re-spread the data across all three drives.  The trouble is, I don't<br>think you can actually do this with current MD tech (I could be wrong).<br><br>Perhaps a better question would be to ask how, exactly, Bob create his<br>
array initially (what commands) and what steps he took to add the new<br>drive (again, what commands did he issue).  That would give us a better<br>idea of how the array looked before and after.<br><br>All of this is orthogonal to LVM, however.  I suspect a RAID/MD email<br>
list would be a better forum to discuss this. 
<div><span class="e" id="q_11c91bc796a97e2a_6"><br><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Larry Dickson<br>Cutting Edge Networked Storage<br><br>Now that the reshaping is completed, LVM can't find the physical volume on<br>

<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">that device anymore.  I tried rebooting the system, but the problem<br>remained. Checking /proc/mdstat shows that the md device is up and healthy.<br>
 The pvdisplay command only shows my other Physical Volume (for the IDE<br>drives). I found the pvck command and ran that on the md device, and it<br>states that there is no LVM label on the device.<br><br>It is my understanding that the steps I outlined should have worked.  I<br>
planned to follow them with pvresize, then lvresize, then umount, resize2fs,<br>and mount again.  I've seen this procedure outlined a few different places,<br>including at <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://gentoo-wiki.com/Resize_LVM2_on_RAID5" target="_blank">http://gentoo-wiki.com/Resize_LVM2_on_RAID5</a>.<br>
<br>Did I do something wrong?  Is there anyway to rescue my data?  I saved the<br>contents of /etc/lvm/backup/ when I noticed the problem -- perhaps that<br>might help?  If there's no way of saving the data, I'd at least like to<br>
figure out what happened in the first place.<br><br>Thank you.  Your thoughtfulness and help is appreciated.<br><br></blockquote><br>--<br>Peter A. Castro <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:doctor@fruitbat.org" target="_blank">doctor@fruitbat.org</a>> or <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Peter.Castro@oracle.com" target="_blank">Peter.Castro@oracle.com</a>><br>
      "Cats are just autistic Dogs" -- Dr. Tony Attwood<br><br>_______________________________________________<br>linux-lvm mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:linux-lvm@redhat.com" target="_blank">linux-lvm@redhat.com</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://www.redhat.com/mailman/listinfo/linux-lvm" target="_blank">https://www.redhat.com/mailman/listinfo/linux-lvm</a><br>read the LVM HOW-TO at <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://tldp.org/HOWTO/LVM-HOWTO/" target="_blank">http://tldp.org/HOWTO/LVM-HOWTO/</a><br>
<br></blockquote><br></blockquote><br>-- <br>Peter A. Castro <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:doctor@fruitbat.org" target="_blank">doctor@fruitbat.org</a>> or <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Peter.Castro@oracle.com" target="_blank">Peter.Castro@oracle.com</a>><br>
       "Cats are just autistic Dogs" -- Dr. Tony Attwood</span></div><br>_______________________________________________<br>linux-lvm mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:linux-lvm@redhat.com">linux-lvm@redhat.com</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://www.redhat.com/mailman/listinfo/linux-lvm" target="_blank">https://www.redhat.com/mailman/listinfo/linux-lvm</a><br>read the LVM HOW-TO at <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://tldp.org/HOWTO/LVM-HOWTO/" target="_blank">http://tldp.org/HOWTO/LVM-HOWTO/</a><br>
_______________________________________________<br>linux-lvm mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:linux-lvm@redhat.com">linux-lvm@redhat.com</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://www.redhat.com/mailman/listinfo/linux-lvm" target="_blank">https://www.redhat.com/mailman/listinfo/linux-lvm</a><br>
read the LVM HOW-TO at <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://tldp.org/HOWTO/LVM-HOWTO/" target="_blank">http://tldp.org/HOWTO/LVM-HOWTO/</a><br></blockquote></div><br>