Modification : vm_{host,hosted,remote} -> {host,local,remote}/ .
[lhc/ateliers.git] / host / part-root-mount
diff --git a/host/part-root-mount b/host/part-root-mount
new file mode 100755 (executable)
index 0000000..0d0bafc
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh -eu
+tool=$(readlink -e "${0%/*}/..")
+. "$tool"/host/lib.sh
+
+test -e /dev/mapper/${vm_lvm_lv}_root_deciphered ||
+sudo cryptsetup luksOpen $vm_dev_disk_root ${vm_lvm_lv}_root_deciphered
+mountpoint -q /mnt/$vm_fqdn ||
+sudo mount -v -t ext4 /dev/mapper/${vm_lvm_lv}_root_deciphered /mnt/$vm_fqdn