3 # Copyright (c) 2018 Enea AB and others
5 # This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 VOL_DEV_NAME="$(lsblk -l | grep -Po '^[vs]dc\W')"
13 if [ -n $VOL_DEV_NAME ]; then
14 sudo mkdir -p /home/cirros/volume
15 sudo /usr/sbin/mkfs.ext4 -F /dev/$VOL_DEV_NAME
16 sudo mount /dev/$VOL_DEV_NAME /home/cirros/volume
17 sudo touch /home/cirros/volume/new_data
18 echo "New data added to the volume!"
20 echo "Failed to write data!"