Using .IMG files with Azure Files and Container instances
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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