Recovering lvm over RAID5 Linux using R-Studio

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Recovering lvm over RAID5 Linux using R-Studio

Re: Recovering lvm over RAID5 Linux using R-Studio

by Corsari » Thu May 15, 2014 1:34 am

@kellogs

If you need help

feel free to ask me with a private message

Kind regards

Re: Recovering lvm over RAID5 Linux using R-Studio

by kellogs » Mon May 12, 2014 5:16 am

Any news or tips about LVM recovery over a RAID5 system.
I have kept the falty discs and i will enquire during the week what can be done.
Any idea?

Kind regards,
Kellogs

Re: Recovering lvm over RAID5 Linux using R-Studio

by Alt » Mon Sep 23, 2013 8:45 am

We're considering this option.

Re: Recovering lvm over RAID5 Linux using R-Studio

by Corsari » Sat Sep 21, 2013 11:37 am

Hello Alt

how is it now the situation with LVM/LVM2?

Thank you
Cor

Re: Recovering lvm over RAID5 Linux using R-Studio

by Alt » Sat Sep 03, 2011 4:40 am

Unfortunately, R-Studio doesn't currently support lvm. I think, the easiest way to recover your files is to copy the entire content of the partition to another disk. You see, experimenting with the disks where the original data resides is highly dangerous to the data.
Then you may create a new RAID+LVM and copy the data back.

Re: Recovering lvm over RAID5 Linux using R-Studio

by kellogs » Fri Sep 02, 2011 12:40 pm

This was a UID problem, I created a new pv.
Then I could import the lvm configuration file.
And rebuild volumes.

Then I mounted the volumes, but the ext3 filesystem was not recognised.
Do you any tool or method to recover a destroyed lvm?
The RAID5 data is still there.

Re: Recovering lvm over RAID5 Linux using R-Studio

by kellogs » Fri Sep 02, 2011 7:39 am

Before of a poor copy, there were errors in the configuration file.
It is highly important that R-Studio could allow text copy.

Here is the right configuration:

Code: Select all

contents = "Text Format Volume Group"
version = 1

description = "Backup"

creation_host = "supermicro-formalib"
creation_time = 1260353201

lvm {
	id = "pa5YGU-T1JG-vx7W-iolk-Hvrg-gJdm-AtMnRH"
	seqno = 8
	status = ["RESIZEABLE", "READ", "WRITE"]
	flags = []
	extent_size = 8192 # 4 Megabytes
	max_lv = 0
	max_pv = 0
        metadata_copies = 0

	physical_volumes {

		pv0 {

		id = "TT2YkN-9q19-yyPk-gU0e-qZBC-yhMx-6XNbAm"
		device = "/dev/md1" #Hint only
		
		status = ["ALLOCATABLE"]
		flags = []
		dev_size = 5848799616 # 2.72356 Terabytes
		pe_start = 384
		pe_count = 713964 # 2.72356 Terabytes
		}
	}

	logical_volumes {

		root 	{
			id = "JaFCuw-nqDg-G3sS-qRMs-Mcjw-JHSX-CIA5MN"
			status = ["READ", "WRITE", "VISIBLE"]
			flags = []
			segment_count = 1

			segment1 {
			start_extent = 0
			extent_count = 7152 #27.9375 Gigabytes
			
			type = "striped"
			stripe_count = 1 # linear
			
			
			stripes = [
			        "pv0", 0
			                ]
			}
		}

		home 	{
			id = "wX28KJ-ziic-Uy5c-0iCT-N54b-q2Hj-0ltSf2"
			status = ["READ", "WRITE", "VISIBLE"]
			flags = []
			segment_count = 1

			segment1 {
			start_extent = 0
			extent_count = 699940 # 2.670
			
			type = "striped"
			stripe_count = 1 # linear

			stripes =[
			        "pv0", 7152
			]
			}
		}

	}
}
vgcfgrestore -vvv -f /media/DataTravel/lvm.conf lvm

Code: Select all

      Setting global/locking_type to 1
      Setting global/wait_for_locks to 1
      File-based locking selected.
      Setting global/locking_dir to /var/lock/lvm
      Locking /var/lock/lvm/V_lvm WB
      Locking /var/lock/lvm/P_orphans WB
      /dev/loop0: No label detected
      /dev/md1: No label detected
      /dev/sda5: No label detected
      /dev/sdb5: No label detected
      /dev/sdc5: No label detected
      /dev/sdd5: No label detected
      /dev/sde1: No label detected
      /dev/md126: No label detected
      Setting devices/ignore_suspended_devices to 0
      Setting devices/cache_dir to /etc/lvm/cache
      Setting devices/write_cache_state to 1
    Wiping cache of LVM-capable devices
      /dev/loop0: size is 2110896 sectors
      /dev/loop0: size is 2110896 sectors
      /dev/loop0: No label detected
      /dev/sda: size is 1953525168 sectors
      /dev/loop1: size is 0 sectors
      /dev/sda1: size is 1959867 sectors
      /dev/sda1: size is 1959867 sectors
      /dev/md1: size is 5848793088 sectors
      /dev/md1: size is 5848793088 sectors
      /dev/md1: No label detected
      /dev/loop2: size is 0 sectors
      /dev/sda2: size is 2 sectors
      /dev/loop3: size is 0 sectors
      /dev/loop4: size is 0 sectors
      /dev/loop5: size is 0 sectors
      /dev/sda5: size is 1959867 sectors
      /dev/sda5: size is 1959867 sectors
      /dev/sda5: No label detected
      /dev/loop6: size is 0 sectors
      /dev/sda6: size is 1949600142 sectors
      /dev/sda6: size is 1949600142 sectors
      /dev/loop7: size is 0 sectors
      /dev/sdb: size is 1953525168 sectors
      /dev/sdb1: size is 1959867 sectors
      /dev/sdb1: size is 1959867 sectors
      /dev/sdb2: size is 2 sectors
      /dev/sdb5: size is 1959867 sectors
      /dev/sdb5: size is 1959867 sectors
      /dev/sdb5: No label detected
      /dev/sdb6: size is 1949600142 sectors
      /dev/sdb6: size is 1949600142 sectors
      /dev/sdc: size is 1953525168 sectors
      /dev/sdc1: size is 1959929 sectors
      /dev/sdc1: size is 1959929 sectors
      /dev/sdc2: size is 2 sectors
      /dev/sdc5: size is 1959929 sectors
      /dev/sdc5: size is 1959929 sectors
      /dev/sdc5: No label detected
      /dev/sdc6: size is 1949600204 sectors
      /dev/sdc6: size is 1949600204 sectors
      /dev/sdd: size is 3907029168 sectors
      /dev/sdd1: size is 1959867 sectors
      /dev/sdd1: size is 1959867 sectors
      /dev/sdd2: size is 2 sectors
      /dev/sdd5: size is 1959867 sectors
      /dev/sdd5: size is 1959867 sectors
      /dev/sdd5: No label detected
      /dev/sdd6: size is 3903104204 sectors
      /dev/sdd6: size is 3903104204 sectors
      /dev/sde: size is 7555528 sectors
      /dev/sde1: size is 7550487 sectors
      /dev/sde1: size is 7550487 sectors
      /dev/sde1: No label detected
      /dev/md126: size is 1959680 sectors
      /dev/md126: size is 1959680 sectors
      /dev/md126: No label detected
  Couldn't find device with uuid TT2YkN-9q19-yyPk-gU0e-qZBC-yhMx-6XNbAm.
  Cannot restore Volume Group lvm with 1 PVs marked as missing.
      Unlocking /var/lock/lvm/P_orphans
      Unlocking /var/lock/lvm/V_lvm
  Restore failed.

Re: Recovering lvm over RAID5 Linux using R-Studio

by kellogs » Fri Sep 02, 2011 6:14 am

Here is the file that I could recover:

Code: Select all

contents = "TextFormat Volume Group"
version = 1
description = "Created *before* executing 'lvresize -L +50G /dev/lvm/home'"
creation_host = "supermicro" # Linux supermicro 2.6.30-2-486 #1 Sat Sep 26 00:03:46 UTC 2009 i686

creation_time = 1260353201. #Wed Dec  9 11:06:41 2009

lvm {
	id = "pa5YGU-T1JG-vx7W-iolk-Hvrg-gJdm-AtMnRH"
	seqno = 8
	status = ["RESIZEABLE", "READ", "WRITE"]
	flags = []
	extent_size = 8192 # 4 Megabytes
	max_lv = 0
	max_pv = 0

	physical_volumes {

		pv0 {

		id = "TT2YkN-9q19-yyPk-gU0e-qZBC-yhMx-6XNbAm"
		device = "/dev/md1" #Ht only
		
		status = ["ALLOCATABLE"]
		flags = []
		dev_size = 5848799616 # 2.72356 Terabytes
		pe_start = 384
		pe_count = 713964 # 2.72356 Terabytes
		}
	}

	logical_volumes {

		root 	{
			id = "JaFCuw-nqDg-G3sS-qRMs-Mcjw-JHSX-CIA5MN"
			status = ["READ", "WRITE", "VISIBLE"]
			flags = []
			segment_count =1

			segment1 {
			start_extent = 0
			extent_count = 7152 #27.9375 Gigabytes
			
			type = "striped"
			stripe_count = 1 # linear
			
			
			stripes = [
			        "pv0", 0
			                ]
			}
		}

		home 	{
			id = "wX28KJ-ziic-Uy5c-0iCT-N54b-q2Hj-0ltSf2"
			status = ["READ", "WRITE", "VISIBLE"]
			flags = []
			segment_count = 1
			segment1 {
			start_extent = 0
			extent_count = 699940 # 2.670
			
			type = "striped"
			stripe_count = 1 # linear

			stripes =[
			        "pv0", 7152
			]
			}
		}

	}
}
vgcfgrestore -d -vvv -f /media/DataTravel/lvm.conf lvm
Processing: vgcfgrestore -d -vvv -f /media/DataTravel/lvm.conf lvm
O_DIRECT will be used
Setting global/locking_type to 1
Setting global/wait_for_locks to 1
File-based locking selected.
Setting global/locking_dir to /var/lock/lvm
Locking /var/lock/lvm/V_lvm WB
_do_flock /var/lock/lvm/V_lvm:aux WB
_do_flock /var/lock/lvm/V_lvm WB
_undo_flock /var/lock/lvm/V_lvm:aux
Locking /var/lock/lvm/P_orphans WB
_do_flock /var/lock/lvm/P_orphans:aux WB
_do_flock /var/lock/lvm/P_orphans WB
_undo_flock /var/lock/lvm/P_orphans:aux
Opened /media/DataTravel/lvm.conf RO
Closed /media/DataTravel/lvm.conf
Can't process text format file - unrecognised contents field.
Unlocking /var/lock/lvm/P_orphans
_undo_flock /var/lock/lvm/P_orphans
Unlocking /var/lock/lvm/V_lvm
_undo_flock /var/lock/lvm/V_lvm
Restore failed.
Any idea what is wrong?

Re: Recovering lvm over RAID5 Linux using R-Studio

by kellogs » Fri Sep 02, 2011 5:06 am

I searched for "logical_volumes {" string using text/hexadecimal editor and quickly found the file.
There are several versions of the same file.
The trick is to find the lasted backup.
It is quite easy as the text includes the date in Unix format.

I copied the text file and pasted it.

Unfortunately, the text contains hexa and text and utf8.

It would be nice to add a "copy special" feature to allow copy only text result.

IMHO this could be automated in R-Studio to recover a lost lvm with no backup of lvm structure.
Look at Google, there are hundreds of such cases.

Re: Recovering lvm over RAID5 Linux using R-Studio

by kellogs » Fri Sep 02, 2011 3:46 am

I need to search for the lvm backup file.
It should look like:

Code: Select all

        physical_volumes {

                pv0 {
                        id = "rVNFt0-YYRQ-cz2n-igAB-MD3f-Edni-5x2Qqt"
                        device = "/dev/sda5"    # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 770015232    # 367,172 Gigabytes
                        pe_start = 384
                        pe_count = 93995        # 367,168 Gigabytes
                }
        }

        logical_volumes {

                root {
                        id = "qsCZ5D-ydWo-T3NA-UYop-lWos-RmnM-Q1kQlu"
                        status = ["READ", "WRITE", "VISIBLE"]
                        flags = []
                        segment_count = 1

                        segment1 {
                                start_extent = 0
                                extent_count = 9536     # 37,25 Gigabytes

                                type = "striped"
                                stripe_count = 1        # linear

                                stripes = [
                                        "pv0", 0
                                ]
                        }
                }
                                                                                                                                   54,1-8        25%

Top