]> Raphaƫl G. Git Repositories - distgen/blob - lib/mkfs.sh
34bfe2ed705572548d34beac5a0bb4d0b068a6ab
[distgen] / lib / mkfs.sh
1 #! /bin/sh -e
2
3 # Create /boot on it
4 #XXX: it seems it's not possible to boot from ext4 or xfs V5 with grub-legacy anymore
5 mkfs.ext3 -L 'boot' -U ${BOOTUUID} /dev/md/${MDBOOT}
6
7 # Create swap on it
8 mkswap -L 'swapa' -U ${SWAPAUUID} ${LOOPA}p3
9 mkswap -L 'swapb' -U ${SWAPBUUID} ${LOOPB}p3
10
11 # Create filesystem
12 mkfs.btrfs -L 'data' -U ${DATAUUID} /dev/mapper/${DATANAME}
13
14 # Make mount point
15 mkdir -p ${MOUNTPOINT}
16
17 # Mount base filesystem
18 mount /dev/mapper/${DATANAME} ${MOUNTPOINT}
19
20 # Create slash subvolume
21 btrfs subvolume create ${MOUNTPOINT}/slash
22
23 # Create home subvolume
24 btrfs subvolume create ${MOUNTPOINT}/home
25
26 # Set slash as default
27 btrfs subvolume set-default $(btrfs subvolume list ${MOUNTPOINT} | grep slash | perl -pne 's/^ID\s([0-9]+)\s.*$/\1/') ${MOUNTPOINT}
28
29 # Unmount slash filesystem
30 umount ${MOUNTPOINT}