+echo "-> Creating directories"
+mkdir --mode=700 -p $datadir $imagedir $isomountdir $tmpdir
+if [ $? != 0 ]; then
+ test -d $isomountdir && rm -rf $isomountdir
+ err "Unable to create the following directories:
+ $datadir $imagedir $isomountdir $tmpdir"
+fi
+
+echo "-> Creating the iso image in $isoimage"
+dd of=$isoimage bs=1M count=0 seek=$imagesizemb
+
+[ $? != 0 ] && err "dd failed to create $isoimage"
+
+mke2fs -b $blocksize -F $isoimage
+if [ $? != 0 ]; then
+ rm -rf $isomountdir $isoimage
+ err "Unable to create the iso image: $isoimage"
+fi
+
+e2label $isoimage $today
+if [ $? != 0 ]; then
+ rm -rf $isomountdir $isoimage
+ err "Unable to label the iso image: $isoimage"
+fi
+
+echo "-> Mounting the iso image"