Skip to contentSkip to conversation

how to access the partition on LV?

linux-lvm Ming Zhang 3 participants 9 messages Jul 28, 2005 – Jul 29, 2005

lore
Share & tools
lore

Ming Zhang

author
#0 lore raw

I think this is a very common question but i can not find the answer. any idea on how to access the partition on these lv since no device node?

[root@fc3-i386-2 ~]# fdisk /dev/vg1/v1 -l

Disk /dev/vg1/v1: 469 MB, 469762048 bytes
255 heads, 63 sectors/track, 57 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
/dev/vg1/v1p1               1          13      104391   83  Linux
/dev/vg1/v1p2              14          57      353430   83  Linux

Thanks!

Ming

#1 lore raw
Quoted 7 lines · Ming Zhang

I think this is a very common question but i can not find the answer. any idea on how to access the partition on these lv since no device node?

[root@fc3-i386-2 ~]# fdisk /dev/vg1/v1 -l

Quoted 7 lines

Disk /dev/vg1/v1: 469 MB, 469762048 bytes
255 heads, 63 sectors/track, 57 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
/dev/vg1/v1p1               1          13      104391   83  Linux
/dev/vg1/v1p2              14          57      353430   83  Linux

You don't. Don't put partition tables on LVs. The whole point of using LVM is you don't need to partition anymore, and your block devices can be dynamic. If you another block devices, you lvcreate it. If you don't have enough space in your VG, you add a PV to it, then lvcreate the new block device. Have you read through the HOWTO referenced below?

Signature · 8 lines
AJ Lewis                                   Voice:  612-638-0500
Red Hat                                    E-Mail: [email protected]
One Main Street SE, Suite 209
Minneapolis, MN 55414
   
Current GPG fingerprint = D9F8 EDCE 4242 855F A03D  9B63 F50C 54A8 578C 8715
Grab the key at: http://people.redhat.com/alewis/gpg.html or one of the
many keyservers out there...
author
#2 lore raw
Quoted 8 lines · AJ Lewis
Quoted 7 lines · Ming Zhang

I think this is a very common question but i can not find the answer. any idea on how to access the partition on these lv since no device node?

[root@fc3-i386-2 ~]# fdisk /dev/vg1/v1 -l

Quoted 8 lines
Quoted 7 lines

Disk /dev/vg1/v1: 469 MB, 469762048 bytes
255 heads, 63 sectors/track, 57 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
/dev/vg1/v1p1               1          13      104391   83  Linux
/dev/vg1/v1p2              14          57      353430   83  Linux

the problem is that we export a LV via iscsi to a remote box and become a scsi disk. so it is partitioned and utilized. then it does have partition on it. even it is exported to a linux box, u possibly will use /dev/sdx1 instead of directly use /dev/sdx, rite?

Quoted 5 lines

You don't. Don't put partition tables on LVs. The whole point of using LVM is you don't need to partition anymore, and your block devices can be dynamic. If you another block devices, you lvcreate it. If you don't have enough space in your VG, you add a PV to it, then lvcreate the new block device. Have you read through the HOWTO referenced below?

i can not see this HOWTO, where u referenced it?

thx!

ming

Quoted 1 line
#3 lore raw
Quoted 18 lines · Ming Zhang
Quoted 8 lines · AJ Lewis
Quoted 7 lines · Ming Zhang

I think this is a very common question but i can not find the answer. any idea on how to access the partition on these lv since no device node?

[root@fc3-i386-2 ~]# fdisk /dev/vg1/v1 -l

Quoted 8 lines
Quoted 7 lines

Disk /dev/vg1/v1: 469 MB, 469762048 bytes
255 heads, 63 sectors/track, 57 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
/dev/vg1/v1p1               1          13      104391   83  Linux
/dev/vg1/v1p2              14          57      353430   83  Linux
Quoted 4 lines

the problem is that we export a LV via iscsi to a remote box and become a scsi disk. so it is partitioned and utilized. then it does have partition on it. even it is exported to a linux box, u possibly will use /dev/sdx1 instead of directly use /dev/sdx, rite?

Ahh - I see. Well, on the node exporting the LVs, you don't access it. I dunno if kpartx or some other partitioning tool could do it - it might. But as far as the standard partion handling code goes, LVs don't exist. I know why you're doing it this way - I don't know why you want to access the partitions on the exporting (target) node. Do you really need to?

Quoted 7 lines
Quoted 5 lines

You don't. Don't put partition tables on LVs. The whole point of using LVM is you don't need to partition anymore, and your block devices can be dynamic. If you another block devices, you lvcreate it. If you don't have enough space in your VG, you add a PV to it, then lvcreate the new block device. Have you read through the HOWTO referenced below?

i can not see this HOWTO, where u referenced it?

It's at the bottom of all messages that go to the linux-lvm ML -
http://tldp.org/HOWTO/LVM-HOWTO/

Signature · 8 lines
AJ Lewis                                   Voice:  612-638-0500
Red Hat                                    E-Mail: [email protected]
One Main Street SE, Suite 209
Minneapolis, MN 55414
   
Current GPG fingerprint = D9F8 EDCE 4242 855F A03D  9B63 F50C 54A8 578C 8715
Grab the key at: http://people.redhat.com/alewis/gpg.html or one of the
many keyservers out there...
author
#4 lore raw
Quoted 24 lines · AJ Lewis
Quoted 18 lines · Ming Zhang
Quoted 8 lines · AJ Lewis
Quoted 7 lines · Ming Zhang

I think this is a very common question but i can not find the answer. any idea on how to access the partition on these lv since no device node?

[root@fc3-i386-2 ~]# fdisk /dev/vg1/v1 -l

Quoted 8 lines
Quoted 7 lines

Disk /dev/vg1/v1: 469 MB, 469762048 bytes
255 heads, 63 sectors/track, 57 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System
/dev/vg1/v1p1               1          13      104391   83  Linux
/dev/vg1/v1p2              14          57      353430   83  Linux
Quoted 4 lines

the problem is that we export a LV via iscsi to a remote box and become a scsi disk. so it is partitioned and utilized. then it does have partition on it. even it is exported to a linux box, u possibly will use /dev/sdx1 instead of directly use /dev/sdx, rite?

Quoted 5 lines

Ahh - I see. Well, on the node exporting the LVs, you don't access it. I dunno if kpartx or some other partitioning tool could do it - it might. But as far as the standard partion handling code goes, LVs don't exist. I know why you're doing it this way - I don't know why you want to access the partitions on the exporting (target) node. Do you really need to?

yes, i guess that is the only solution. we have end users want that feature. so i think a work around is to run a iscsi initiator at local site and access via iscsi again.

Quoted 11 lines
Quoted 8 lines
Quoted 6 lines

You don't. Don't put partition tables on LVs. The whole point of using LVM is you don't need to partition anymore, and your block devices can be dynamic. If you another block devices, you lvcreate it. If you don't have enough space in your VG, you add a PV to it, then lvcreate the new block device. Have you read through the HOWTO referenced below?

i can not see this HOWTO, where u referenced it?

It's at the bottom of all messages that go to the linux-lvm ML -
http://tldp.org/HOWTO/LVM-HOWTO/

i guess this is because i got the email from u directly. so lvm list will not send to me again. and only email via it will have that link. i checked my archival and all emails via lvm list has that.

#5 lore raw
Quoted 7 lines · Ming Zhang
Quoted 6 lines · AJ Lewis
Quoted 4 lines · Ming Zhang

the problem is that we export a LV via iscsi to a remote box and become a scsi disk. so it is partitioned and utilized. then it does have partition on it. even it is exported to a linux box, u possibly will use /dev/sdx1 instead of directly use /dev/sdx, rite?

Quoted 8 lines
Quoted 5 lines

Ahh - I see. Well, on the node exporting the LVs, you don't access it. I dunno if kpartx or some other partitioning tool could do it - it might. But as far as the standard partion handling code goes, LVs don't exist. I know why you're doing it this way - I don't know why you want to access the partitions on the exporting (target) node. Do you really need to?

yes, i guess that is the only solution. we have end users want that feature. so i think a work around is to run a iscsi initiator at local site and access via iscsi again.

Could play with loopback devices too if you need to do it on the target - that might get nasty quickly though.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

i can not see this HOWTO, where u referenced it?

It's at the bottom of all messages that go to the linux-lvm ML -
http://tldp.org/HOWTO/LVM-HOWTO/

i guess this is because i got the email from u directly. so lvm list will not send to me again. and only email via it will have that link. i checked my archival and all emails via lvm list has that.

Heh - yep, that'd do it ;)

Signature · 8 lines
AJ Lewis                                   Voice:  612-638-0500
Red Hat                                    E-Mail: [email protected]
One Main Street SE, Suite 209
Minneapolis, MN 55414
   
Current GPG fingerprint = D9F8 EDCE 4242 855F A03D  9B63 F50C 54A8 578C 8715
Grab the key at: http://people.redhat.com/alewis/gpg.html or one of the
many keyservers out there...
author
#6 lore raw
Quoted 13 lines · AJ Lewis
Quoted 12 lines · Ming Zhang
Quoted 11 lines · AJ Lewis
Quoted 4 lines · Ming Zhang

the problem is that we export a LV via iscsi to a remote box and become a scsi disk. so it is partitioned and utilized. then it does have partition on it. even it is exported to a linux box, u possibly will use /dev/sdx1 instead of directly use /dev/sdx, rite?

Ahh - I see. Well, on the node exporting the LVs, you don't access it. I dunno if kpartx or some other partitioning tool could do it - it might. But as far as the standard partion handling code goes, LVs don't exist. I know why you're doing it this way - I don't know why you want to access the partitions on the exporting (target) node. Do you really need to?

Quoted 6 lines
Quoted 3 lines

yes, i guess that is the only solution. we have end users want that feature. so i think a work around is to run a iscsi initiator at local site and access via iscsi again.

Could play with loopback devices too if you need to do it on the target - that might get nasty quickly though.

can loopback support partition? might worthy a try. :P

Quoted 10 lines
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

i can not see this HOWTO, where u referenced it?

It's at the bottom of all messages that go to the linux-lvm ML -
http://tldp.org/HOWTO/LVM-HOWTO/

i guess this is because i got the email from u directly. so lvm list will not send to me again. and only email via it will have that link. i checked my archival and all emails via lvm list has that.

Quoted 7 lines

Heh - yep, that'd do it ;)

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

this time works. :P

#7 lore raw
In reply to AJ Lewis
Quoted 6 lines
Quoted 4 lines

the problem is that we export a LV via iscsi to a remote box and become a scsi disk. so it is partitioned and utilized. then it does have partition on it. even it is exported to a linux box, u possibly will use /dev/sdx1 instead of directly use /dev/sdx, rite?

dunno if kpartx or some other partitioning tool could do it

Give kpartx a try. It reads a dos partition table and creates partitions using device-mapper.

You'll find kpartx in multipath-tools (device-mapper-multipath package on Red Hat).
ftp://sources.redhat.com/pub/dm/multipath-tools/multipath-tools-0.4.5.48.tgz

Alasdair

Signature · 1 line
[email protected]
author
#8 lore raw

thx.

ming

Quoted 14 lines · Alasdair G Kergon
Quoted 6 lines
Quoted 4 lines

the problem is that we export a LV via iscsi to a remote box and become a scsi disk. so it is partitioned and utilized. then it does have partition on it. even it is exported to a linux box, u possibly will use /dev/sdx1 instead of directly use /dev/sdx, rite?

dunno if kpartx or some other partitioning tool could do it

Give kpartx a try. It reads a dos partition table and creates partitions using device-mapper.

You'll find kpartx in multipath-tools (device-mapper-multipath package on Red Hat).
ftp://sources.redhat.com/pub/dm/multipath-tools/multipath-tools-0.4.5.48.tgz

Alasdair