LinkedIn Sourceforge Twitter

Vincent's Blog

Pleasure in the job puts perfection in the work (Aristote)

Fosdem 2019: a full featured NAS on top of OpenBSD

Posted on 2019-02-03 14:46:00 from Vincent in Open Bsd

It was a good experience to present my NAS server to the fosdem. In this post I share some extra elements


A full featured NAS on top of OpenBSD

The slides I've used during this talk are available here

I hope it will convince people to give OpenBSD a try.

OpenBSD is not complex. It can do much more than network related tasks (firewall, ...).

Let's evaluate it your self ;-)

Some extra comments

I've few elements extra to share that complement this presentation

DD is not an option to create a backup disk

On the slide 28, I present possibilities to copy the main disk to the backup disk. Based on discussions after the talk, it appears clear that DD must be treated with care. Indeed, DD will copy all blocks presented on disk1 (let's say /dev/sd1i) to the second disk (/dev/sd2i). In current situation (encryption, ...) you will also copy parameters used to create the "un-encrypted" disks. If the source disks and destination disks are exactly the same, it could succeed. In all other cases, you are in front of troubles. Thinks about the un-encrypted disk geometry.

NFS over wifi must be based on TCP

By default NFS client will connect an NFS server in UDP. You can force to use TCP by putting such info in your /etc/fstab file:

nas:/mnt/sd1 /net/nas nfs  rw,noauto,bg,nodev,nosuid,soft,intr,-T,-r=4096,-w=4096 0 0

The parameter -T will force the usage of TCP.

2 persons proposed to use NFS over TCP for wifi connections. In my case, this does not work :(. We can see that sshfs is better than NFS even when using TCP.

Let me show some outputs here after.

Write to the NFS server

I will copy a file of 100MB, which is the size of a small video file taken with a camera.

NFS with UDP:

obsd-laptop:~$ mount -t nfs        
nas:/mnt/sd1 on /net/nas type nfs (nodev, nosuid, v3, udp, soft, intr, wsize=4096, rsize=4096, rdirsize=4096, timeo=100)

After 26 minutes I've stopped the process.

obsd-laptop:~/documents$ time dd if=/dev/random of=bogfile bs=1m count=100 
100+0 records in
100+0 records out
104857600 bytes transferred in 1486.211 secs (70554 bytes/sec)
    26m16.45s real     0m00.00s user     0m12.61s system
obsd-laptop:~/documents$

NFS with TCP:

obsd-laptop:~$ mount -t nfs        
nas:/mnt/sd1 on /net/nas type nfs (nodev, nosuid, v3, tcp, soft, intr, wsize=4096, rsize=4096, rdirsize=4096, timeo=100)

obsd-laptop:~/documents$ time dd if=/dev/random of=bogfile bs=1m count=100
100+0 records in
100+0 records out
104857600 bytes transferred in 87.391 secs (1199865 bytes/sec)
    1m44.25s real     0m00.00s user     0m06.55s system
obsd-laptop:~/documents$

SSHFS:

obsd-laptop:~$ mount -t fuse
fusefs on /net/nas type fuse (local)

obsd-laptop:~$ cd documents/
obsd-laptop:~/documents$ time dd if=/dev/random of=bogfile bs=1m count=100
100+0 records in
100+0 records out
104857600 bytes transferred in 57.170 secs (1834118 bytes/sec)
    0m58.16s real     0m00.00s user     0m01.64s system
obsd-laptop:~/documents$ cd

Read from NFS server

I will copy the same file of 100MB

NFS with UDP

obsd-laptop:~/documents$ mount -t nfs
nas:/mnt/sd1 on /net/nas type nfs (nodev, nosuid, v3, udp, soft, intr, wsize=4096, rsize=4096, rdirsize=4096, timeo=100)
obsd-laptop:~/documents$ ls -alh bogfile 
-rw-r--r--  1 vi  wheel   100M Feb  3 15:02 bogfile
obsd-laptop:~/documents$ time cp bogfile /tmp                                            
    2m45.18s real     0m00.01s user     0m03.35s system
obsd-laptop:~/documents$

NFS with TCP

obsd-laptop:~$ mount -t nfs         
nas:/mnt/sd1 on /net/nas type nfs (nodev, nosuid, v3, tcp, soft, intr, wsize=4096, rsize=4096, rdirsize=4096, timeo=100)
obsd-laptop:~$ cd documents/        
obsd-laptop:~/documents$ time cp bogfile /tmp 
    4m31.38s real     0m00.02s user     0m06.22s system
obsd-laptop:~/documents$

SSHFS:

obsd-laptop:~/documents$ mount -t fuse
fusefs on /net/nas type fuse (local)
obsd-laptop:~$ cd documents/                                                             
obsd-laptop:~/documents$ time cp bogfile /tmp 
    2m53.36s real     0m00.00s user     0m00.78s system
obsd-laptop:~/documents$

Conclusions

To my own perception, if the network traffic is not "perfect", its better to not use NFS.

I'll try to buy an another wifi device for my laptop (or an another laptop) to see if there is differences.



5, 3
displayed: 1699



What is the first vowel of the word Moon?