Daniel's Blog

Adding a bind mount for etcd

The etcd servers need to have a fast disk to read/write from. They are saving their data to /var/lib/etcd so to handle this a new ssd was added to the system.

Looking at the fstab, the new SSD is mounted in /mnt/ssd

...
UUID=SOMEGUID /mnt/ssd       ext4 defaults,nofail 0 0
...

To add a bind mount for etcd's directory first folders are needed for storing the data:

$ sudo mkdir /mnt/ssd/etcd
$ sudo mkdir /var/lib/etcd

Then a new bind mount is added to /etc/fstab

/mnt/ssd/etcd                             /var/lib/etcd  none bind,nofail     0 0

Then the filesystem is mounted and tested:

$ sudo mount /var/lib/etcd/
$ sudo touch /var/lib/etcd/test.txt
$ ls /mnt/ssd/etcd/
test.txt
$ sudo rm /mnt/ssd/etcd/test.txt
$ ls /var/lib/etcd/