Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple partitions in block mode not supported #1

Open
volkerrichert opened this issue Nov 6, 2012 · 3 comments
Open

multiple partitions in block mode not supported #1

volkerrichert opened this issue Nov 6, 2012 · 3 comments

Comments

@volkerrichert
Copy link

Hi!

I have a few KVM-System which have multipe partions inside a LVM-disk

e.g.

fdisk -l /dev/drbdvg/vm-110-disk-1

Disk /dev/drbdvg/vm-110-disk-1: 330.7 GB, 330712481792 bytes
255 heads, 63 sectors/track, 40206 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd35a4f8a

                 Device Boot      Start         End      Blocks   Id  System

/dev/drbdvg/vm-110-disk-1p1 * 1 20561 165156201 83 Linux
/dev/drbdvg/vm-110-disk-1p2 20562 20589 224910 83 Linux

How can this be supported?

@maff
Copy link
Owner

maff commented Nov 6, 2012

Looks like Proxmox ;)

That's what the MAPPERINDEX parameter is for - you can change the parameter via config file or via command line. Here's an example config file:

# Mode can be either partition (Xen style) or block (KVM style)
# Partition will be mounted directly, while block will be mapped
# with kpartx first and then mounted
MODE=block

# Name of LVM volume group
GROUPNAME=drbdvg

# LVM base path
LVMPATH=/dev

# LVM extension
# An extension which all LVM Volumes share, will be appended to the Volume name
LVMEXTENSION="-disk-1"

# Mount path
# Path where snapshots will be mounted to
MOUNTPATH=/mnt/lvmsnapshot

# Snapshot size
SNAPSHOTSIZE=1G

# Mapper base path
MAPPERPATH=/dev/mapper

# Number of mapped device (the number which will appended by kpartx to the
# partition which should be mounted.
MAPPERINDEX=1

Use mapperindex 1 for the first partition, 2 for the second one and mount the partition with "lvmsnapshot create vm-110". However at the moment both partitions will be mounted at the same mount point as the mapper index is not used to generate the mount point. Therefore you can only mount one partition at a time. I'll have a look at this, but could take some time (or you patch it yourself and send a PR).

@maff
Copy link
Owner

maff commented Nov 6, 2012

Can you try if it works for multiple partitions with commit 647a6ca?

@volkerrichert
Copy link
Author

Yes, proxmox. :-)

And yes, this will work fine. But i found another bug. If something went wrong kpartx will not "free" the subparts and the snapshot will not be removed. This happends e.g. by triing to mount a swap

Volker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants