X-Git-Url: https://git.rapsys.eu/distgen/blobdiff_plain/6d2ea3b7342187b1d5209f1d1efef79427471c80..90b9e7ac33c084283218dc95a25cd019aead1192:/lib/mkfs.sh?ds=inline diff --git a/lib/mkfs.sh b/lib/mkfs.sh index 1ccc671..34bfe2e 100644 --- a/lib/mkfs.sh +++ b/lib/mkfs.sh @@ -5,11 +5,26 @@ 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 slash subvolume +btrfs subvolume create ${MOUNTPOINT}/slash + +# Create home subvolume +btrfs subvolume create ${MOUNTPOINT}/home + +# 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}