Mount a CIFS share to QNAP on reboot

Recently I purchased a qnap TS-251+ mostly for using its applications like photo sharing/QvPC/Qsirch and others. I already have my storage on a raidz array which is hosted on FreeNAS 9.10. FreeNAS then provides the storage through various ways to my pc’s/mac in my house using mostly CIFS and ISCSI. My TS-251+ currently hosts only 1 6TB disk (will purchase another one in the future for a raid mirroring volume) but I don’t care so much because all my storage is on the FreeNAS at the moment.

After purchasing the qnap I found out that there is no way that you can mount external shares automatically from the UI (you can only do it for ISCSI targets). And the worse thing is that if you mount them from command line when you reboot the machine they are not remounted because the /etc/fstab file on the NAS lives in RAM, and therefore does not survive the “reboot”

So after a bit of research here I found out how you can do it.

Continue reading