Jan 19 2026

Disk for Maildir with XFS in qemu

Create disk on hypervisor
qemu-img create -f qcow2 -o preallocation=metadata /var/lib/libvirt/images/bull-vmail2.qcow2 320G
Attach disk in console or virt-manager
virsh attach-disk bull /var/lib/libvirt/images/bull-vmail2.qcow2 vde \
--cache writeback \
--discard ignore \
--persistent

Create partition on attached disk
parted /dev/vde --script mklabel gpt
parted /dev/vde --script mkpart primary xfs 0% 100%

Format disk
mkfs.xfs -f -m reflink=0 /dev/vde1

Add entry to /etc/fstab
blkid
/dev/vde1: UUID="75c7522e-f196-442d-bd07-f997bed7d0cc" BLOCK_SIZE="512" TYPE="xfs" PARTLABEL="primary" PARTUUID="9b0f0bfe-1c6f-4d17-ab75-11de67a177da"

UUID=75c7522e-f196-442d-bd07-f997bed7d0cc /tmp/vmail xfs noatime,nodiratime,inode64,logbufs=8,allocsize=1m 0 0

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.