<div dir="ltr">Hi,<br>Yesterday my harddrive had an inconvenient event: when I was using a d-i from testing I accidentally overwritten on of the pv&#39;s connected to the lvm.<br>I  started to panic  and found myself making more damage by running <span dir="ltr">vgreduce --<em>remove</em>-<em>missing</em></span> since in one of the rescue files it noted this is the way to fix it.<br>
<br>the config was : <br><br>/dev/sda7 pv0<br>/dev/sda8 pv1<br><br>digging in the parrtion i found the lvm declaration : <br><br>00000200  4c 41 42 45 4c 4f 4e 45  01 00 00 00 00 00 00 00  |LABELONE........|<br>00000210  e1 4c e7 48 20 00 00 00  4c 56 4d 32 20 30 30 31  |.L.H ...LVM2 001|<br>
00000220  47 42 73 58 46 51 52 64  58 53 69 4d 68 70 50 68  |GBsXFQRdXSiMhpPh|<br>00000230  6c 65 69 71 66 4d 35 35  37 31 61 4a 67 51 41 61  |leiqfM5571aJgQAa|<br>00000240  00 8c 71 7c 07 00 00 00  00 00 03 00 00 00 00 00  |..q|............|<br>
00000250  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|<br>00000260  00 00 00 00 00 00 00 00  00 10 00 00 00 00 00 00  |................|<br>00000270  00 f0 02 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|<br>
00000280  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|<br><br>digging in the raw data of the /dev/sda7 (I think) I found(*)  the filesystems that were on the lvm  : <br><br>0002fff0  b8 ff 74 b8 ff 74 b8 ff  74 b8 ff 74 b8 ff 74 b8  |..t..t..t..t..t.|<br>
00030000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|<br>*<br>00030400  00 20 25 00 00 70 94 00  00 6c 07 00 13 13 4e 00  |. %..p...l....N.|<br>00030410  01 f0 24 00 00 00 00 00  02 00 00 00 02 00 00 00  |..$.............|<br>
00030420  00 80 00 00 00 80 00 00  00 20 00 00 05 dc b0 4c  |......... .....L|<br>00030430  c4 df b0 4c a2 01 25 00  53 ef 01 00 01 00 00 00  |...L..%.S.......|<br>00030440  ae b0 f2 4a 00 4e ed 00  00 00 00 00 01 00 00 00  |...J.N..........|<br>
00030450  00 00 00 00 0b 00 00 00  00 01 00 00 3c 00 00 00  |............&lt;...|<br>00030460  02 00 00 00 03 00 00 00  6f c8 71 b2 99 4e 4c 1f  |........o.q..NL.|<br>00030470  85 25 3e e9 9a 2c 55 45  00 00 00 00 00 00 00 00  |.%&gt;..,UE........|<br>
00030480  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|<br><br>knowing the sizes I dd data (this is from memory) - I think the partition startes  30000 hence 3*16^4 / 1024 = 192 <br><br>dd if=/dev/sda7 of=filename bs=1024 count=16M seek=192<br>
tried to mount but without success.<br><br><br>(1) - hd /dev/sda7 | less found what i think is the superblock : <br><br><br>I found that during the tut I run the hence getting a backup of some of the data (from backup/fileserver)<br>
<br># Generated by LVM2 version 2.02.66(2) (2010-05-20): Sun Oct 10 01:09:27 2010<br><br>contents = &quot;Text Format Volume Group&quot;<br>version = 1<br><br>description = &quot;Created *after* executing &#39;vgcfgbackup&#39;&quot;<br>
<br>creation_host = &quot;midgard&quot;       # Linux midgard 2.6.32-5-amd64 #1 SMP Thu Aug 12 13:01:50 UTC 2010 x86_64<br>creation_time = 1286665767      # Sun Oct 10 01:09:27 2010<br><br>fileserver {<br>        id = &quot;YKE4Rs-gcaS-oWuy-8dVG-0Loq-MrsL-8m7K8v&quot;<br>
        seqno = 11<br>        status = [&quot;RESIZEABLE&quot;, &quot;READ&quot;, &quot;WRITE&quot;]<br>        flags = []<br>        extent_size = 8192              # 4 Megabytes<br>        max_lv = 0<br>        max_pv = 0<br>
<br>        physical_volumes {<br><br>                pv0 {<br>                        id = &quot;GBsXFQ-RdXS-iMhp-Phle-iqfM-5571-aJgQAa&quot;<br>                        device = &quot;/dev/sda7&quot;    # Hint only<br><br>
                        status = [&quot;ALLOCATABLE&quot;]<br>                        flags = []<br>                        dev_size = 62798022     # 29.9444 Gigabytes<br>                        pe_start = 384<br>                        pe_count = 7665 # 29.9414 Gigabytes<br>
                }<br><br>                pv1 {<br>                        id = &quot;fVkJmY-pdwD-bub8-URE8-lNc2-eyhr-IIxIez&quot;<br>                        device = &quot;unknown device&quot;       # Hint only<br><br>                        status = [&quot;ALLOCATABLE&quot;]<br>
                        flags = [&quot;MISSING&quot;]<br>                        dev_size = 79409232     # 37.8653 Gigabytes<br>                        pe_start = 384<br>                        pe_count = 9693 # 37.8633 Gigabytes<br>
                }<br>        }<br><br>        logical_volumes {<br><br>                video {<br>                        id = &quot;wuLloD-3u0J-YHeu-Glxk-fsbC-tOyp-RbGBws&quot;<br>                        status = [&quot;READ&quot;, &quot;WRITE&quot;, &quot;VISIBLE&quot;]<br>
                        flags = []<br>                        segment_count = 2<br><br>                        segment1 {<br>                                start_extent = 0<br>                                extent_count = 7665     # 29.9414 Gigabytes<br>
<br>                                type = &quot;striped&quot;<br>                                stripe_count = 1        # linear<br><br>                                stripes = [<br>                                        &quot;pv0&quot;, 0<br>
                                ]<br>                        }<br>                        segment2 {<br>                                start_extent = 7665<br>                                extent_count = 2063     # 8.05859 Gigabytes<br>
<br>                                type = &quot;striped&quot;<br>                                stripe_count = 1        # linear<br><br>                                stripes = [<br>                                        &quot;pv1&quot;, 0<br>
                                ]<br>                        }<br>                }<br><br>                audio {<br>                        id = &quot;a1U4E0-7c1G-TqLc-p7H0-ZcQc-QMZI-1znD0K&quot;<br>                        status = [&quot;READ&quot;, &quot;WRITE&quot;, &quot;VISIBLE&quot;]<br>
                        flags = []<br>                        segment_count = 2<br><br>                        segment1 {<br>                                start_extent = 0<br>                                extent_count = 2560     # 10 Gigabytes<br>
<br>                                type = &quot;striped&quot;<br>                                stripe_count = 1        # linear<br><br>                                stripes = [<br>                                        &quot;pv1&quot;, 5135<br>
                                ]<br>                        }<br>                        segment2 {<br>                                start_extent = 2560<br>                                extent_count = 768      # 3 Gigabytes<br>
<br>                                type = &quot;striped&quot;<br>                                stripe_count = 1        # linear<br><br>                                stripes = [<br>                                        &quot;pv1&quot;, 4161<br>
                                ]<br>                        }<br>                }<br><br>                opt {<br>                        id = &quot;npePvz-nfHw-ILxe-K1oX-bmxa-HTfn-wfkRi2&quot;<br>                        status = [&quot;READ&quot;, &quot;WRITE&quot;, &quot;VISIBLE&quot;]<br>
                        flags = []<br>                        segment_count = 2<br><br>                        segment1 {<br>                                start_extent = 0<br>                                extent_count = 1998     # 7.80469 Gigabytes<br>
<br>                                type = &quot;striped&quot;<br>                                stripe_count = 1        # linear<br><br>                                stripes = [<br>                                        &quot;pv1&quot;, 7695<br>
                                ]<br>                        }<br>                        segment2 {<br>                                start_extent = 1998<br>                                extent_count = 2098     # 8.19531 Gigabytes<br>
<br>                                type = &quot;striped&quot;<br>                                stripe_count = 1        # linear<br><br>                                stripes = [<br>                                        &quot;pv1&quot;, 2063<br>
                                ]<br>                        }<br>                }<br>        }<br>}<br><br><br>tried doing : .<br><br> vgcfgrestore -f fileserver fileserver<br>  Couldn&#39;t find device with uuid fVkJmY-pdwD-bub8-URE8-lNc2-eyhr-IIxIez.<br>
  Cannot restore Volume Group fileserver with 1 PVs marked as missing.<br>  Restore failed.<br>  <br>
</div>