Disk Layout

This box has 15G of storage. Since it is important that it uses full disk encryption, there is a small unencrypted /boot partition which stores the Linux kernel and the initramfs, a special filesystem which contains the basic utilities that allow the server to boot, unlock the encrypted disk, and mount the filesystem root /.

The disk partition layout is below:

root@<server># lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
xvda                      202:0    0   15G  0 disk  
|-xvda1                   202:1    0  731M  0 part  /boot
|-xvda2                   202:2    0    1K  0 part  
`-xvda5                   202:5    0 14.3G  0 part  
  `-xvda5_crypt           253:0    0 14.3G  0 crypt 
    |-<server>--vg-root   253:1    0 13.3G  0 lvm   /
    `-<server>--vg-swap_1 253:2    0  976M  0 lvm   [SWAP]

/dev/xvda is the entire (virtual) disk partition, while /dev/xvda1 is the partition which contains the kernel and initramfs and is mounted at /boot. /dev/xvda5 is the LUKS-encrypted container which is mapped to /dev/mapper/xvda5_crypt using dm-crypt. This mapped device is configured using the logical volume manager (LVM2) which allows for convenient resizing of partitions later. Currently, there are only two logical volumes (partitions): /dev/mapper/<server>--vg-root, which is a single ext4-formatted root filesystem containing all of the data and programs on this server, and /dev/mapper/<server>--vg-swap_1 which provides a place for the OS to page out (swap) the contents of memory to disk when the physical random-access memory (RAM) is full. It is, however, possible to create an arbitrary number of logical volumes, which can be resized much more easily than traditional physical partitions, along with more advanced benefits such as snapshots, useful for backing up a running system, and thin-provisioning, which allows for an administrator to over-commit storage, which is then allocated on demand.

root@<server># df -H
Filesystem                       Size  Used Avail Use% Mounted on
udev                             590M     0  590M   0% /dev
tmpfs                            124M  584K  124M   1% /run
/dev/mapper/<server>--vg-root     14G  3.9G  8.5G  32% /
tmpfs                            620M     0  620M   0% /dev/shm
tmpfs                            5.0M     0  5.0M   0% /run/lock
tmpfs                            620M     0  620M   0% /sys/fs/cgroup
/dev/xvda1                       704M  140M  513M  22% /boot

From the above output, it is possible to see that the root / partition is 32% full and the /boot is 22% full. If this Nextcloud installation is going to be used for by many users in the future, then I will need to add storage or move the installation to a server with more disk space. For now, however, it should be fine to host a few gigabytes of files on the server.