Prepare a temporary virtual machine disk

This topic describes how to create a temporary disk to contain the Access Gateway Microsoft Azure disk image. Clone the image and associate it with a virtual machine (VM) by attaching the disk to the VM.

To prepare a disk mounted on a Microsoft Azure VM:

  1. Connect to the VM using the IP address that was generated from the task you performed in Create a temporary virtual machine to host the disk.ssh okta@AA.BB.CC.DD.
  2. Find the disk using the dmesg| grep "SCSI disk" command. # 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

    Ubuntu 18.04 uses two disks by default: /dev/sda and /dev/sdb. The disk produced by the task in Create a temporary virtual machine to host the disk is /dev/sdc.

    Confirm which disks are in use using a command like df -h | grep /dev/sd. This produces output like this:/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.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 using the sudo mkfs -t ext4 /dev/sdc1 command.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 the mkdir command.
    sudo mkdir /datadrive
  6. Mount the disk to the new mount point using the mount command.sudo mount /dev/sdc1 /datadrive
  7. Determine the UUID of the disk using the blkid command.
    sudo -i blkid | grep sdc1 /dev/sdc1: UUID="1fcbf355-d641-4fcf-8817-0b4b492413ac" TYPE="ext4" PARTUUID="75642bad-01"
  8. Add an entry to the /etc/fstab disk.
    sudo nano /etc/fstab UUID="1fcbf355-d641-4fcf-8817-0b4b492413ac" /datadrive ext4 defaults,nofail 1 2
  9. Reboot the VM, reconnect, and then 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 approximately 467 gigabytes of free space.