Add support for additional disks for config-local (#5030)
* Add support for additional disks for config-local * Restore wrongly deleted lines * Shellcheck * add args in the right place dummy * Fix nits * typo * var naming cleanup * Add stub function for remaining cloud providers
This commit is contained in:
21
net/scripts/mount-additional-disk.sh
Executable file
21
net/scripts/mount-additional-disk.sh
Executable 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
|
Reference in New Issue
Block a user