mkfs.ext3 -L 'boot' -U ${BOOTUUID} /dev/md/${MDBOOT}
# Create swap on it
-mkswap -U ${SWAPAUUID} ${LOOPA}p3
-mkswap -U ${SWAPBUUID} ${LOOPB}p3
-
-# Create filesystem
-mkfs.btrfs -L 'slash' -U ${SLASHUUID} /dev/mapper/${SLASHNAME}
+mkswap -L 'swapa' -U ${SWAPAUUID} ${LOOPA}p3
+mkswap -L 'swapb' -U ${SWAPBUUID} ${LOOPB}p3
# Create filesystem
mkfs.btrfs -L 'data' -U ${DATAUUID} /dev/mapper/${DATANAME}
+
+# Make mount point
+mkdir -p ${MOUNTPOINT}
+
+# Mount base filesystem
+mount /dev/mapper/${DATANAME} ${MOUNTPOINT}
+
+# Create home subvolume
+btrfs subvolume create ${MOUNTPOINT}/home
+
+# Create mail subvolume
+btrfs subvolume create ${MOUNTPOINT}/mail
+
+# Create mysql subvolume
+btrfs subvolume create ${MOUNTPOINT}/mysql
+
+# Create slash subvolume
+btrfs subvolume create ${MOUNTPOINT}/slash
+
+# Set slash as default
+btrfs subvolume set-default $(btrfs subvolume list ${MOUNTPOINT} | grep slash | perl -pne 's/^ID\s([0-9]+)\s.*$/\1/') ${MOUNTPOINT}
+
+# Unmount slash filesystem
+umount ${MOUNTPOINT}