[opensuse] Where does LVM Info live
Trying to recover a crashed disk.... I was under the impression that using LVM tools like 'pvscan' and 'lvscan' could find the LVM partitions, if you could get past the first few sectors/cylinders of the disk. That is the volume groups info was 'out there' regardless of the tables manipulated by fdisk. I'm having trouble doing the latter, outer cylinder may be corrupted. Ideas? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Mon, 20 Jan 2014 10:56:53 -0500
Anton Aylward
Trying to recover a crashed disk....
I was under the impression that using LVM tools like 'pvscan' and 'lvscan' could find the LVM partitions, if you could get past the first few sectors/cylinders of the disk. That is the volume groups info was 'out there' regardless of the tables manipulated by fdisk.
PV label is located withing first 4K on device (whole disk or partition), usually second sector. If partition table was corrupted, PV will not be found. You could search the whole disk for PV label header LABELONE.
I'm having trouble doing the latter, outer cylinder may be corrupted.
Ideas?
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 01/20/2014 11:13 AM, Andrey Borzenkov wrote:
PV label is located withing first 4K on device (whole disk or partition), usually second sector. OUCH If partition table was corrupted, PV will not be found. You could search the whole disk for PV label header LABELONE. Is that a literal string?
What about the LVM partitions? I was under the impression that they each had their own LV information somewhere - that was what lvscan looked for - and this would be enough information to 'recover' the LV/partition. -- An ounce of action is worth a ton of theory. -- Friedrich Engels -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Mon, 20 Jan 2014 11:25:18 -0500
Anton Aylward
On 01/20/2014 11:13 AM, Andrey Borzenkov wrote:
PV label is located withing first 4K on device (whole disk or partition), usually second sector. OUCH If partition table was corrupted, PV will not be found. You could search the whole disk for PV label header LABELONE. Is that a literal string?
Yes
What about the LVM partitions?
I'm not sure what you call "LVM partitions". PV or LV?
I was under the impression that they each had their own LV information somewhere - that was what lvscan looked for - and this would be enough information to 'recover' the LV/partition.
LVM tools work with PV. If there is no PV, nothing will be found. Does pvscan output anything? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrey Borzenkov wrote:
I was under the impression that they each had their own LV information somewhere - that was what lvscan looked for - and this would be enough information to 'recover' the LV/partition.
LVM tools work with PV. If there is no PV, nothing will be found. Does pvscan output anything?
lvm usually keeps backup info in /etc/lvm/backup and /etc/lvm/archive (depending on the configuration) If you google lvm backup, you'll find stuff like this: http://www.tldp.org/HOWTO/LVM-HOWTO/recovermetadata.html But make sure you have the problem correctly diagnosed before attempting a repair. Or dd the whole disk somewhere safe first. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 01/20/2014 11:45 AM, Dave Howorth wrote:
lvm usually keeps backup info in /etc/lvm/backup and /etc/lvm/archive (depending on the configuration)
If I could read that much of the disk I'd be well ahead! -- There is no use whatever trying to help people who do not help themselves. You cannot push anyone up a ladder unless he be willing to climb himself. -- Andrew Carnegie -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Anton Aylward wrote:
On 01/20/2014 11:45 AM, Dave Howorth wrote:
lvm usually keeps backup info in /etc/lvm/backup and /etc/lvm/archive (depending on the configuration)
If I could read that much of the disk I'd be well ahead!
Yeah, is why I always keep the root and boot as non-RAID, non-LVM :( -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 01/20/2014 12:20 PM, Dave Howorth wrote:
Anton Aylward wrote:
On 01/20/2014 11:45 AM, Dave Howorth wrote:
lvm usually keeps backup info in /etc/lvm/backup and /etc/lvm/archive (depending on the configuration)
If I could read that much of the disk I'd be well ahead!
Yeah, is why I always keep the root and boot as non-RAID, non-LVM :(
So do I. /boot, / and swap were 'primary' partitions. I really don't care about them. I have the distribution CDs and who cares about swap! No, it was everything under /home that was in the LVM. And it is the DRIVE that is the problem, not the LVM. Right now I'm trying to read the drive - at all.
-- Last year I went fishing with Salvador Dali. He was using a dotted line. He caught every other fish. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 01/20/14 18:20, Dave Howorth wrote:
Anton Aylward wrote:
On 01/20/2014 11:45 AM, Dave Howorth wrote:
lvm usually keeps backup info in /etc/lvm/backup and /etc/lvm/archive (depending on the configuration)
If I could read that much of the disk I'd be well ahead!
Yeah, is why I always keep the root and boot as non-RAID, non-LVM :(
I understand why you don't want to use LVM for them. I don't understand why you do not want to use RAID. Using (Software) RAID-1 on all my disks was several times the reason that I could continue my work and prepare for disk exchange at leisure, instead of stumbling into re-imaging new disks and missing project dates. I couldn't imagine to live without it. Disks are cheap, my work time is expensive. I refrain from using hardware RAID, though, since I had problems in migrating RAID disks to a new system in case of fan or power supply unit failure. With software RAID, it worked all the time. In addition, RAID gives nice possibilities for installing new SUSE versions instead of inline upgrades with no backup possibility. Just split the mirror (living for a few days without protection, usually I check smartctl first and look also for the raw numbers :-)) and install the new distribution on the 2nd disk. Fix the fallout from Puppet configuration, for changed ways to do configuration. Fallback is always available on the 1st disk -- after the new distribution works they are re-attached to the mirror again. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jschrod@acm.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 01/20/2014 07:40 PM, Joachim Schrod wrote:
Using (Software) RAID-1 on all my disks was several times the reason that I could continue my work and prepare for disk exchange at leisure, instead of stumbling into re-imaging new disks and missing project dates. I couldn't imagine to live without it. Disks are cheap, my work time is expensive.
Indeed. The idea behind RAID-5 was right, it was just done wrong. Hamming coding can add the overlapping check bits to allow an indefinite number of errors to be detected and corrected. We already do that quite transparently in ECC memory. See http://en.wikipedia.org/wiki/Hamming_%287,4%29_code for one illustration. So you get to the point where adding drives to carry the data/parity interleaving introduces a higher failure rate .... you know the rest. RAID-1? Mirroring? So long as you can respond when one drive fails, replace it and rebuild before the other fails ... Which gets back to LVM... There have been observations about how its easier to put LVM on top of RAID to to manage the file systems, but why not use the LVM ability to mirror as a form or RAID-1. It seems that with LVM you can alter add a drive and start mirroring all or only some file systems.... Pro and Con: ----------- ** Do check the dates on these as some information may be out of date ** Possibly out of date: http://stackoverflow.com/questions/237434/are-raid-and-lvm-mutually-exclusiv... This reminds me of my experience with AIX http://www.olearycomputers.com/ll/linux_mirrors.html LVM2 mirror faster than RAID http://www.joshbryan.com/blog/2008/01/02/lvm2-mirrors-vs-md-raid-1/ http://utcc.utoronto.ca/~cks/space/blog/linux/LVMMirroringTemptation and http://utcc.utoronto.ca/~cks/space/blog/linux/LVMCautiousMigration Does anyone have experience with LVM Mirroring? https://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/mirrored_v... This leads me to think that it might be useful to have a small, possibly SSD, disk for 'the system' to boot from and to hold the log file, and use the "mirrored" system for "data" http://unix.stackexchange.com/questions/24666/what-does-a-mirrorlog-do-in-lv... -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 01/21/14 03:49, Anton Aylward wrote:
This leads me to think that it might be useful to have a small, possibly SSD, disk for 'the system' to boot from and to hold the log file, and use the "mirrored" system for "data"
I asked especially why Dave didn't use RAID for his system disk. That RAID+LVM is a good choice for data file systems, is unquestioned. Well, except: When your data set is so large that you have daily disk failures, or even ones every few hour (as some of my customers have); all this advice is mood, of course. Then you probably use NetApp or EMC, and have system management people roaming your data center once a day with a cart full of replacement disks as part of their regular job tasks. It's part of my job to plan such processes, but in our own shop I don't need it. In this thread I'm talking about developer desktops or small servers in SOHO environments. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jschrod@acm.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Joachim Schrod wrote:
On 01/20/14 18:20, Dave Howorth wrote:
Yeah, is why I always keep the root and boot as non-RAID, non-LVM :(
I understand why you don't want to use LVM for them.
I don't understand why you do not want to use RAID.
Probably unjustified paranoia. I worry about not being able to boot because of errors during update or upgrade. I've read too many threads about issues with RAID and booting. I do use it for all my data and separately for the backups. So I just keep an offline mirror of the root disk. When there's a problem, I just plug that into the root position.
In addition, RAID gives nice possibilities for installing new SUSE versions instead of inline upgrades with no backup possibility.
I just keep a spare partition or two and install new versions into them. I'm not claiming it's the best or only way, just that it works for me. Cheers, Dave -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 01/21/14 13:03, Dave Howorth wrote:
Joachim Schrod wrote:
On 01/20/14 18:20, Dave Howorth wrote:
Yeah, is why I always keep the root and boot as non-RAID, non-LVM :(
I understand why you don't want to use LVM for them.
I don't understand why you do not want to use RAID.
Probably unjustified paranoia. I worry about not being able to boot because of errors during update or upgrade. I've read too many threads about issues with RAID and booting. I do use it for all my data and separately for the backups.
If you're that paranoid, you can use 0.9-style metadata that is placed at the end of the partition. Then the partition can always be accessed as standard ext[234] filesystem during boot. Doing so outside of read-only mounts breaks mirroring, of course; but you may sleep better knowing that you can access these partitions without RAID software.
So I just keep an offline mirror of the root disk. When there's a problem, I just plug that into the root position.
Interesting. How do you organize updates then? I mean, every few days new packages come in that change the root disk. Do you mirror these changes to your offline disk regularly? Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod, Roedermark, Germany Email: jschrod@acm.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Joachim Schrod wrote:
On 01/21/14 13:03, Dave Howorth wrote:
So I just keep an offline mirror of the root disk. When there's a problem, I just plug that into the root position.
Interesting. How do you organize updates then? I mean, every few days new packages come in that change the root disk. Do you mirror these changes to your offline disk regularly?
Exactly. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 1/20/2014 9:08 AM, Anton Aylward wrote:
On 01/20/2014 11:45 AM, Dave Howorth wrote:
lvm usually keeps backup info in /etc/lvm/backup and /etc/lvm/archive (depending on the configuration)
If I could read that much of the disk I'd be well ahead!
Well its bound to be in your backups, right? -- _____________________________________ ---This space for rent--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 01/20/2014 11:33 AM, Andrey Borzenkov wrote:
В Mon, 20 Jan 2014 11:25:18 -0500 Anton Aylward
пишет: On 01/20/2014 11:13 AM, Andrey Borzenkov wrote:
PV label is located withing first 4K on device (whole disk or partition), usually second sector. OUCH If partition table was corrupted, PV will not be found. You could search the whole disk for PV label header LABELONE. Is that a literal string?
Yes
Thank you.
What about the LVM partitions?
I'm not sure what you call "LVM partitions". PV or LV?
The whole disk is, apart from a boot and swap partition defined using fdisk when I initialized the disk, one big LVM. Only the one "PV". I have lots of LVs, about 20+ of them. Separated out out 'documents', 'downloads', photos' (by year), various projects, email archives and more.
I was under the impression that they each had their own LV information somewhere - that was what lvscan looked for - and this would be enough information to 'recover' the LV/partition.
LVM tools work with PV. If there is no PV, nothing will be found. Does pvscan output anything?
The trouble is that everything stops 'cos it can't read the first few cylinders. Right now I'm trying to determine if this is electronics, head motor, or if the disk is gouged. Any hints are welcomed. -- "Security is a chain within the infrastructure and is as secure as its weakest link. It is not a product nor a series of technologies but a process of solutions measured against the business needs of the organization." -- Walter S. Kobus, Jr., CISM CISSP IAM -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Mon, 20 Jan 2014 12:07:42 -0500
Anton Aylward
On 01/20/2014 11:33 AM, Andrey Borzenkov wrote:
В Mon, 20 Jan 2014 11:25:18 -0500 Anton Aylward
пишет: On 01/20/2014 11:13 AM, Andrey Borzenkov wrote:
PV label is located withing first 4K on device (whole disk or partition), usually second sector. OUCH If partition table was corrupted, PV will not be found. You could search the whole disk for PV label header LABELONE. Is that a literal string?
Yes
Thank you.
What about the LVM partitions?
I'm not sure what you call "LVM partitions". PV or LV?
The whole disk is, apart from a boot and swap partition defined using fdisk when I initialized the disk, one big LVM. Only the one "PV". I have lots of LVs, about 20+ of them. Separated out out 'documents', 'downloads', photos' (by year), various projects, email archives and more.
I was under the impression that they each had their own LV information somewhere - that was what lvscan looked for - and this would be enough information to 'recover' the LV/partition.
LVM tools work with PV. If there is no PV, nothing will be found. Does pvscan output anything?
The trouble is that everything stops 'cos it can't read the first few cylinders. Right now I'm trying to determine if this is electronics, head motor, or if the disk is gouged.
If you have LVM configuration backups and know where partition started, you could try manually recreate LVs. If you do not have LVM configuration backups, you could try to find them on disk; there are multiple copies as text, something like # strings /dev/sda2 ... contents = "Text Format Volume Group" version = 1 description = "" creation_host = "opensuse.site" # Linux opensuse.site 3.4.11-2.16-desktop #1 SMP PREEMPT Wed Sep 26 17:05:00 UTC 2012 (259fc87) x86_64 creation_time = 1359191911 # Sat Jan 26 13:18:31 2013 system { id = "F1ikgD-2RES-306G-il9M-7iwa-4NKW-EbV1NV" seqno = 6 format = "lvm2" # informational ... physical_volumes { pv0 { id = "gPTUJ8-gNWl-siv1-JUtC-AEA9-Dr0N-Rf0456" device = "/dev/sda2" status = ["ALLOCATABLE"] flags = [] dev_size = 624091824 pe_start = 2048 pe_count = 76182 logical_volumes { swap { id = "rYCSC8-VwT5-8QtZ-ueTB-HGQU-WYer-tk0PJv" status = ["READ", "WRITE", "VISIBLE"] flags = [] segment_count = 1 segment1 { start_extent = 0 extent_count = 256 type = "striped" stripe_count = 1 # linear stripes = [ "pv0", 0 ... This gives you full information about defined volume groups, PV they include and composition of each LV. Restoring this manually would be really boring. If possible, you should us dd_rescue to duplicate as much data as possible on another disk at the same location and use recovery procedure outlined in link that was posted. It will recreate LV structure. You may need to spend some time to guess partition offset of you do not know it (e.g. looking for know signatures like swap or FS UUIDs. I'd really recommend search for data recovery tools. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Mon, 20 Jan 2014 21:23:08 +0400
Andrey Borzenkov
If possible, you should us dd_rescue to duplicate as much data as possible on another disk at the same location
You actually can create image, it need not be physical disk. I used it to recover from hard disk failure copying image over LAN to another system because that was the only one with enough space. Playing with image is also simpler. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 01/20/2014 10:56 AM, Anton Aylward pecked at the keyboard and wrote:
Trying to recover a crashed disk....
I was under the impression that using LVM tools like 'pvscan' and 'lvscan' could find the LVM partitions, if you could get past the first few sectors/cylinders of the disk. That is the volume groups info was 'out there' regardless of the tables manipulated by fdisk.
I'm having trouble doing the latter, outer cylinder may be corrupted.
Ideas?
Remember people that LVM is for controlling the size of partitions NOT for providing RAID like protection. If a disk crashes you can/will lose all of your data. If you want both you need to start with RAID first then create your LVM partitions on the RAID device. -- Ken Schneider SuSe since Version 5.2, June 1998 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 1/20/2014 9:09 AM, Ken Schneider - openSUSE wrote:
On 01/20/2014 10:56 AM, Anton Aylward pecked at the keyboard and wrote:
Trying to recover a crashed disk....
I was under the impression that using LVM tools like 'pvscan' and 'lvscan' could find the LVM partitions, if you could get past the first few sectors/cylinders of the disk. That is the volume groups info was 'out there' regardless of the tables manipulated by fdisk.
I'm having trouble doing the latter, outer cylinder may be corrupted.
Ideas?
Remember people that LVM is for controlling the size of partitions NOT for providing RAID like protection. If a disk crashes you can/will lose all of your data. If you want both you need to start with RAID first then create your LVM partitions on the RAID device.
And to the extent your LVM is made up of multiple physical (non raid) disks, your risk is increased with LVM. Any failure will likely kill your whole file system. Three small disks have three times the failure potential of one big one. --i I suspect that Linux does better at this sort of thing than windows, which may have a single file scattered all over the disk, whereas Linux tends (tries) to have it all in one place in consecutive locations. -- _____________________________________ ---This space for rent--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (6)
-
Andrey Borzenkov
-
Anton Aylward
-
Dave Howorth
-
Joachim Schrod
-
John Andersen
-
Ken Schneider - openSUSE