1

short story:
I have got a RAID5 which should have a Volumegroup on it, but I can't find it using lvmdiskscan or vgscan or pvscan.
Is there a way to convince LVM that this is a VG?

long story:
I had a synology nas, running perfectly fine. After warranty expired the topmost bay of the device broke down, so I moved all disks into a linux-server.
I realized that Synology has a strange setup: madam as RAID5, this whole RAID is a VG (yes with only one device), and on top of that was ext4 (I was planning to move everything into one zfs...)
Which was again running, but the "server" was an old home-computer, so once in a while it dropped a drive and I had to reboot the computer. Yesterday I had the issue again (after running 72 days) and reassemled it. During reassembling, a disk was marked "faulty". So I had: ok, ok, spare, faulty.
Since I had no other choice I enforced assembling with the 3 drives (ok, ok, probably out of date) and rebuilt the spare.

Now after rebuilding I was trying to bring up my volume again and can not find my VG using lvmdiskscan or vgscan or pvscan.
Is it possible to enforce it back into a VG?
Is pvcreate and vgcreate altering the data on my device (since this is was my file-storage, I can't create a backup - because i have no storage with this much space)?
any other possibilities to recover my lvm?

edit
meanwhile i found a lvm-backup file:

root@nas:/etc/lvm/backup# cat vg1000
# Generated by LVM2 version 2.02.122(2) (2015-06-20): Wed Mar 23 10:17:07 2016

contents = "Text Format Volume Group"
version = 1

description = "Created *after* executing 'vgcfgbackup'"

creation_host = "nas"   # Linux clemens-nas 4.2.0-34-generic #39-Ubuntu SMP Thu Mar 10 22:13:01 UTC 2016 x86_64
creation_time = 1458724627      # Wed Mar 23 10:17:07 2016

vg1000 {
        id = "MLeMiv-dRXp-78wD-HoCO-h6fi-eydd-rQbkad"
        seqno = 2
        format = "lvm2"                 # informational
        status = ["RESIZEABLE", "READ", "WRITE"]
        flags = []
        extent_size = 8192              # 4 Megabytes
        max_lv = 0
        max_pv = 0
        metadata_copies = 0

        physical_volumes {

                pv0 {
                        id = "Bu14mQ-Yddn-mkvH-Bc17-E3nR-wlmM-XZx6yD"
                        device = "/dev/md2"     # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 11692677888  # 5,44483 Terabytes
                        pe_start = 1152
                        pe_count = 1427328      # 5,44482 Terabytes
                }
        }

        logical_volumes {

                lv {
                        id = "Bofw9D-3tnK-y9wM-dJRf-Aoq2-hONI-yRnMyu"
                        status = ["READ", "WRITE", "VISIBLE"]
                        flags = []
                        segment_count = 1

                        segment1 {
                                start_extent = 0
                                extent_count = 1427328  # 5,44482 Terabytes

                                type = "striped"
                                stripe_count = 1        # linear

                                stripes = [
                                        "pv0", 0
                                ]
                        }
                }
        }
}
  • Which commands did you use to recover your RAID? Any mdadm --examine output before/after, or dmesg of the assembly process before/after? – frostschutz Mar 5 '17 at 11:08
  • Use with caution: pvcreate --restore /mnt/etc/lvm/backup/vg1000 --uuid "Bu14mQ-Yddn-mkvH-Bc17-E3nR-wlmM-XZx6yD" /dev/mdx where dev/mdx is your RAID; then vgcfgrestore -f /mnt/etc/lvm/backup/vg1000 vg1000. See e.g. centos.org/docs/5/html/Cluster_Logical_Volume_Manager/… – ridgy Mar 5 '17 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.