Mounting Data disks on Azure Linux VMs
- Linux Popular file system:
- Lets create a linux vm
- Refer Here for official docs
- list block devices on b1s

- lets attach an additional data disk

- Lets format the disk with xfs file system and mount it on to some folder


- Now lets add some files to it

- Lets shutdown the vm and start the vm back. Login in and execute
df -h

- In linux systems mount command is valid only for that session.
- To make mounts permenent we need to add entries in a file
/etc/fstab
Refer Here to this section for making entries
- Make a note of blkid for data disk
/dev/sdc: UUID="91bebe03-1031-4383-925b-47744a6ca70a" TYPE="xfs"
- Now add an entry into /etc/fstab
UUID=91bebe03-1031-4383-925b-47744a6ca70a /additional xfs defaults,nofail 1 2
- Now shutdown and start or (restart)

- To expand disk sizes Refer Here Refer Here
Azure File Share
- This is a storage that can be used by multiple linux, windows and mac instances present on cloud or on-premises

- Refer Here
- Standard File share
- Create a storage account with standard (general purpose)
- Add a file share


- Now click on connect


- mount to linux

- Script for linux to connect to file share
sudo mkdir /tools
if [ ! -d "/etc/smbcredentials" ]; then
sudo mkdir /etc/smbcredentials
fi
if [ ! -f "/etc/smbcredentials/forfilesqt.cred" ]; then
sudo bash -c 'echo "username=forfilesqt" >> /etc/smbcredentials/forfilesqt.cred'
sudo bash -c 'echo "password=0UERpDrw5Ddr3CBxgatfqa8S9S9okNGvJ9xl3pMAN4GweOMOYtQahtPA3EvU+9xitn35fhn8d1Ye+AStVhtTig==" >> /etc/smbcredentials/forfilesqt.cred'
fi
sudo chmod 600 /etc/smbcredentials/forfilesqt.cred
sudo bash -c 'echo "//forfilesqt.file.core.windows.net/tools /tools cifs nofail,credentials=/etc/smbcredentials/forfilesqt.cred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30" >> /etc/fstab'
sudo mount -t cifs //forfilesqt.file.core.windows.net/tools /tools -o credentials=/etc/smbcredentials/forfilesqt.cred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30
Like this:
Like Loading...