Partitioning virtual block devices

KVM guest

How to partition a block device depends on how the device is backed on the host, DASD or other.

Before you begin: Virtual block devices must be partitioned from the KVM host. From the guest, you cannot find out how a block device is backed on the host.
DASD backed block devices
Use the fdasd command to create up to 3 partitions. For details, see the fdasd man page
All other block devices
Use the common code fdisk command to create up to 15 partitions. For details, see the fdisk man page.

Alternatively, you can use the parted command to create partitions. The parted command can handle both DASD-backed and other block devices. For details, see the parted man page.

The partitions of a block device are represented as subdirectories of the device representation in /sys/block. For example, you can list the existing partitions of a block device /sys/block/vda by issuing:
# ls /sys/block/vda