* [linux-lvm] recover a pv from a disk with no partition table
@ 2006-05-01 23:47 Brian J. Murrell
2006-05-01 23:55 ` David Brown
0 siblings, 1 reply; 3+ messages in thread
From: Brian J. Murrell @ 2006-05-01 23:47 UTC (permalink / raw)
To: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]
I need to recover a PV from a disk with no partition table. I have a
disk which gives EIO errors trying to read from the first few blocks of,
so, no partition table.
Is there any way with LVM2, given that I have
the /etc/lvm/backup/<vgname> file that I can determine the offset into
the disk where the partition starts, so that I could do:
# losetup -o <offset> /dev/loop2 /dev/hde
to get the PV on /dev/loop2 and then be able to activate it with
vgchange and read it's LVs?
gpart tells me:
# losetup -o $((512*8)) /dev/loop2 /dev/hde
# gpart -vg /dev/loop2
dev(/dev/loop2) mss(512)
* Warning: strange partition table magic 0x0000.
...
Begin scan...
Possible partition(Linux ext2), size(19mb), offset(0mb)
type: 131(0x83)(Linux ext2 filesystem)
size: 19mb #s(39248) s(55-39302)
chs: (1023/255/0)-(1023/255/0)d (0/0/0)-(0/0/0)r
hex: 00 FF C0 FF 83 FF C0 FF 37 00 00 00 50 99 00 00
Possible partition(Linux LVM physical volume), size(156315mb), offset(19mb)
type: 142(0x8E)(Linux LVM physical volume)
size: 156315mb #s(320133744) s(39304-320173047)
chs: (1023/255/0)-(1023/255/0)d (0/0/0)-(0/0/0)r
hex: 00 FF C0 FF 8E FF C0 FF 88 99 00 00 70 DA 14 13
Which looks right, but:
# losetup -o $((512*39304)) /dev/loop3 /dev/hde
# vgscan
Yields no new volume groups. Neither does the above with 512*39303 or
512*39305 so it doesn't seem to be an off-by-one. Nor does any of
512*(39303-8), 512*(39304-8), 512*(39305-8) to account for the fact that
loop2 (which the gpart was done on originally) is 8 blocks into /dev/hde
already.
Am I missing something?
Thanx,
b.
--
My other computer is your Microsoft Windows server.
Brian J. Murrell
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-lvm] recover a pv from a disk with no partition table
2006-05-01 23:47 [linux-lvm] recover a pv from a disk with no partition table Brian J. Murrell
@ 2006-05-01 23:55 ` David Brown
2006-05-02 0:20 ` Brian J. Murrell
0 siblings, 1 reply; 3+ messages in thread
From: David Brown @ 2006-05-01 23:55 UTC (permalink / raw)
To: LVM general discussion and development
On Mon, May 01, 2006 at 07:47:36PM -0400, Brian J. Murrell wrote:
> I need to recover a PV from a disk with no partition table. I have a
> disk which gives EIO errors trying to read from the first few blocks of,
> so, no partition table.
>
> Is there any way with LVM2, given that I have
> the /etc/lvm/backup/<vgname> file that I can determine the offset into
> the disk where the partition starts, so that I could do:
The backup files don't list physical offsets. You'll have to figure that
out yourself. But, you can see the id's for the partitions, and the lvm
header is at offset 0x200 into the partition.
Dave
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-lvm] recover a pv from a disk with no partition table
2006-05-01 23:55 ` David Brown
@ 2006-05-02 0:20 ` Brian J. Murrell
0 siblings, 0 replies; 3+ messages in thread
From: Brian J. Murrell @ 2006-05-02 0:20 UTC (permalink / raw)
To: LVM general discussion and development
[-- Attachment #1: Type: text/plain, Size: 1483 bytes --]
On Mon, 2006-05-01 at 16:55 -0700, David Brown wrote:
> On Mon, May 01, 2006 at 07:47:36PM -0400, Brian J. Murrell wrote:
> > I need to recover a PV from a disk with no partition table. I have a
> > disk which gives EIO errors trying to read from the first few blocks of,
> > so, no partition table.
> >
> > Is there any way with LVM2, given that I have
> > the /etc/lvm/backup/<vgname> file that I can determine the offset into
> > the disk where the partition starts, so that I could do:
>
> The backup files don't list physical offsets.
Indeed. That's why I used gpart, without success.
> But, you can see the id's for the partitions, and the lvm
> header is at offset 0x200 into the partition.
Yeah, I did notice that on another pv on the system:
# hexdump -C /dev/sda2 | less
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000200 4c 41 42 45 4c 4f 4e 45 01 00 00 00 00 00 00 00 |LABELONE........|
00000210 ad 24 02 c2 20 00 00 00 4c 56 4d 32 20 30 30 31 |$. ...LVM2 001|
00000220 68 76 37 6b 4e 49 32 4e 72 5a 33 52 73 39 38 5a |hv7kNI2NrZ3Rs98Z|
00000230 42 65 73 33 53 76 4a 4c 75 68 61 4f 62 6a 53 36 |Bes3SvJLuhaObjS6|
Unfortunately, I am unable to find any "LABELONE" on the PV I am trying
to recover. I'm getting a bad feeling that that means that the LVM
(device mapper) mappings are gone. :-(
b.
--
My other computer is your Microsoft Windows server.
Brian J. Murrell
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-05-02 0:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-01 23:47 [linux-lvm] recover a pv from a disk with no partition table Brian J. Murrell
2006-05-01 23:55 ` David Brown
2006-05-02 0:20 ` Brian J. Murrell
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).