Skip to content

Commit

Permalink
check if already mounted + noreread
Browse files Browse the repository at this point in the history
  • Loading branch information
woodp committed Feb 1, 2018
1 parent 93dd84c commit aebf695
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions virtual-machines/single-vm/extensions/linux/format-disk.1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ partprobe
# Format and mount drive
echo ';' | sfdisk /dev/sdd
partprobe
mkfs -t ext3 /dev/sdd1
mkfs -t ext3 /dev/sdd1 --no-reread
mkdir -p /data2
mount /dev/sdd1 /data2
if grep -qs '/data2' /proc/mounts; then
echo "already mounted."
else
mount /dev/sdc1 /data1
fi
8 changes: 6 additions & 2 deletions virtual-machines/single-vm/extensions/linux/format-disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ partprobe
# Format and mount drive
echo ';' | sfdisk /dev/sdc
partprobe
mkfs -t ext3 /dev/sdc1
mkfs -t ext3 /dev/sdc1 --no-reread
mkdir -p /data1
mount /dev/sdc1 /data1
if grep -qs '/mnt/foo' /proc/mounts; then
echo "already mounted."
else
mount /dev/sdc1 /data1
fi

0 comments on commit aebf695

Please sign in to comment.