mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 09:39:08 +00:00
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:
parent
b606e28039
commit
86795cc605
@ -12,13 +12,13 @@ start()
|
|||||||
|
|
||||||
DEV="$(ls /dev/[xv]da | head -1 | sed s@/dev/@@)"
|
DEV="$(ls /dev/[xv]da | head -1 | sed s@/dev/@@)"
|
||||||
DRIVE="/dev/${DEV}"
|
DRIVE="/dev/${DEV}"
|
||||||
SWAP="${DRIVE}1"
|
|
||||||
DATA="${DRIVE}2"
|
|
||||||
|
|
||||||
if fdisk -l ${DRIVE} | grep -q "doesn't contain a valid partition table"
|
if fdisk -l ${DRIVE} | grep -q "doesn't contain a valid partition table"
|
||||||
then
|
then
|
||||||
ERASE_DISKS="${DRIVE}" setup-disk -m data ${DRIVE}
|
ERASE_DISKS="${DRIVE}" setup-disk -m data ${DRIVE}
|
||||||
else
|
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}
|
mount ${DATA} /var && swapon ${SWAP} || ERASE_DISKS="${DRIVE}" setup-disk -m data ${DRIVE}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user