# How to mount a directory for writing on a diskless workstation?



## oleantus (Mar 13, 2021)

I am trying to configure the boot of a diskless workstation. I got it thanks to the documentation.  I have configured directories /etc and /var for writing.  I figured out how to do this by looking at the file rc.initdiskless and other documentation. The diskless workstation now boots normally for me.

But I do not understand in any way how to make other directories (not root filesystems) available for writing.

For example, I want to make a directory /usr/local/etc/X11/xorg.conf.d/ writable. I want this directory to contain all the files from the template, so that I can write other files to this directory.  This directory must be in memory like /etc and /var.  Is it possible to do this with a rc.initdiskless or some other way?


----------



## Mjölnir (Mar 15, 2021)

You can create it under /var, e.g. /var/local/etc/, move it from the genuine /usr/local/etc, and instead place a symlink there: `ln -s ../../../var/local/etc/ /usr/local/etc`.  Now the whole tree under /usr/local/etc/ is writable.  Alternative to placing it in /var: put /usr/local/etc/* under /etc/local/.  That's just a matter of taste.


----------



## oleantus (Mar 18, 2021)

Mjölnir said:


> You can create it under /var, e.g. /var/local/etc/, move it from the genuine /usr/local/etc, and instead place a symlink there: `ln -s ../../../var/local/etc/ /usr/local/etc`.  Now the whole tree under /usr/local/etc/ is writable.  Alternative to placing it in /var: put /usr/local/etc/* under /etc/local/.  That's just a matter of taste.



Thanks, Mjölnir. I have already found another solution. I have an OS template for a diskless workstation in the /diskless directory. I created a directory /addons in OS template. And copied everything I need to writing there.


```
chroot /diskless
mkdir /addons
cp -R /usr/local/libdata/ldconfig /addons/
cp -R /usr/local/lib/vdpau /addons/
cp -R /usr/local/etc/X11/xorg.conf.d /addons/
cp -R /usr/local/etc/libmap.d /addons/
mkdir -p /conf/base/addons
echo 10240 > /conf/base/addons/md_size
tar -cvf /conf/base/addons.cpio.gz --format cpio --gzip /addons
exit
```

Then I added the following lines to the /etc/fstab in OS template:


```
/addons/ldconfig     /usr/local/libdata/ldconfig     nullfs    rw,late    0    0
/addons/vdpau        /usr/local/lib/vdpau            nullfs    rw,late    0    0
/addons/xorg.conf.d  /usr/local/etc/X11/xorg.conf.d  nullfs    rw,late    0    0
/addons/libmap.d     /usr/local/etc/libmap.d         nullfs    rw,late    0    0
```

And now, on a diskless workstation, I have write access to all the directories I need.


----------



## Mjölnir (Mar 18, 2021)

Please take some minutes to grasp BB codes.  Using them helps to enhance the readability of your posts by some orders of magnitude.


----------

