Network storage in OpenWrt

To configure network storage is one of the easiest operations which have been already made by us. Considering that there are torrent clients included in utilities we can easy convert the router into the torrent-downloader. Here we will also analyze how the hard disk can be shared in network.

So, we take the hard disk with ide or sata interface. Take this adaptor «ide,sata in usb». Connect each other and then connect them to router. There is a file system ext3 on the hard disk.

On the stage of configuration OpenWrt the following modules should be selected:
Network:
<*> samba3 (выделяем как <*>)
Luci:
Modules:
<M> luci-mod-admin-full
Themes:
<M> luci-theme-openwrt
Collections:
<M> Luci
Application:
<M> luci-app-samba

Because we have marked samba3 as <*>, we should upgrade the firmware in the router and the file system on the usb-stick. Upgrading.

Loading and checking the output ps:

root@OpenWrt:/# ps
PID USER VSZ STAT COMMAND
1 root 1408 S init
2 root 0 SW [kthreadd]
3 root 0 SW [ksoftirqd/0]
4 root 0 SW [kworker/0:0]
5 root 0 SW [kworker/u:0]
6 root 0 SW< [khelper]
7 root 0 SW [kworker/u:1]
24 root 0 SW [sync_supers]
26 root 0 SW [bdi-default]
28 root 0 SW< [kblockd]
62 root 0 SW [kswapd0]
63 root 0 SW< [aio]
64 root 0 SW< [crypto]
80 root 0 SW [kworker/0:1]
83 root 0 SW [mtdblock0]
88 root 0 SW [mtdblock1]
93 root 0 SW [mtdblock2]
98 root 0 SW [mtdblock3]
103 root 0 SW [mtdblock4]
290 root 1432 S /bin/sh /etc/init.d/rcS S boot
291 root 1408 S init
293 root 1400 S logger -s -p 6 -t sysinit
329 root 1412 S syslogd -C16
331 root 1392 S klogd
345 root 860 S /sbin/hotplug2 --override --persistent --set-worker
457 root 0 SW< [cfg80211]
484 root 1404 S udhcpc -t 0 -i eth0.1 -b -p /var/run/dhcp-eth0.1.pid
527 root 0 SW [khubd]
557 root 0 SW< [phy0]
787 root 1008 S mini_httpd -C /etc/mini_httpd.conf
793 root 1400 S telnetd -l /bin/login.sh
815 nobody 964 S /usr/sbin/dnsmasq -K -D -y -Z -b -E -s lan -S /lan/
941 root 1404 S /bin/ash --login
967 root 1200 S /usr/sbin/dropbear -P /var/run/dropbear.1.pid -p 22
968 root 2684 S N smbd -D
970 root 2184 S nmbd -D
990 root 0 SWN [jffs2_gcd_mtd3]
1015 root 1392 S watchdog -t 5 /dev/watchdog
1019 root 1400 R ps

As we can see samba (smbd and nmbd) is working. For sharing of resources we use the web-interface Luci. Installing it:

root@OpenWrt:/# opkg install luci-mod-admin-full luci-theme-openwrt luci luci-app-samba
Installing luci-mod-admin-full (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-mod-admin-full_0.10+svn6605-1_brcm47xx.ipk.
Installing luci-mod-admin-core (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-mod-admin-core_0.10+svn6605-1_brcm47xx.ipk.
Installing luci-lib-web (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-lib-web_0.10+svn6605-1_brcm47xx.ipk.
Installing luci-lib-core (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-lib-core_0.10+svn6605-1_brcm47xx.ipk.
Installing lua (5.1.4-7) to root...
Downloading ftp://ftp:ftp@192.168.0.9/lua_5.1.4-7_brcm47xx.ipk.
Installing liblua (5.1.4-7) to root...
Downloading ftp://ftp:ftp@192.168.0.9/liblua_5.1.4-7_brcm47xx.ipk.
Installing libuci-lua (2010-09-28.2-2) to root...
Downloading ftp://ftp:ftp@192.168.0.9/libuci-lua_2010-09-28.2-2_brcm47xx.ipk.
Installing luci-lib-sys (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-lib-sys_0.10+svn6605-1_brcm47xx.ipk.
Installing luci-lib-nixio (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-lib-nixio_0.10+svn6605-1_brcm47xx.ipk.
Installing luci-sgi-cgi (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-sgi-cgi_0.10+svn6605-1_brcm47xx.ipk.
Installing luci-lib-lmo (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-lib-lmo_0.10+svn6605-1_brcm47xx.ipk.
Installing luci-i18n-english (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-i18n-english_0.10+svn6605-1_brcm47xx.ipk.
Installing luci-lib-ipkg (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-lib-ipkg_0.10+svn6605-1_brcm47xx.ipk.
Installing luci-theme-openwrt (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-theme-openwrt_0.10+svn6605-1_brcm47xx.ipk.
Installing luci-theme-base (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-theme-base_0.10+svn6605-1_brcm47xx.ipk.
Installing luci (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci_0.10+svn6605-1_brcm47xx.ipk.
Installing uhttpd (19) to root...
Downloading ftp://ftp:ftp@192.168.0.9/uhttpd_19_brcm47xx.ipk.
Installing luci-app-firewall (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-app-firewall_0.10+svn6605-1_brcm47xx.ipk.
Installing luci-app-initmgr (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-app-initmgr_0.10+svn6605-1_brcm47xx.ipk.
Installing luci-app-samba (0.10+svn6605-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/luci-app-samba_0.10+svn6605-1_brcm47xx.ipk.
Configuring luci-lib-sys.
Configuring liblua.
Configuring libuci-lua.
Configuring lua.
Configuring luci-lib-core.
Configuring luci-lib-nixio.
Configuring luci-sgi-cgi.
Configuring luci-lib-lmo.
Configuring luci-lib-web.
Configuring luci-i18n-english.
Configuring luci-mod-admin-core.
Configuring luci-lib-ipkg.
Configuring luci-mod-admin-full.
Configuring luci-app-samba.
Configuring luci-theme-base.
Configuring luci-theme-openwrt.
Configuring luci-app-firewall.
Configuring uhttpd.
Configuring luci-app-initmgr.
Configuring luci.

Connect the external hard disk. My one was detected as /dev/sdb. Install it to the directory /mnt/ext_drive and allow all the users reading - writing.

root@OpenWrt:/# cd /mnt/
root@OpenWrt:/mnt# mkdir ext_drive
root@OpenWrt:/mnt# mount /dev/sdb5 ext_drive/
root@OpenWrt:/mnt# chmod a+rw ./* -R

Open the browser 192.168.0.1 and go to the section Services => Network Shares. Fill in fields: Name: openwrt_share, Path:/mnt/ext_drive, select Allow Guest,mask 0777. Save and apply Save & Apply.

Now on the other computer (I have windows on it) we go to “Network connection” and see there our shared disk. Done.

adaptor HDD