LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 08-15-2010, 04:14 AM   #1
Nemesiz
LQ Newbie
 
Registered: Oct 2007
Posts: 22

Rep: Reputation: 1
LVM disappear


I had to move data from one HDD to another. So in existing LVM I extended it with new HDD. Moved from one to another hdd. Was fine but after restart LVM disappeared. I can see only partition LVM (pvdisplay, lvdisplay, vgdisplay show empty). No lucky recovering it. So can i use pvcreate (i don't have a backup data or uuid) and somehow get logical volumes with data?

I tried with testdisk and others with no good lucky.
 
Old 08-15-2010, 08:39 AM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 475

Rep: Reputation: 73
Depending on the distro you may find LVM metadata backup(s) under /etc/lvm/, otherwise, you should be able to pull it off the disk(s) using dd. See Recovery PV Meta-Data for an example.
 
Old 08-15-2010, 01:31 PM   #3
Nemesiz
LQ Newbie
 
Registered: Oct 2007
Posts: 22

Original Poster
Rep: Reputation: 1
The problem is that root partition is inside LVM. I am trying to recover using live cd.
 
Old 08-16-2010, 05:16 PM   #4
Nemesiz
LQ Newbie
 
Registered: Oct 2007
Posts: 22

Original Poster
Rep: Reputation: 1
I found something

Code:
# This file is automatically maintained by lvm.

persistent_filter_cache {
	valid_devices=[
		"/dev/mapper/truecrypt1",
		"/dev/block/1:13",
		"/dev/block/1:14",
		"/dev/disk/by-uuid/ead135bb-d695-4c7d-97a9-5e90b54a32db",
		"/dev/ram11",
		"/dev/disk/by-path/pci-0000:00:1f.2-scsi-3:0:0:0-part1",
		"/dev/disk/by-path/pci-0000:02:00.0-scsi-0:0:0:0-part1",
		"/dev/block/8:17",
		"/dev/block/8:33",
		"/dev/block/8:34",
		"/dev/block/253:2",
		"/dev/disk/by-id/ata-SAMSUNG_SP0812C_S01UJ20Y298200-part1",
		"/dev/block/1:12",
		"/dev/disk/by-id/scsi-SATA_SAMSUNG_SP2004CS07GJ10Y302659-part1",
		"/dev/mapper/pve-root",
		"/dev/disk/by-id/dm-name-pve-root",
		"/dev/ram10",
		"/dev/disk/by-id/scsi-SATA_SAMSUNG_SP0812CS01UJ20Y298200-part1",
		"/dev/disk/by-id/dm-uuid-LVM-UL8spdRfXSwXJyOJNsiIUMhsFG3TnkU7KQF3zJQCQcBXehZob0zc2MfPgPLZRX7p",
		"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0-part1",
		"/dev/block/8:49",
		"/dev/disk/by-id/ata-SAMSUNG_SP2004C_S07GJ10Y302659-part2",
		"/dev/block/253:3",
		"/dev/block/1:10",
		"/dev/disk/by-uuid/d402ef49-72c1-4be4-8def-0977c3406b15",
		"/dev/ram12",
		"/dev/disk/by-path/pci-0000:00:1f.2-scsi-3:0:0:0-part2",
		"/dev/block/1:6",
		"/dev/disk/by-path/pci-0000:00:1f.2-scsi-1:0:0:0-part1",
		"/dev/disk/by-id/dm-uuid-LVM-UL8spdRfXSwXJyOJNsiIUMhsFG3TnkU74EWZK7B3fSi9oeIRzkV9wJ6pmRO0scjr",
		"/dev/ram6",
		"/dev/disk/by-id/ata-SAMSUNG_SP0812C_S01UJ20Y298199-part1",
		"/dev/block/253:1",
		"/dev/mapper/pve-data",
		"/dev/disk/by-id/ata-SAMSUNG_SP0812C_S01UJ20Y298200-part2",
		"/dev/block/1:11",
		"/dev/disk/by-id/scsi-SATA_SAMSUNG_SP2004CS07GJ10Y302659-part2",
		"/dev/ram13",
		"/dev/ram14",
		"/dev/disk/by-id/scsi-SATA_SAMSUNG_SP0812CS01UJ20Y298200-part2",
		"/dev/block/1:5",
		"/dev/disk/by-id/scsi-SATA_SAMSUNG_SP0812CS01UJ20Y298199-part1",
		"/dev/mapper/pve-swap",
		"/dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0-part2",
		"/dev/ram5",
		"/dev/disk/by-id/ata-SAMSUNG_SP2004C_S07GJ10Y302659-part1",
		"/dev/block/253:0",
		"/dev/disk/by-id/ata-SAMSUNG_SP1203N_0624J1FW319990-part1",
		"/dev/block/1:15",
		"/dev/disk/by-uuid/f600d75f-46bf-44bb-b162-1b2b707f59e2",
		"/dev/dm-2",
		"/dev/block/1:1",
		"/dev/block/8:1",
		"/dev/ram1",
		"/dev/sda1",
		"/dev/sdb1",
		"/dev/sdc1",
		"/dev/sdd1",
		"/dev/dm-3",
		"/dev/block/1:0",
		"/dev/disk/by-id/dm-name-truecrypt1",
		"/dev/ram0",
		"/dev/disk/by-uuid/296a669d-0ac3-4a74-940f-3b9a763dcf05",
		"/dev/root",
		"/dev/dm-1",
		"/dev/pve/data",
		"/dev/block/1:2",
		"/dev/block/8:2",
		"/dev/block/1:8",
		"/dev/block/1:9",
		"/dev/ram2",
		"/dev/sda2",
		"/dev/disk/by-id/dm-name-pve-data",
		"/dev/ram8",
		"/dev/ram9",
		"/dev/sdc2",
		"/dev/pve/root",
		"/dev/pve/swap",
		"/dev/disk/by-uuid/f98c8d8e-a932-4e55-ae9b-494f95f02102",
		"/dev/disk/by-uuid/3ef049b3-8572-490b-b3e4-1a0fd3f5fd1e",
		"/dev/dm-0",
		"/dev/ram15",
		"/dev/block/1:3",
		"/dev/block/1:4",
		"/dev/block/1:7",
		"/dev/disk/by-id/scsi-SATA_SAMSUNG_SP1203N0624J1FW319990-part1",
		"/dev/disk/by-id/dm-name-pve-swap",
		"/dev/disk/by-uuid/84c7f362-f9cc-4b88-bb93-cc7971735845",
		"/dev/ram3",
		"/dev/ram4",
		"/dev/ram7",
		"/dev/disk/by-id/dm-uuid-LVM-UL8spdRfXSwXJyOJNsiIUMhsFG3TnkU7BvFcKe5GC9A39YCYrbTN2qgfFQIN2Y1G"
	]
}

So UUID are :
UL8spdRfXSwXJyOJNsiIUMhsFG3TnkU7KQF3zJQCQcBXehZob0zc2MfPgPLZRX7p
UL8spdRfXSwXJyOJNsiIUMhsFG3TnkU74EWZK7B3fSi9oeIRzkV9wJ6pmRO0scjr
UL8spdRfXSwXJyOJNsiIUMhsFG3TnkU7BvFcKe5GC9A39YCYrbTN2qgfFQIN2Y1G

3 logical volumes was inside LVM group

Can someone give more glue ?
 
Old 08-16-2010, 06:38 PM   #5
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 475

Rep: Reputation: 73
If they are discovered and available in the LVM .cache, I would imagine they would be visible in the output of pvs; vgs; lvs, no?

If you need to manually pull the LVM2 metadata from the PV(s) in the VG(s) you should be able to use something along the lines of:
Code:
# dd if=/dev/myPVpart of=/tmp/LVM2.dd bs=512 count=48
Where /dev/myPVpart is the physical-volume of the volume-group. It could be /dev/sda2, sdb1, sdc, ..., ...

Then you could use less or strings (or similar) to grab the LVM2 metadata text from it and identify how the LVs were structured. If you are not able to bring the LV(s) up (activate) using the available LVM binaries, with the metadata you should be able to manually reassemble the LV(s) using device-mapper (dmsetup) directly to recover any data not yet overwritten as long as all the segments are available.
 
Old 03-24-2013, 09:53 PM   #6
bjrnfrdnnd
LQ Newbie
 
Registered: Apr 2005
Posts: 4

Rep: Reputation: 0
lvm vg disappeared

Hello,

I have read this thread and saw that rayfordj had some interesting insight into lvm recovery.
I have a similar problem (http://ubuntuforums.org/showthread.php?t=2128504) and would like to know if anyone can tell me if and how I could use dmsetup in order to recover data?
 
Old 03-25-2013, 12:27 AM   #7
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,032

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Did you try running "vgchange -ay" ?

[edit] Oh, nevermind. I did not notice that this silly thread was TWO YEARS OLD before someone resurrected it with a necropost, and then I posted after that without checking. Sorry about that! [/edit]

Last edited by haertig; 03-25-2013 at 12:29 AM.
 
Old 03-25-2013, 10:52 AM   #8
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 475

Rep: Reputation: 73
@bjrnfrdnnd, see if these may not be useful to your particular situation...

Mount logical volume without a working volume group (<-- has a working dmsetup example, but you'll need to ensure your math is accurate for sector-size, extent-size, offset/starting-location, etc. for your particular configuration)

Disaster with LVM (includes reference to: http://ubuntuforums.org/showthread.php?t=1886343)


Hopefully, this'll get you on your way.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding an LVM hard disk to a system already running/using LVM firewiz87 Linux - Hardware 5 08-15-2010 01:59 AM
lvm ontop of raid10 or combine two raid1 via lvm? okar Linux - Server 3 09-11-2009 03:37 PM
LVM and multiple iSCSI disks performance of LVM xxx_anuj_xxx Linux - Server 4 05-01-2008 01:26 PM
LXer: Managing LVM with the LVM Manager LXer Syndicated Linux News 0 03-16-2008 12:10 PM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 12:16 PM


All times are GMT -5. The time now is 05:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration