Skip to content

Instantly share code, notes, and snippets.

@lawrencegripper
Last active October 23, 2017 10:44
Embed
What would you like to do?
Using .IMG files with Azure Files and Container instances
#!/bin/sh
#!/bin/bash
# $1 = Azure storage account name
# $2 = Azure storage account key
# $3 = Azure file share name
# $4 = mountpoint path
mkdir -p $4
# CIFS settings from Azure CloudShell container which uses .img approach.
mount -t cifs //$1.file.core.windows.net/$3 $4 -o vers=2.1,username=$1,password=$2,sec=ntlmssp,cache=strict,domain=X,uid=0,noforceuid,gid=0,noforcegid,file_mode=0777,dir_mode=0777,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1
mkdir -p $4/imgs/
SHAREIMGFILE=$SHAREPATH/imgs/containerstorage.img
dd if=/dev/zero of=$SHAREIMGFILE bs=1M count=0 seek=10G
mkfs ext2 -F $SHAREIMGFILE
mount -o rw,relatime,block_validity,barrier,user_xattr,acl $SHAREIMGFILE $4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment