| sudo chmod 0400 /root/volumes_luks_pwd | sudo chmod 0400 /root/volumes_luks_pwd | ||||
| sudo cryptsetup luksAddKey /dev/sdX1 /root/volumes_luks_pwd | sudo cryptsetup luksAddKey /dev/sdX1 /root/volumes_luks_pwd | ||||
| Add to /etc/crypttab: | |||||
| Add to `/etc/crypttab`: | |||||
| volumes /dev/disk/by-uuid/uuid-of-your-drive /root/volumes_luks_pwd luks | volumes /dev/disk/by-uuid/uuid-of-your-drive /root/volumes_luks_pwd luks | ||||
| and add to /etc/fstab: | |||||
| and add to `/etc/fstab`: | |||||
| /dev/mapper/volumes /media/volumes ext4 defaults 0 2 | /dev/mapper/volumes /media/volumes ext4 defaults 0 2 | ||||
| sudo mkdir -p /export/volumes | sudo mkdir -p /export/volumes | ||||
| sudo mount --bind /media/volumes /export/volumes | sudo mount --bind /media/volumes /export/volumes | ||||
| And add the following line to /etc/fstab toavoid repeating it on startup: | |||||
| And add the following line to `/etc/fstab` to avoid repeating it on startup: | |||||
| /media/volumes /export/volumes none bind 0 0 | /media/volumes /export/volumes none bind 0 0 | ||||
| And to /etc/exports: | |||||
| And to `/etc/exports`: | |||||
| /export 192.168.1.0/24(rw,fsid=0,insecure,no_subtree_check,async) | /export 192.168.1.0/24(rw,fsid=0,insecure,no_subtree_check,async) | ||||
| /export/volumes 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,async,no_root_squash) | /export/volumes 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,async,no_root_squash) | ||||
| sudo aptitude install nfs-common | sudo aptitude install nfs-common | ||||
| And add to fstab: | |||||
| And add to `/etc/fstab`: | |||||
| your-main-host:/export/volumes /media/volumes nfs auto,user 0 0 | your-main-host:/export/volumes /media/volumes nfs auto,user 0 0 | ||||
| When the dockers are running, some service users (e.g. `dovecot` or `mysqld`) can have conflicting ids with the one of avahi, making it fail. To avoid that, we can just increase its `uid`, e.g.: | When the dockers are running, some service users (e.g. `dovecot` or `mysqld`) can have conflicting ids with the one of avahi, making it fail. To avoid that, we can just increase its `uid`, e.g.: | ||||
| sudo systemctl stop avahi-daemon | |||||
| sudo usermod -u 205 avahi | sudo usermod -u 205 avahi | ||||
| sudo service dbus restart | |||||
| sudo service avahi restart | |||||
| sudo systemctl restart dbus | |||||
| sudo systemctl start avahi-daemon | |||||
| Install missing `libnss-mdns` package (see explanation [here](https://paulnebel.io/api/containers/lean/node/raspberry_pi/swarm/2016/08/23/hypriotos-swarm-raspberry-pi-cluster/)): | Install missing `libnss-mdns` package (see explanation [here](https://paulnebel.io/api/containers/lean/node/raspberry_pi/swarm/2016/08/23/hypriotos-swarm-raspberry-pi-cluster/)): | ||||