|How To...||Why not..?||Scripts|
Last update: 2018-12-18
In this post I show you an easy way to provide
/dev/urandom for your
Nextcloud instance running on OpenBSD.
This provides high quality random numbers to Nextcloud and silences the
error message that the device is not accessible.
I assume that you have installed Nextcloud from the package that is
available for OpenBSD. Further I assume that you either use httpd(8)
as your webserver or that you have a chroot(2)
configuration for your webserver that locks it into
If you don’t have changed it manually your
/var partition is mounted
with the option
nodev. This means that the directory
must reside on a dedicated partition which you can mount without the
nodev option. Allocating one from the SSD is a waste of space and
letter in the disklabel(5).
The memory file system mfs (mount_mfs(8)
is here to help. You can create a tiny mfs disk and mount it under
$ doas mount_mfs -s 1M /dev/sd0b /var/www/dev
You can use MAKEDEV(8) to
create the device file
$ cd /var/www/dev $ doas /dev/MAKEDEV urandom
This will not only create the device file but also the symlink
which points to
An entry in fstab(5) will create the filesystem during system boot:
$ doas vi /etc/fstab swap /var/www/dev rw,-s=1048576 0 0
I use rc.local(8) to create the device automatically during the system boot. My script looks like this:
#!/bin/ksh # # $Header$ echo -n "Create /var/www/dev/urandom: " cwd=$(pwd) cd /var/www/dev /dev/MAKEDEV urandom cd $cwd echo "."