Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Recover LVM

  1. #1
    Join Date
    May 2010
    Beans
    17

    Recover LVM

    Hi,

    Need help.

    I setup LVM on a box and transferred some files to a logical volume. Installed Ubuntu on the box after exporting the volumegroup. So, I have no backup of LVM.

    Now, on my box, I did this:

    vgimport vg01

    vgdisplay shows no PE allocated and no volumes available.

    Anything I can do to get the volume back?

  2. #2
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,558
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Recover LVM

    I haven't tried export/import procedure of LVM, but in order to use LVM you need to activate it with something like:
    sudo vgchange -ay

    Provided all the necessary info is there, it should activate it and list the available LVs.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  3. #3
    Join Date
    May 2010
    Beans
    17

    Re: Recover LVM

    Quote Originally Posted by darkod View Post
    I haven't tried export/import procedure of LVM, but in order to use LVM you need to activate it with something like:
    sudo vgchange -ay

    Provided all the necessary info is there, it should activate it and list the available LVs.
    I have tried this and it tells me 0 logical volumes available. lvdisplay shows no logical volumes available either.

  4. #4
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,558
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Recover LVM

    lvdisplay is after they are activated. For searching before LVM is activated you use pvscan, vgscan and lvscan.

    But even without any search vgchange should activate all LVM devices it finds.

    It seems the export/import process was not done successfully. So because of that, vgchange is not activating any LVM because there is none to activate. See if pvscan can detect any physical devices at all.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  5. #5
    Join Date
    May 2010
    Beans
    17

    Re: Recover LVM

    Quote Originally Posted by darkod View Post
    lvdisplay is after they are activated. For searching before LVM is activated you use pvscan, vgscan and lvscan.

    But even without any search vgchange should activate all LVM devices it finds.

    It seems the export/import process was not done successfully. So because of that, vgchange is not activating any LVM because there is none to activate. See if pvscan can detect any physical devices at all.
    I have done the respective pvscan, lvscan, vgscan. The vg was detected automatically as exported so I imported it. But no lvs are showing. I'm wondering why the heck it's disappeared, along with a good 2TB of data

  6. #6
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,558
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Recover LVM

    I have no clue. Maybe the export procedure was missing something, for example it might not have exported the LVs as you expected.

    I assume you no longer have the original disks?
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  7. #7
    Join Date
    May 2010
    Beans
    17

    Re: Recover LVM

    Quote Originally Posted by darkod View Post
    I have no clue. Maybe the export procedure was missing something, for example it might not have exported the LVs as you expected.

    I assume you no longer have the original disks?
    I do not, no.

  8. #8
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,558
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Recover LVM

    In that case it doesn't look good. If the LVM was OK, then vgchange would activate it and the LVs would be ready for use. There is not much procedure to it.

    I am surprised you decided to do export instead of simple copy of the data. You still needed space to guard the export, so it would have been much better to simply copy the data there.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  9. #9
    Join Date
    May 2010
    Beans
    17

    Re: Recover LVM

    Quote Originally Posted by darkod View Post
    In that case it doesn't look good. If the LVM was OK, then vgchange would activate it and the LVs would be ready for use. There is not much procedure to it.

    I am surprised you decided to do export instead of simple copy of the data. You still needed space to guard the export, so it would have been much better to simply copy the data there.
    So you are using it's against LVM best-practice to export and import? How can you transfer, using same set of drives, to another box then

  10. #10
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,558
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Recover LVM

    I'm not sure I understood correctly. You are talking about moving the same disks from one machine to another?

    Simply connect the disks into the new machine and activate the LVM with the already mentioned:
    sudo vgchange -ay

    That's all. The LVs with all data will be available.

    If the OS is actually onto the LVM you would need do few more steps but the principle is the same. If the LVM is only for data, no OS, then only moving the disks and doing the vgchange should be enough.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •