Data Disk

We recommend using a separate disk to store persistent data, such as git repos, databases, etc ...

This simplifies backups (you will simply need to snapshot the data disk) and updates, since you can swap out the root partition without losing any data.

Your data disk will be mounted in /data.

1. Create a Virtual Disk and attach it

In your dashboard create a new virtual disk to and attach it to the GitBook VM you just created.

The size of the disk will depend on your needs, we recommend allocating at least 200GB or 500GB for larger installations.

2. Partition, format and mount

Your data disk will likely be /dev/sdb, you can list your disks with:

sudo fdisk -l

Now that we know /dev/sdb is there we can run the following commands to format and mount :

# Make partition
sudo parted -s -a optimal /dev/sdb mklabel gpt -- mkpart primary ext4 1 '-1'

# Format to ext4
sudo mkfs -t ext4 /dev/sdb1

# Make data dir
sudo mkdir -p /data

# Mount
sudo mount /dev/sdb1 /data

# Get the disk's UUID
disk_uuid=$(sudo blkid /dev/sdb1 | perl -n -e'/UUID="([^\"]+)"/ && print $1')

# Add to /etc/fstab so it's mounted on (re)boot
echo "UUID=${disk_uuid}    /data     auto    rw,user,auto    0    0" | sudo tee -a /etc/fstab

# Voila :)

results matching ""

    No results matching ""