Condensed Linux disk mounting on Azure

So you just created a brand new drive to your VM. So now you need you VM to add this new data disk. So here is the short version of Azure instructions:
sudo grep SCSI /var/log/messages

locate the name of the new drive (if it is your second drive it should be /dev/sdc

sudo fdisk /dev/sdc

now we simply follow prompts: n p p w
sudo mkfs -t ext4 /dev/sdc1

this command will create the actual fielsystem usually default values are OK but if you know what you need enter the your values at the prompts – to accept default just press

sudo mkdir /datadrive

make directory for the drive to be mounted to

sudo mount /dev/sdc1 /datadrive

mount the drive pm your chosen directory (in our example it is /datadrive

sudo -i blkid

get the drive UUID for the fstab file we need to create

sudo vi /etc/fstab

edit the fstab file and enter the UDDID and mount point to let system mount this data drive at boot time

UUID=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e3e /datadrive ext4 defaults 1 2

sample format line from vstab for our drive


Lastly dismount the drive and mout it again to make sure that all is correct in the fstab file:

sudo umount /datadrive
sudo mount /datadrive

That’s it your drive will not be accessible (mind your permissions of course) and will be reattached tot he system when the system reboots.


Print Friendly, PDF & Email

Leave a comment

Your email address will not be published. Required fields are marked *

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