Prepare temporary VM disk

A temporary disk is used to contain the Access Gateway MS Azure disk image. This image is then cloned and associated with a VM. During this task we will use the Linux command line to create the required temporary disk.

To prepare a disk mounted on a Microsoft Azure VM:

  1. At the command line, connect to the new vm using the IP address from the prior task.
    ssh okta@AA.BB.CC.DD.
  2. Find the disk using dmesg| grep "SCSI disk" command.

    For example:

    # dmesg | grep "SCSI disk"
    [    2.234786] sd 3:0:1:0: [sdb] Attached SCSI disk
    [    2.243805] sd 0:0:0:0: [sda] Attached SCSI disk
    [   2.503937] sd 5:0:0:0: [sdc] Attached SCSI disk

    Unbuntu 18.04 by default uses two disks /dev/sda and /dev/sdb. Making the third disk added in the last task /dev/sdc.
    In use disks can be confirmed using a command such as df -h | grep /dev/sd which will produce output similar to:

    /dev/sda1        29G  1.4G   28G   5% /
    /dev/sda15      105M  4.4M  100M   5% /boot/efi
    /dev/sdb1        16G   45M   15G   1% /mnt
    

  3. Create a primary disk partition using the sudo fdisk /dev/sdc command as shown below :

    For example:

    sudo fdisk /dev/sdc
    . . . 
    Command (m for help) n
    Partition type
    p   primary (0 primary, 0 extended, 4 free)
    e   extended (container for logical partitions)
    Select (default p): p
    Partition number (1-4, default 1): 1
    First sector (2048-1048575999, default 2048):
    Last sector, +sectors or +size{K,M,G,T,P} (2048-1048575999, default 1048575999):[cr]
    Command (m for help): w
    . . .
    Syncing disks.
    
  4. Create a pfile system on the disk the sudo mkfs -t ext4 /dev/sdc1 command as shown below :

    For example:

    sudo mkfs -t ext4 /dev/sdc1
    mke2ds 1.44.1 . . . 
    . . .
    Writing superblocsl and filesystem accounting information: done
    
  5. Create a mount point for the new disk using mkdir as shown below:
    sudo mkdir /datadrive
    
  6. Mount the disk to the new mount point using mount as shown below:
    sudo mount /dev/sdc1 /datadrive
    
  7. Determine the UUID of the disk using the blkid command as shown below:
    sudo -i blkid  | grep sdc1
    /dev/sdc1: UUID="1fcbf355-d641-4fcf-8817-0b4b492413ac" TYPE="ext4" PARTUUID="75642bad-01"
  8. Using an editor such as nano or vi add a new entry to /etc/fstab which should resemble:
    sudo nano /etc/fstab
    UUID="1fcbf355-d641-4fcf-8817-0b4b492413ac"      /datadrive   ext4   defaults,nofail   1 2
  9. Reboot the VM, reconnect and verify that the new file system is mounted:
    sudo shutdown -r now
    ssh okta@ip address
    df -h | grep sdc1

    The new device should show approximate 467GB free.

Related topics

For more information on Managing Resource groups using the MS Azure CLI see Manage Azure resources using Azure CLI.

For more information on Managing Resource groups using the MS Azure UI see Manage Azure resource groups using the Azure portal.