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