linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: "\"Rainer Fügenstein\"" <rfu@oudeis.org>
To: linux-lvm@redhat.com
Subject: [linux-lvm] recover volume group & locical volumes from PV?
Date: Sun, 12 May 2019 00:52:49 +0200	[thread overview]
Message-ID: <3f6f98d1b5184853cf48b1f84337af83.squirrel@service.net-works.at> (raw)

hi,

I am (was) using Fedora 28 installed in several LVs on /dev/sda5 (= PV),
where sda is a "big" SSD.

by accident, I attached (via SATA hot swap bay) an old harddisk
(/dev/sdc1), which was used about 2 months temporarily to move the volume
group / logical volumes from the "old" SSD to the "new" SSD (pvadd,
pvmove, ...)

this combination of old PV and new PV messed up the filesystems. when I
noticed the mistake, I did a shutdown and physically removed /dev/sdc.
this also removed VG and LVs on /dev/sda5, causing the system crash on
boot.

the layout was something like this:

/dev/sda3 ==> /boot
/dev/fedora_sh64/lv_home
/dev/fedora_sh64/lv_root
/dev/fedora_sh64/lv_var
...

[root@localhost-live ~]# pvs
  PV         VG Fmt  Attr PSize   PFree
  /dev/sda5     lvm2 ---  <47.30g <47.30g

[root@localhost-live ~]# pvdisplay
  "/dev/sda5" is a new physical volume of "<47.30 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sda5
  VG Name
  PV Size               <47.30 GiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               EOi5Ln-W26D-SER2-tLke-xNMP-Prgq-aUfLPz

(please note "NEW Physical Volume" ?!?!)

[root@localhost-live ~]# vgdisplay
[root@localhost-live ~]# lvdisplay

[root@localhost-live ~]# pvscan
  PV /dev/sda5                      lvm2 [<47.30 GiB]
  Total: 1 [<47.30 GiB] / in use: 0 [0   ] / in no VG: 1 [<47.30 GiB]

[root@localhost-live ~]# pvck /dev/sda5
  Found label on /dev/sda5, sector 1, type=LVM2 001
  Found text metadata area: offset=4096, size=1044480

after re-adding the old /dev/sdc1 disk, VG and LVs show up, filesystems a
bit damaged, but readable. content is about two months old.

[root@localhost-live ~]# pvs
  PV         VG              Fmt  Attr PSize    PFree
  /dev/sda5                  lvm2 ---   <47.30g <47.30g
  /dev/sdc1  fedora_sh64     lvm2 a--  <298.09g 273.30g

is there any chance to get VG and LVs back?

thanks in advance.

             reply	other threads:[~2019-05-11 22:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-11 22:52 "Rainer Fügenstein" [this message]
2019-05-12  0:09 ` [linux-lvm] recover volume group & locical volumes from PV? Roger Heflin
2019-05-13  8:37 ` Zdenek Kabelac
2019-05-13 15:17   ` Rainer Fügenstein
2019-05-15 16:55   ` Rainer Fügenstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3f6f98d1b5184853cf48b1f84337af83.squirrel@service.net-works.at \
    --to=rfu@oudeis.org \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).