<font size="4"><div>Matt,</div><div>You've had to deal with LVM a lot more than I have so I'm asking for some thoughts. I plugged up an external USB drive to the fileserver to create a partition table, format, and copy data over on to the USB drive. Well, I looked at /proc/partitions and ran fdisk on /dev/sda instead of the right device, /dev/sdd. I created a DOS partition table, created a single primary partition, synced and exited fdisk. Then, I realized that /dev/sdd was the right device and it already had partitions and data. Great. So, I'm trying to figure out what the hell I just did to the file server. It's still up and running but a reboot would probably be disastrous. Anyway I have several pieces of data below relating to the devices, partitions, and lvm data. I may have wiped out the system lvm data off of /dev/sda. The fs1 volume shows but the system volume doesn't. Does that make sense? Is there a way to rewrite the lvm data? Just remember that /dev/sda didn't have any partition table or partition, as shown below, before this moment. I also think that the devices dm-0, sda, and lvm system are the same filesystem/devices that make up the /home where all the critical data is. Sure, I have backups of the most important user directories using bacula, but not a mirror copy of everything as is. I have archived copies of older data that would make up the difference, but what a stupid pain to have committed. I'm wondering if this can be like grub, where reinstalling the master boot record doesn't harm the system. How do you rewrite the lvm data without wiping out the mounted filesystem?</div>
<div><br></div><div>Ubuntu 8.04</div><div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">//fs1> show</font></div><div><font face="courier new, monospace"><br></font></div>
<div><font face="courier new, monospace">Ctl Model (V)Ports Drives Units NotOpt RRate VRate BBU</font></div><div><font face="courier new, monospace">------------------------------------------------------------------------</font></div>
<div><font face="courier new, monospace">c0 9550SXU-8LP 8 8 3 0 1 3 - </font></div></div><div><font face="courier new, monospace"><div>//fs1> /c0 show</div><div><br></div><div>
Unit UnitType Status %RCmpl %V/I/M Stripe Size(GB) Cache AVrfy</div><div>------------------------------------------------------------------------------</div><div>u0 RAID-5 VERIFY-PAUSED - 0 64K 1862.61 ON ON </div>
<div>u1 SINGLE VERIFY-PAUSED - 0 - 465.651 ON ON </div><div>u2 RAID-1 VERIFY-PAUSED - 0 - 232.82 ON ON </div><div><br></div><div>Port Status Unit Size Blocks Serial</div>
<div>---------------------------------------------------------------</div><div>p0 OK u0 465.76 GB 976773168 WD-WCANU1733818 </div><div>p1 OK u0 465.76 GB 976773168 WD-WCANU1733754 </div>
<div>p2 OK u0 465.76 GB 976773168 WD-WCANU1735394 </div><div>p3 OK u0 465.76 GB 976773168 WD-WCANU1888007 </div><div>p4 OK u0 465.76 GB 976773168 WD-WCANU1735961 </div>
<div>p5 VERIFYING u1 465.76 GB 976773168 WD-WCANU1731650 </div><div>p6 OK u2 233.76 GB 490234752 WD-WCANY2372724 </div><div>p7 OK u2 233.76 GB 490234752 WD-WCANY2774785</div>
</font></div>
<div><br></div><div><div><font face="courier new, monospace">root@fs1:/etc/lvm/backup# cat /proc/partitions </font></div><div><font face="courier new, monospace">major minor #blocks name</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace"> 8 0 1953083392 sda</font></div><div><font face="courier new, monospace"> 8 1 1953078246 sda1</font></div><div><font face="courier new, monospace"> 8 16 488270848 sdb</font></div>
<div><font face="courier new, monospace"> 8 32 244129792 sdc</font></div><div><font face="courier new, monospace"> 8 33 248976 sdc1</font></div><div><font face="courier new, monospace"> 8 34 1 sdc2</font></div>
<div><font face="courier new, monospace"> 8 37 243874701 sdc5</font></div><div><font face="courier new, monospace"> 254 0 1932738560 dm-0</font></div><div><font face="courier new, monospace"> 254 1 240799744 dm-1</font></div>
<div><font face="courier new, monospace"> 254 2 3072000 dm-2</font></div><div><font face="courier new, monospace"> 8 48 488386584 sdd</font></div><div><font face="courier new, monospace"> 8 49 488384001 sdd1</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">root@fs1:/etc/lvm/backup# df -h</font></div><div><font face="courier new, monospace">Filesystem Size Used Avail Use% Mounted on</font></div>
<div><font face="courier new, monospace">/dev/mapper/fs1-root 228G 17G 201G 8% /</font></div>
<div><font face="courier new, monospace">varrun 501M 84K 501M 1% /var/run</font></div><div><font face="courier new, monospace">varlock 501M 0 501M 0% /var/lock</font></div><div><font face="courier new, monospace">udev 501M 68K 501M 1% /dev</font></div>
<div><font face="courier new, monospace">devshm 501M 0 501M 0% /dev/shm</font></div><div><font face="courier new, monospace">/dev/sdc1 236M 26M 198M 12% /boot</font></div><div><font face="courier new, monospace">/dev/mapper/system-home</font></div>
<div><font face="courier new, monospace"> 1.8T 1.7T 71G 96% /home</font></div><div><font face="courier new, monospace">/dev/sdd1 459G 18G 418G 5% /mnt</font></div></div><div><font face="courier new, monospace"><br>
</font></div><div><div><font face="courier new, monospace">root@fs1:/etc/lvm/backup# pvdisplay</font></div><div><font face="courier new, monospace"> --- Physical volume ---</font></div><div><font face="courier new, monospace"> PV Name /dev/sdc5</font></div>
<div><font face="courier new, monospace"> VG Name fs1</font></div><div><font face="courier new, monospace"> PV Size 232.58 GB / not usable 2.89 MB</font></div><div><font face="courier new, monospace"> Allocatable yes (but full)</font></div>
<div><font face="courier new, monospace"> PE Size (KByte) 4096</font></div><div><font face="courier new, monospace"> Total PE 59539</font></div><div><font face="courier new, monospace"> Free PE 0</font></div>
<div><font face="courier new, monospace"> Allocated PE 59539</font></div><div><font face="courier new, monospace"> PV UUID PjgniS-zP39-TvRu-EabS-wv1Q-Un5g-ROMg6c</font></div></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace"><div><br></div><div>root@fs1:~/tw# pvdisplay -m</div><div> --- Physical volume ---</div><div> PV Name /dev/sdc5</div><div> VG Name fs1</div>
<div> PV Size 232.58 GB / not usable 2.89 MB</div><div> Allocatable yes (but full)</div><div> PE Size (KByte) 4096</div><div> Total PE 59539</div><div> Free PE 0</div>
<div> Allocated PE 59539</div><div> PV UUID PjgniS-zP39-TvRu-EabS-wv1Q-Un5g-ROMg6c</div><div> </div><div> --- Physical Segments ---</div><div> Physical extent 0 to 58788:</div><div> Logical volume<span class="Apple-tab-span" style="white-space:pre">        </span>/dev/fs1/root</div>
<div> Logical extents<span class="Apple-tab-span" style="white-space:pre">        </span>0 to 58788</div><div> Physical extent 58789 to 59538:</div><div> Logical volume<span class="Apple-tab-span" style="white-space:pre">        </span>/dev/fs1/swap_1</div>
<div> Logical extents<span class="Apple-tab-span" style="white-space:pre">        </span>0 to 749</div><div><br></div><div><br></div></font></div><div><font face="courier new, monospace">root@fs1:/etc/lvm/backup# cat fs1</font></div>
<div><font face="courier new, monospace"># Generated by LVM2: Tue Mar 29 17:45:03 2011</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">contents = "Text Format Volume Group"</font></div><div><font face="courier new, monospace">version = 1</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">description = "Created *after* executing '/sbin/vgcfgbackup'"</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace">creation_host = "fs1"<span style="white-space:pre-wrap">        </span># Linux fs1 2.6.24-19-server #1 SMP Wed Aug 20 18:43:06 UTC 2008 x86_64</font></div>
<div><font face="courier new, monospace">creation_time = 1301435103<span style="white-space:pre-wrap">        </span># Tue Mar 29 17:45:03 2011</font></div><div><font face="courier new, monospace"><br></font></div>
<div><font face="courier new, monospace">fs1 {</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>id = "7uN1mJ-igIG-pPaN-bpGX-bux9-uDzG-4FnyA9"</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>seqno = 3</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>status = ["RESIZEABLE", "READ", "WRITE"]</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>extent_size = 8192<span style="white-space:pre-wrap">                </span># 4 Megabytes</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>max_lv = 0</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>max_pv = 0</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>physical_volumes {</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                </span>pv0 {</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>id = "PjgniS-zP39-TvRu-EabS-wv1Q-Un5g-ROMg6c"</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>device = "/dev/sdc5"<span style="white-space:pre-wrap">        </span># Hint only</font></div><div>
<font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>status = ["ALLOCATABLE"]</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>dev_size = 487749402<span style="white-space:pre-wrap">        </span># 232.577 Gigabytes</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>pe_start = 384</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>pe_count = 59539<span style="white-space:pre-wrap">        </span># 232.574 Gigabytes</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                </span>}</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>}</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>logical_volumes {</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                </span>root {</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>id = "cIME9h-qhSB-HupF-KWVM-osd6-gVjA-xoHrQb"</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>status = ["READ", "WRITE", "VISIBLE"]</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>segment_count = 1</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>segment1 {</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>start_extent = 0</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>extent_count = 58789<span style="white-space:pre-wrap">        </span># 229.645 Gigabytes</font></div><div>
<font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>type = "striped"</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>stripe_count = 1<span style="white-space:pre-wrap">        </span># linear</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>stripes = [</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                        </span>"pv0", 0</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>]</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>}</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                </span>}</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                </span>swap_1 {</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>id = "Gd7qqR-ns4G-NaKW-ys57-vdXs-hm7N-1vFHRf"</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>status = ["READ", "WRITE", "VISIBLE"]</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>segment_count = 1</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>segment1 {</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>start_extent = 0</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>extent_count = 750<span style="white-space:pre-wrap">        </span># 2.92969 Gigabytes</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>type = "striped"</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>stripe_count = 1<span style="white-space:pre-wrap">        </span># linear</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>stripes = [</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                        </span>"pv0", 58789</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>]</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>}</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                </span>}</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>}</font></div>
<div><font face="courier new, monospace">}</font></div><div><font face="courier new, monospace"><br></font></div><div><div><font face="courier new, monospace">root@fs1:/etc/lvm/backup# cat system </font></div><div><font face="courier new, monospace"># Generated by LVM2: Tue Mar 29 17:45:03 2011</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">contents = "Text Format Volume Group"</font></div><div><font face="courier new, monospace">version = 1</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">description = "Created *after* executing '/sbin/vgcfgbackup'"</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace">creation_host = "fs1"<span style="white-space:pre-wrap">        </span># Linux fs1 2.6.24-19-server #1 SMP Wed Aug 20 18:43:06 UTC 2008 x86_64</font></div>
<div><font face="courier new, monospace">creation_time = 1301435103<span style="white-space:pre-wrap">        </span># Tue Mar 29 17:45:03 2011</font></div><div><font face="courier new, monospace"><br></font></div>
<div><font face="courier new, monospace">system {</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>id = "VbCivG-iIUw-lPGB-6mT3-iUFd-p86P-pr7H52"</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>seqno = 2</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>status = ["RESIZEABLE", "READ", "WRITE"]</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>extent_size = 8192<span style="white-space:pre-wrap">                </span># 4 Megabytes</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>max_lv = 0</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>max_pv = 0</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>physical_volumes {</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                </span>pv0 {</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>id = "N7YakG-Gi8X-0bt1-j8Uc-42GX-D8kU-RfOaR8"</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>device = "/dev/sda"<span style="white-space:pre-wrap">        </span># Hint only</font></div><div>
<font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>status = ["ALLOCATABLE"]</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>dev_size = 9223372036854775807<span style="white-space:pre-wrap">        </span># 4 (null)</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>pe_start = 384</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>pe_count = 476826<span style="white-space:pre-wrap">        </span># 1.81895 Terabytes</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                </span>}</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>}</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>logical_volumes {</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                </span>home {</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>id = "FAnBXD-wDB7-0dbx-Hl0V-bwTu-Jace-a6pG0M"</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>status = ["READ", "WRITE", "VISIBLE"]</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>segment_count = 1</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>segment1 {</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>start_extent = 0</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>extent_count = 471860<span style="white-space:pre-wrap">        </span># 1.8 Terabytes</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>type = "striped"</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>stripe_count = 1<span style="white-space:pre-wrap">        </span># linear</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>stripes = [</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                        </span>"pv0", 0</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                                </span>]</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">                        </span>}</font></div>
<div><font face="courier new, monospace"><span style="white-space:pre-wrap">                </span>}</font></div><div><font face="courier new, monospace"><span style="white-space:pre-wrap">        </span>}</font></div>
<div><font face="courier new, monospace">}</font></div></div><div><font face="courier new, monospace"><br></font></div><div><br></div><div><br></div></font><font size="4">Sincerely,<br>
Dow<br>________________________________________________<br>Dow Hurst, Research Scientist<br>340 Sullivan Science Bldg., Dept. of Chem. and Biochem.<br>University of North Carolina at Greensboro<br>PO Box 26170 Greensboro, NC 27402-6170</font><br>
<br><br>