Using OpenWrt for NAS usually involves a device with a single ethernet port and some kind of mass storage.
After Basic configuration of your device, as a typical NAS user, you may need to configure your device to obtain an IP number from some other router and then just sit there and be a NAS. This is similar to how we configure a dumb AP using managed services.
Do the following from the command line as root to disable unnecessary services (an alternative is of course to build the image without these components by removing them during menuconfig):
service dnsmasq disable service dnsmasq stop
service odhcpd disable service odhcpd stop
service firewall disable service firewall stop
/etc/config/system to reflect your timezone, or all timestamps will be in UTC. This matters for NAS storage. For example I set: option timezone 'CET-1CEST,M3.5.0,M10.5.0/3'
You will probably want to install some services for managing your as an OpenWrt NAS. This would be a typical set of packages:
apk update apk add luci ksmbd-server luci-app-ksmbd kmod-usb-storage block-mount e2fsprogs
This will enable the LuCI web UI, the ksmbd file server and the ''block'' tool for block storage on USB as well as the necessary packages for handling USB mass storage.
If you want to use NFS exports do:
apk add nfs-kernel-server
Then add entries for desired exports into
/etc/exports
such as this to export a certain mount point to the internal network:
/mnt/sda1 192.168.1.0/24(rw,sync,all_squash,no_subtree_check)
If you have an empty disk attached to your NAS, partition this free space like this:
fdisk /dev/sda (NOTICE fdisk can only handle up to 2TB disks, for larger storage you need a GPT partition table, then use gdisk instead)/dev/sda1mkfs.ext4 /dev/sda1/dev/sda1 partion for mounting:block detect | uci import fstab uci set fstab.@mount[0].enabled='1' uci commit fstab
/dev/sda1 for mounting with cat /etc/config/fstabdf should show you /dev/sda1 mounted as /mnt/sda1