Mr3020 tp link router and openwrt

hi everyone, i’m having difficulties with a little thing i’m trying to do, i thought that was the best section but if i’m wrong just move it where you mods thing it is better ahah
well, i’m building myself a drop box
i chose mr3020 router: i want to install openwrt, overlay a usb to add storage, install packages for network tools such as nmap, ettercap and so on
flashing openwrt is simple. i can’t flash the last version since chaos calmer doesn’t give me enought free space so i use barrier breaker
after flashing it i procede to telnet to the router, passwd a password and then access to it throught ssh
in a ssh session i update the packages with the
opkg update
command. then i install the packages i need in order to use an external usb with
opkg install kmod-scsi-core kmod-usb-storage block-mount kmod-lib-crc16 kmod-crypto-hash kmod-fs-ext4
i reboot the router, ssh to it again (or using the web interface) and no matter what i do i’m not able to use the ext usb
i try to config the /etc/config/stab in different ways (i googled different guides but noone seems to work)
(what i want to do is pivot overlay, not pivot root btw)
i’m able to choose /overlay as the mount point for /dev/sda2 (the partition with 6 gb of storage, /sda1 is for swap and that one works without a problem) and using the web interface it actually says i have 6 gb of free space but if i try to install a package it tries to install it on /overlay where i have 72 kb of free space and so it fails
did anyone of you done something similar and can give me a hand?
WaRWolFz crew

if i try to install a package it tries to install it on /overlay where i have 72 kb of free space and so it fails
Are you sure it tries to install it on /overlay? Sounds to me like the overlaying isn’t working like it is supposed to.
Perhaps you can provide some more info, like the output of mount, (/overlay)/etc/config/fstab and whether you can manually write more than 72kB data to /overlay or /.

yeah sure, one minute
so the df command gives me this:
root@OpenWrt:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 640 612 28 96% /
/dev/root 2304 2304 0 100% /rom
tmpfs 14428 76 14352 1% /tmp
/dev/mtdblock3 7056312 17024 6657800 0% /overlay
overlayfs:/overlay 640 612 28 96% /
tmpfs 512 0 512 0% /dev
/dev/sda2 7056312 17024 6657800 0% /overlay
if i go to luci, the web interface, it says:
Free space: 100% (6.71 GB)
so it gets that i have a usb mounted and working BUT if it has to install a package it does that on overlayfs:/overlay which still is 640 kb
on /etc/config/fstab i have
```
config global
option anon_swap ‘0’
option anon_mount ‘0’
option auto_swap ‘1’
option auto_mount ‘1’
option delay_root ‘5’
option check_fs ‘0’
config mount
option target ‘overlay’
option uuid ‘4f268338-bbf4-43af-a6d4-626ea3b4305c’
option device ‘/dev/sda2’
option enabled ‘1’
option fstype ‘ext4’
config swap
option enabled ‘1’
option device ‘/dev/sda1’
```
option target ‘overlay’ is missing the / at the start of /overlay: this is a workaround i’ve found on openwrt wiki for a bug. if i write /overlay it doesn’t work
WaRWolFz crew

Workaround for what? It doesn’t work now, does it?
You didn’t include the output of mount. It would be nice if you could tell us how things are when you look around manually. Is the overlay working properly then? (Stuff of sda2 is in /? Can write enough data to it via the overlay and not just in /overlay itself?)
Also, next time don’t post ‘yeah sure, one minute’ and then edit that post. The message isn’t really necessary anyway and there is no notification for the edit.

[quote=dloser]
Workaround for what? It doesn’t work now, does it?
[/quote]
using ‘/overlay’ doesn’t work with openwrt on Mr3020 and in general with ar71xx architecture, using overlay instead works ( from the openwrt official wiki )
[quote=dloser]
You didn’t include the output of mount. It would be nice if you could tell us how things are when you look around manually. Is the overlay working properly then? (Stuff of sda2 is in /? Can write enough data to it via the overlay and not just in /overlay itself?)
[/quote]
mount works without any problems when mounting the usb, what kind of info do you need? i mean, i don’t understand if you want to know about mounting the usb or something else!
btw if i go to it and do something like, mkdir or mkfile, it works. i can’t make openwrt install packages on it tho, even if recognize it as an external AVAIBLE storage (it says i have 6 gb free)
[quote=dloser]
Also, next time don’t post ‘yeah sure, one minute’ and then edit that post. The message isn’t really necessary anyway and there is no notification for the edit.
[/quote]
i thought there was a notification for the edit, sorry ahah
WaRWolFz crew

Just execute mount without arguments. It should display the currently mounted devices and their options.
What do you mean with “it works”? Creating a directory or small file doesn’t show anything. What I want to know is where do those directories/files end up (on the original root/rom or on the USB storage), can you access files from the USB storage via the overlay (i.e. using /path/file instead of /overlay/path/file)?

okay got it!
didn’t know about the mount without arguments lol
here is the output:
root@OpenWrt:~# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlayfs (rw,noatime,lowerdir=/,upperdir=/overlay)
tmpfs on /dev type tmpfs (rw,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/sda2 on /overlay type ext4 (rw,relatime,data=ordered)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
WaRWolFz crew

How about the rest of my questions?
Anyway.. I’m guessing that things might not be happening at the right time or in the right order; that either overlayfs is not actually using sda2 or that whatever you are using to install stuff is still running using the old root.
It might also be a better idea to post this to the OpenWrt forum, I’m sure they are more familiar with the specifics.