Azure Classroomnotes 30/Nov/2022

Mounting Data disks on Azure Linux VMs

  • Linux Popular file system:
    • xfs
    • ext4
    • btrfs
    • zfs
  • Lets create a linux vm
    • Refer Here for official docs
    • list block devices on b1s
      Preview
    • lets attach an additional data disk
      Preview
    • Lets format the disk with xfs file system and mount it on to some folder
      Preview
      Preview
    • Now lets add some files to it
      Preview
    • Lets shutdown the vm and start the vm back. Login in and execute df -h
      Preview
    • 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)
      Preview
    • 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
    Preview
  • Refer Here
  • Standard File share
    • Create a storage account with standard (general purpose)
    • Add a file share
      Preview
      Preview
    • Now click on connect
      Preview
      Preview
    • mount to linux
      Preview
  • 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    

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Network Widget by Acurax Small Business Website Designers

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube