* [linux-lvm] brainfart: lilo'd a PV
@ 2009-12-17 23:41 Brian J. Murrell
2009-12-18 0:48 ` Takahiro Yasui
0 siblings, 1 reply; 7+ messages in thread
From: Brian J. Murrell @ 2009-12-17 23:41 UTC (permalink / raw)
To: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 1610 bytes --]
I managed to write a lilo block (lilo) to the start of a PV which I have
on /dev/sda (note, /dev/sda is a whole disk PV, unpartitioned).
However, looking at a number of different PVs here, it appears that the
LVM data starts at 0x200 with: "LABELONE". i.e.:
# hexdump -C /dev/sdc3
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........|
...
# hexdump -C /dev/sdb
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001b0 00 00 00 00 00 00 00 00 dc 59 0f 10 cf c9 00 00 |.........Y......|
000001c0 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........|
...
# hexdump -C /dev/sda
00000000 fa eb 31 12 00 00 4c 49 4c 4f 16 08 10 00 01 00 |..1...LILO......|
...
00000180 30 e4 cd 13 eb 91 e8 93 fe 44 69 73 6b 20 72 65 |0........Disk re|
00000190 61 64 20 65 72 72 6f 72 0d 0a 00 00 00 00 00 00 |ad error........|
000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001b0 00 00 00 00 00 00 00 00 c6 08 1a 45 cf c9 00 00 |...........E....|
000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200 4c 41 42 45 4c 4f 4e 45 01 00 00 00 00 00 00 00 |LABELONE........|
Is that correct?
Is there anything I should do to repair this or is my brainfart benign
to this PV?
Thanx!
b.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-lvm] brainfart: lilo'd a PV
2009-12-17 23:41 [linux-lvm] brainfart: lilo'd a PV Brian J. Murrell
@ 2009-12-18 0:48 ` Takahiro Yasui
2009-12-18 2:03 ` [linux-lvm] " Brian J. Murrell
2009-12-18 12:09 ` [linux-lvm] " Bryn M. Reeves
0 siblings, 2 replies; 7+ messages in thread
From: Takahiro Yasui @ 2009-12-18 0:48 UTC (permalink / raw)
To: linux-lvm
On 12/17/09 18:41, Brian J. Murrell wrote:
> I managed to write a lilo block (lilo) to the start of a PV which I have
> on /dev/sda (note, /dev/sda is a whole disk PV, unpartitioned).
>
> However, looking at a number of different PVs here, it appears that the
> LVM data starts at 0x200 with: "LABELONE". i.e.:
>
> # hexdump -C /dev/sdc3
> 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........|
> ...
> # hexdump -C /dev/sdb
> 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
> *
> 000001b0 00 00 00 00 00 00 00 00 dc 59 0f 10 cf c9 00 00 |.........Y......|
> 000001c0 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........|
> ...
> # hexdump -C /dev/sda
> 00000000 fa eb 31 12 00 00 4c 49 4c 4f 16 08 10 00 01 00 |..1...LILO......|
> ...
> 00000180 30 e4 cd 13 eb 91 e8 93 fe 44 69 73 6b 20 72 65 |0........Disk re|
> 00000190 61 64 20 65 72 72 6f 72 0d 0a 00 00 00 00 00 00 |ad error........|
> 000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
> 000001b0 00 00 00 00 00 00 00 00 c6 08 1a 45 cf c9 00 00 |...........E....|
> 000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
> *
> 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
> 00000200 4c 41 42 45 4c 4f 4e 45 01 00 00 00 00 00 00 00 |LABELONE........|
>
> Is that correct?
Yes. The area begin with "LABELONE" is PV label, which is recorded in
the first sector by default. This is the description from the pvcreate
man page.
--labelsector sector
By default the PV is labelled with an LVM2 identifier in its
second sector (sector 1). This lets you use a different sector
near the start of the disk (between 0 and 3 inclusive - see
LABEL_SCAN_SECTORS in the source). Use with care.
> Is there anything I should do to repair this or is my brainfart benign
> to this PV?
You don't have any problem on the PV, do you?
I don't think you need something to repair the PV.
Thanks,
Taka
^ permalink raw reply [flat|nested] 7+ messages in thread
* [linux-lvm] Re: brainfart: lilo'd a PV
2009-12-18 0:48 ` Takahiro Yasui
@ 2009-12-18 2:03 ` Brian J. Murrell
2009-12-18 2:16 ` malahal
2009-12-18 3:31 ` Ray Morris
2009-12-18 12:09 ` [linux-lvm] " Bryn M. Reeves
1 sibling, 2 replies; 7+ messages in thread
From: Brian J. Murrell @ 2009-12-18 2:03 UTC (permalink / raw)
To: linux-lvm
[-- Attachment #1: Type: text/plain, Size: 1561 bytes --]
On Thu, 2009-12-17 at 19:48 -0500, Takahiro Yasui wrote:
>
> Yes. The area begin with "LABELONE" is PV label,
Looks like the LVM developers foresaw my brainfart and left the first
sector of the disk for me to bugger up without buggering up LVM. :-)
> which is recorded in
> the first sector by default.
Hrm. Do you really mean "first" there or second, which is sector 1 if
you start counting with 0?
> This is the description from the pvcreate
> man page.
>
> --labelsector sector
> By default the PV is labelled with an LVM2 identifier in its
> second sector (sector 1).
Yes, this looks so.
> This lets you use a different sector
> near the start of the disk (between 0 and 3 inclusive - see
> LABEL_SCAN_SECTORS in the source). Use with care.
> You don't have any problem on the PV, do you?
I don't think I do:
# pvdisplay /dev/sda
--- Physical volume ---
PV Name /dev/sda
VG Name datavol
PV Size 931.51 GB / not usable 1.71 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 238467
Free PE 85356
Allocated PE 153111
PV UUID C22uVB-4m26-5cvl-I11V-NXCm-mVNo-UTAXUH
But of course, I just want to get the opinion of the experts.
> I don't think you need something to repair the PV.
I don't think so either, but of course, do want to confirm my suspicion.
Thanx much for your insight.
b.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-lvm] Re: brainfart: lilo'd a PV
2009-12-18 2:03 ` [linux-lvm] " Brian J. Murrell
@ 2009-12-18 2:16 ` malahal
2009-12-18 3:12 ` Takahiro Yasui
2009-12-18 3:31 ` Ray Morris
1 sibling, 1 reply; 7+ messages in thread
From: malahal @ 2009-12-18 2:16 UTC (permalink / raw)
To: linux-lvm
Brian J. Murrell [brian@interlinx.bc.ca] wrote:
> On Thu, 2009-12-17 at 19:48 -0500, Takahiro Yasui wrote:
> >
> > Yes. The area begin with "LABELONE" is PV label,
>
> Looks like the LVM developers foresaw my brainfart and left the first
> sector of the disk for me to bugger up without buggering up LVM. :-)
Partition table uses the first sector (0th sector), so pretty much every
other software that uses labels avoid the first sector.
> > which is recorded in
> > the first sector by default.
>
> Hrm. Do you really mean "first" there or second, which is sector 1 if
> you start counting with 0?
He really meant sector 1!
You are just lucky!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-lvm] Re: brainfart: lilo'd a PV
2009-12-18 2:16 ` malahal
@ 2009-12-18 3:12 ` Takahiro Yasui
0 siblings, 0 replies; 7+ messages in thread
From: Takahiro Yasui @ 2009-12-18 3:12 UTC (permalink / raw)
To: LVM general discussion and development
malahal@us.ibm.com wrote:
> Brian J. Murrell [brian@interlinx.bc.ca] wrote:
>> On Thu, 2009-12-17 at 19:48 -0500, Takahiro Yasui wrote:
>>> Yes. The area begin with "LABELONE" is PV label,
>> Looks like the LVM developers foresaw my brainfart and left the first
>> sector of the disk for me to bugger up without buggering up LVM. :-)
>
> Partition table uses the first sector (0th sector), so pretty much every
> other software that uses labels avoid the first sector.
>
>>> which is recorded in
>>> the first sector by default.
>> Hrm. Do you really mean "first" there or second, which is sector 1 if
>> you start counting with 0?
>
> He really meant sector 1!
Oops, sorry for confusion. The sector number begins with 0,
so the sector 1 should have been written as the "second" sector.
Thank you for correction, Malahal.
Thanks,
Taka
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-lvm] Re: brainfart: lilo'd a PV
2009-12-18 2:03 ` [linux-lvm] " Brian J. Murrell
2009-12-18 2:16 ` malahal
@ 2009-12-18 3:31 ` Ray Morris
1 sibling, 0 replies; 7+ messages in thread
From: Ray Morris @ 2009-12-18 3:31 UTC (permalink / raw)
To: LVM general discussion and development
> > Yes. The area begin with "LABELONE" is PV label,
>
> Looks like the LVM developers foresaw my brainfart and left the first
> sector of the disk for me to bugger up without buggering up LVM. :-)
Applause.
--
Ray Morris
support@bettercgi.com
Strongbox - The next generation in site security:
http://www.bettercgi.com/strongbox/
Throttlebox - Intelligent Bandwidth Control
http://www.bettercgi.com/throttlebox/
Strongbox / Throttlebox affiliate program:
http://www.bettercgi.com/affiliates/user/register.php
On 12/17/2009 08:03:08 PM, Brian J. Murrell wrote:
> On Thu, 2009-12-17 at 19:48 -0500, Takahiro Yasui wrote:
> >
> > Yes. The area begin with "LABELONE" is PV label,
>
> Looks like the LVM developers foresaw my brainfart and left the first
> sector of the disk for me to bugger up without buggering up LVM. :-)
>
> > which is recorded in
> > the first sector by default.
>
> Hrm. Do you really mean "first" there or second, which is sector 1 if
> you start counting with 0?
>
> > This is the description from the pvcreate
> > man page.
> >
> > --labelsector sector
> > By default the PV is labelled with an LVM2
> identifier in its
> > second sector (sector 1).
>
> Yes, this looks so.
>
> > This lets you use a different sector
> > near the start of the disk (between 0 and 3
> inclusive - see
> > LABEL_SCAN_SECTORS in the source). Use with care.
>
> > You don't have any problem on the PV, do you?
>
> I don't think I do:
>
> # pvdisplay /dev/sda
> --- Physical volume ---
> PV Name /dev/sda
> VG Name datavol
> PV Size 931.51 GB / not usable 1.71 MB
> Allocatable yes
> PE Size (KByte) 4096
> Total PE 238467
> Free PE 85356
> Allocated PE 153111
> PV UUID C22uVB-4m26-5cvl-I11V-NXCm-mVNo-UTAXUH
>
> But of course, I just want to get the opinion of the experts.
>
> > I don't think you need something to repair the PV.
>
> I don't think so either, but of course, do want to confirm my
> suspicion.
>
> Thanx much for your insight.
>
> b.
>
>
------quoted attachment------
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-lvm] brainfart: lilo'd a PV
2009-12-18 0:48 ` Takahiro Yasui
2009-12-18 2:03 ` [linux-lvm] " Brian J. Murrell
@ 2009-12-18 12:09 ` Bryn M. Reeves
1 sibling, 0 replies; 7+ messages in thread
From: Bryn M. Reeves @ 2009-12-18 12:09 UTC (permalink / raw)
To: LVM general discussion and development
On Thu, 2009-12-17 at 19:48 -0500, Takahiro Yasui wrote:
> On 12/17/09 18:41, Brian J. Murrell wrote:
> > I managed to write a lilo block (lilo) to the start of a PV which I have
> > on /dev/sda (note, /dev/sda is a whole disk PV, unpartitioned).
> >
> > However, looking at a number of different PVs here, it appears that the
> > LVM data starts at 0x200 with: "LABELONE". i.e.:
> >
> > # hexdump -C /dev/sdc3
> > 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........|
> > ...
> > # hexdump -C /dev/sdb
> > 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
> > *
> > 000001b0 00 00 00 00 00 00 00 00 dc 59 0f 10 cf c9 00 00 |.........Y......|
> > 000001c0 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........|
> > ...
> > # hexdump -C /dev/sda
> > 00000000 fa eb 31 12 00 00 4c 49 4c 4f 16 08 10 00 01 00 |..1...LILO......|
> > ...
> > 00000180 30 e4 cd 13 eb 91 e8 93 fe 44 69 73 6b 20 72 65 |0........Disk re|
> > 00000190 61 64 20 65 72 72 6f 72 0d 0a 00 00 00 00 00 00 |ad error........|
> > 000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
> > 000001b0 00 00 00 00 00 00 00 00 c6 08 1a 45 cf c9 00 00 |...........E....|
> > 000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
> > *
> > 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
> > 00000200 4c 41 42 45 4c 4f 4e 45 01 00 00 00 00 00 00 00 |LABELONE........|
> >
> > Is that correct?
>
> Yes. The area begin with "LABELONE" is PV label, which is recorded in
> the first sector by default. This is the description from the pvcreate
> man page.
>
> --labelsector sector
> By default the PV is labelled with an LVM2 identifier in its
> second sector (sector 1). This lets you use a different sector
> near the start of the disk (between 0 and 3 inclusive - see
> LABEL_SCAN_SECTORS in the source). Use with care.
>
> > Is there anything I should do to repair this or is my brainfart benign
> > to this PV?
>
> You don't have any problem on the PV, do you?
> I don't think you need something to repair the PV.
Yeah, you should be fine here since LVM2 does not use the 1st sector of
the device and the MBR (and hence lilo) does all its work in that 1st
sector. The LVM2 PV label begins in the 2nd sector (as you've noticed)
and has been left intact by these changes.
You could always zero out sector 0 to avoid confusion:
dd if=/dev/zero of=/path/to/pv bs=512 count=1
Regards,
Bryn.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-12-18 12:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-17 23:41 [linux-lvm] brainfart: lilo'd a PV Brian J. Murrell
2009-12-18 0:48 ` Takahiro Yasui
2009-12-18 2:03 ` [linux-lvm] " Brian J. Murrell
2009-12-18 2:16 ` malahal
2009-12-18 3:12 ` Takahiro Yasui
2009-12-18 3:31 ` Ray Morris
2009-12-18 12:09 ` [linux-lvm] " Bryn M. Reeves
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).