In part 2, I setup my nas, but I didn’t notice that I created ZFS pool without mirroring.

Let’s try to fix this.

$ zpool remove dpool sdc
$ zpool status
  pool: dpool
 state: ONLINE
 remove: Evacuation of /dev/sdc1 in progress since Sun May 30 08:51:38 2021
 4.23G copied out of 202G at 80.1M/s, 2.10% done, 0h42m to go
    566K memory used for removed device mappings
config:

        NAME          STATE     READ WRITE CKSUM
        dpool         ONLINE       0     0     0
          sdb         ONLINE       0     0     0
          sdc         ONLINE       0     0     0

errors: No known data errors

After it completes, I attach now the newly free disk to mirror the first one.

$ zpool attach dpool sdb sdc
$ zpool status
  pool: dpool
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Sun May 30 09:38:12 2021
        404G scanned at 2.43G/s, 1.52G issued at 9.41M/s, 404G total
        1.53G resilvered, 0.38% done, no estimated completion time
remove: Removal of vdev 1 copied 202G in 0h44m, completed on Sun May 30 09:36:27 2021
    566K memory used for removed device mappings
config:

        NAME          STATE     READ WRITE CKSUM
        dpool         ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            sdb       ONLINE       0     0     0
            sdc       ONLINE       0     0     0  (resilvering)

errors: No known data errors

It ended without any stress/warning/error… how much do I love ZFS !

DNS day

I want to configure a authoritative DNS for my eoli3n.eu.org domain.
This DNS server will not be used as a recursive one, even locally, I just want it to resolv *.eoli3n.eu.org.
Following bind9 debian wiki page, I setup a bind authoritative server in a chroot. Here’s the bind config

$ cat /etc/bind/named.conf.options
options {
    directory "/var/cache/bind";

    // Listen on ipv4 interfaces only
    listen-on {
        127.0.0.1;
        192.168.0.253;
    };
    listen-on-v6      { none; };

    // Hide version
    version "[SECURED]";

    // disable zone transfert
    allow-transfer    {"none";};

    // disable recursion
    recursion no;

    // allow query
    allow-query       { any; };
    allow-query-cache { any; };
};

$ cat /etc/bind/named.conf.local
// https://serverfault.com/a/306109/339917
include "/etc/bind/zones.rfc1918";

zone "eoli3n.eu.org." IN {
    type master;
    file "selfhost.zone";
};

$ cat /var/bind9/chroot/var/cache/bind/selfhost.zone
$TTL 86400
@       IN      SOA     ns1 root (
                        1622390729 ; serial number
                        8h ; Refresh
                        2h ; Retry
                        8h ; Expire
                        4m ; Min TTL
                        )

@       IN      NS      ns1
ns1     IN      A       $public_ip

*       IN      A       $public_ip

Lets test it

$ dig @127.0.0.1 ns1.eoli3n.eu.org
[...]
;; ANSWER SECTION:
ns1.eoli3n.eu.org.	86400	IN	A	$public_ip

;; AUTHORITY SECTION:
eoli3n.eu.org.		86400	IN	NS	ns1.eoli3n.eu.org.
[...]

Get my own domain on eu.org

I asked for eoli3n.eu.org domain by creating a request on the free domain registrar eu.org.
To configure it, just add ns1.eoli3n.eu.org glue record with your public IP and redirect TCP/UDP on port 53 to your DNS server on your ISP router.