Skip to content

Commit 73814fa

Browse files
committed
Factor out the shared mount variables
1 parent b7f50a0 commit 73814fa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packer/linux/conf/bin/bk-mount-instance-storage.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,14 @@ mkfs.ext4 -F -E nodiscard "$logicalname" > /dev/null
5050
devicemount=/mnt/ephemeral
5151

5252
echo "Mounting $logicalname to $devicemount" >&2
53+
54+
fs_type="ext4"
55+
mount_options="defaults,noatime"
56+
5357
mkdir -p "$devicemount"
54-
mount -t ext4 -o noatime "$logicalname" "$devicemount"
58+
mount -t "${fs_type}" -o "${mount_options}" "$logicalname" "$devicemount"
5559

5660
if [ ! -f /etc/fstab.backup ]; then
5761
cp -rP /etc/fstab /etc/fstab.backup
58-
echo "$logicalname $devicemount ext4 defaults 0 0" >> /etc/fstab
62+
echo "$logicalname $devicemount ${fs_type} ${mount_options} 0 0" >> /etc/fstab
5963
fi

0 commit comments

Comments
 (0)