What's the file system layout on an Azure VM?

What's the file system layout on an Azure VM?

I just created a virtual machine with Azure. According to the settings I used, it should have 32 GiB of temp storage plus a 30 GiB disk.

To get an overview, I ran df on the machine. This is the output:

Filesystem     1K-blocks    Used Available Use% Mounted on
udev             8180760       0   8180760   0% /dev
tmpfs            1639832     684   1639148   1% /run
/dev/sdb1       30309264 1372304  28920576   5% /
tmpfs            8199152       0   8199152   0% /dev/shm
tmpfs               5120       0      5120   0% /run/lock
tmpfs            8199152       0   8199152   0% /sys/fs/cgroup
/dev/sdb15        106858    3686    103173   4% /boot/efi
/dev/sda1       32894736   49180  31151556   1% /mnt
tmpfs            1639828       0   1639828   0% /run/user/1000

If I understand this correctly,

  • the 30 GiB disk is mounted to /, meaning that most directories by default are on the main disk;
  • the 32 GiB temp storage is mounted to /mnt.

It seems to me that /tmp is a regular subdirectory of /, which would mean that any files placed in /tmp would end up on the main disk rather than in temp storage.

Is that correct?

答案1

First of all: In the current state of affairs anything written to /tmp would indeed ne on the root fs.

But: You can decide what gets mounted where - just edit /etc/fstab or manually remount to your liking. In addition to that, nothing stops you from doing bind mounts to your liking as well or even create image files on your tempdisk and loop-mount the wherever you want

The latter trades a small overhead versus the fact, that you can just copy, move, upload or download the image file after unmounting it. This can come in handy with cloud VMs.

相关内容