OpenWrt won't automount overlay?

Search Google for that, and you’ll find nothing. So now I’ll search Google for how to make a startup script that will mount it for me.

/etc/config/fstab

config mount
option device '/dev/sda2'
option enabled '1'
option target '/overlay'
option fstype 'ext4'
option options 'defaults, discard'

It doesn’t work with the UUID either.

Instructions for making an init script here. They provide an example, just put the mount command for the start section and umount for the stop section.

/etc/init.d/overlay

#!/bin/sh /etc/rc.common
# mount /overlay
# Copyright (C) 2007 OpenWrt.org

START=10
STOP=15

start() {
echo start
# commands to launch application
mount -o defaults -o discard /dev/sda2 /overlay
}

stop() {
echo stop
# commands to kill application
umount /dev/sda2
}

Now to reboot and see if it works. It works if you run /etc/init.d/overlay start.

Yup it works. Now I have a 50 GB /overlay. To bad I don’t need to install anything.