Add support for additional disks for config-local (#5030) (#5040)

* Add support for additional disks for config-local

(cherry picked from commit e4861f52e0)
This commit is contained in:
mergify[bot]
2019-07-12 10:01:07 -06:00
committed by Dan Albert
parent 086e20f6c7
commit 81dbe3c49b
7 changed files with 121 additions and 4 deletions

View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -x
mount_point=/mnt/extra-disk
disk=sdb
if ! lsblk | grep -q ${disk} ; then
echo "${disk} does not exist"
else
if mount | grep -q ${disk} ; then
echo "${disk} is already mounted"
else
sudo mkfs.ext4 -F /dev/"$disk"
sudo mkdir -p "$mount_point"
sudo mount /dev/"$disk" "$mount_point"
sudo chmod a+w "$mount_point"
if ! mount | grep -q ${mount_point} ; then
echo "${disk} failed to mount!"
exit 1
fi
fi
fi