Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: GPT partition table for large disks

...

  1. Create a partition and format it. You may use parted and mkfs.ext4:

    No Format
    sudo parted -s -a-script  -- /dev/vdb mklabel gpt  # this step only required for large disks, e.g. >2TB
    sudo parted --script --align optimal -- /dev/vdb mkpart primary ext4 0% 100%
    sudo mkfs.ext4 -L data-1 /dev/vdb1


    Info

    You may partition the disk differently and use any other filesystem type. It is a good idea to use the same name for the volume to set the label of the new filesystem


  2. Add this entry to your VM's  /etc/fstab, adapting the label to the name you chose earlier:

    No Format
    ​echo "LABEL=data-1 /data1 ext4 defaults 0 0" | sudo tee -a /etc/fstab > /dev/null


  3. Make the directory where you are mounting your filesystem. Make sure you use the same path as defined in fstab:

    No Format
    sudo mkdir /data1


  4. Mount the file system

    No Format
    sudo mount -av


...