Partitioning virtual block devices

6.14 KVM guest

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

Before you begin: Block devices that are backed by a DASD must first be formatted with dasdfmt on the host. Use the fdasd -i or parted print command to find out if your block device is backed by a DASD.
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