identify the partition types for mounting; fixes issues with some beta users where this changed

Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
This commit is contained in:
Justin Cormack 2015-12-15 16:54:06 +00:00
parent b606e28039
commit 86795cc605

View File

@ -12,13 +12,13 @@ start()
DEV="$(ls /dev/[xv]da | head -1 | sed s@/dev/@@)"
DRIVE="/dev/${DEV}"
SWAP="${DRIVE}1"
DATA="${DRIVE}2"
if fdisk -l ${DRIVE} | grep -q "doesn't contain a valid partition table"
then
ERASE_DISKS="${DRIVE}" setup-disk -m data ${DRIVE}
else
SWAP=$(fdisk -l ${DRIVE} | grep 'Linux swap' | awk '{print $1}')
DATA=$(fdisk -l ${DRIVE} | grep 'Linux$' | awk '{print $1}')
mount ${DATA} /var && swapon ${SWAP} || ERASE_DISKS="${DRIVE}" setup-disk -m data ${DRIVE}
fi
}