OpenWrt Forum Archive

Topic: how to use the new block-mount ?

The content of this topic has been archived between 19 Jun 2015 and 6 May 2018. Unfortunately there are posts – most likely complete pages – missing.

recently openwrt trunk updated block-mount to 2013-06-20.....
then the old fstab not working any more and can't mount during boot so extroot not work.
any idea how to use it ??

1. sysupgrade: "Be aware that on rare occasions old configuration files don't work with new program versions."

2. Isn't there any up-to-date block-mount documentation? Then maybe you are going to delight us with one, after you figured out what changed ;-)

johan666 wrote:

then the old fstab not working any more

I noticed the same, but I have not had time to look for a solution, yet. Manual mounting works ok.
https://forum.openwrt.org/viewtopic.php?pid=205552#p205552

I have not seen any documentation.
Nor is there documentation about the changed button hotplug script routines :-(

As there is a techref for netifd

There is also one for ubox

kirschwasser wrote:

As there is a techref for netifd

There is also one for ubox

I have read that before,
but what about the configuration ?

"block detect" gives me this:

config 'mount'
        option  target  '/mnt/sda1'
        option  uuid    '8c6c-0792'
        option  enabled '0'

By toggling enabled to '1' I can get fstab to work. But only for that one known USB stick.

How can I enable the same mount point to accept any inserted USB stick?
That was possible with the previous block-mount.

When I look at the source code, it seems to me that there is no such option...
http://nbd.name/gitweb.cgi?p=luci2/ubox … eddb8efa16

Earlier it was possible to leave out uuid and just specify the device to be monitored.

(Last edited by hnyman on 26 Jun 2013, 21:08)

Hello!

I'm trying to get extroot to work with ubox.

My /etc/config

config 'mount'
        option  target  '/overlay'
        option  uuid    '15b2386a-280c-2248-1894-7595938c1ed5'
#       option  options 'rw,sync'
        option  enabled '1'

If I add any lines at all - It wont mount. like adding the options line.

and secondly - Which is the most problem for me, Overlay dont work.

It does mount work fine if mountpoint is /mnt/sda1 but then I choose /overlay it gets mounted, but the overlayfs wont update the free space left.

root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                    1088       984       104  90% /
/dev/root                 1792      1792         0 100% /rom
tmpfs                    14472        68     14404   0% /tmp
/dev/mtdblock3         1909456     11536   1799260   1% /overlay
overlayfs:/overlay        1088       984       104  90% /
tmpfs                      512         0       512   0% /dev
/dev/sda1              1909456     11536   1799260   1% /overlay

Quoting /etc/config/fstab: " If target is / then it will be used as extroot". Try "/" instead of  "/overlay" and report back.

Well......
[option device] [option options] won't work ?
Need UUID ??

And, it won't update free space !?
That sounds terrible.....

Ok, no more block-mount,
install ubox instead.
Try compile again and try.

However, ubox is already preinstalled in my build, how come it doesn't work ??
And there is no such file /etc/init.d/fstab !??

(Last edited by johan666 on 27 Jun 2013, 11:05)

you have to create /etc/config/fstab by yourself.
use "block detect" output as the model.

I mean /etc/init.d/fstab
not under /etc/config

johan666 wrote:

Ok, no more block-mount,
install ubox instead.
Try compile again and try.

However, ubox is already preinstalled in my build, how come it doesn't work ??
And there is no such file /etc/init.d/fstab !??

The needed package is still called "block-mount" although it is provided by the ubox source.

Check it from here:
https://dev.openwrt.org/browser/trunk/package/system/ubox/Makefile#L48
http://nbd.name/gitweb.cgi?p=openwrt.gi … 03;hb=HEAD
I am not sure if /etc/init.d/fstab is needed.

I've tested mountpoint / too, both as pivot overlay and pivot root. but none works, as /overlay it gets mounted but overlayfs doesnt update free space (Sems not to work at all, dd if=/dev/mem of=/mem bs=4096 sais out of storage)
With mountpoint / it doesnt get mounted at all

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)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)

block detect > /etc/config/fstab and change enable to 1 does get it mounted as I said, I dont have any /etc/init.d/fstab script. mountpoint /overlay works too but overlayfs dont use the space.

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)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
/dev/sda1 on /ovelay type ext4 (rw,relatime,data=ordered)

(Last edited by Damme on 27 Jun 2013, 14:30)

/dev/sda1 on /ovelay type ext4 (rw,relatime,data=ordered)

This looks like a typo to me, should be "/overlay".

in additional,
[swapon -s] doesn't work anymore.
then how to check swap status ?

jow wrote:

This looks like a typo to me, should be "/overlay".

That was an typo, but same error even with no typo (look at my first post)

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)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
/dev/sda1 on /overlay type ext4 (rw,relatime,data=ordered)
root@OpenWrt:~# dd if=/dev/mem of=/mem bs=4096
dd: writing '/mem': No space left on device
32+0 records in
31+0 records out
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.1M      1.0M     44.0K  96% /
/dev/root                 1.8M      1.8M         0 100% /rom
tmpfs                    14.1M     68.0K     14.1M   0% /tmp
/dev/mtdblock3            1.8G     11.3M      1.7G   1% /overlay
overlayfs:/overlay        1.1M      1.0M     44.0K  96% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda1                 1.8G     11.3M      1.7G   1% /overlay
root@OpenWrt:~#

(Last edited by Damme on 27 Jun 2013, 15:18)

Just tried the latest trunk r37077
It can mount automatically.
However it won't mount to the designated location....
everything just mount to /mnt/sda.....

successfully pivot overlay.....
but only can auto mount with uuid.
cannot mount w/o uuid....

@johan666

Can you explain how you mount pivot overlay? Can you post your fstab? I tried lot of ways and can only mount /mnt/sda.
Thanks in advance

Just that

config global
        option anon_swap '0'
        option anon_mount '0'
        option auto_swap '1'
        option auto_mount '1'
        option delay_root '1'

config mount
        option target '/overlay'
        option uuid [your device's uuid, can't use /dev/sda]
        option enabled 1

config swap
        option uuid [I have swap partition, also use uuid]
        option enabled 1

Thanks johan666

I tried this and another  combinations, like option delay_root '0',
option target '/' and nothing. My setup is AR7XX (TP-Link TL-WR1043N/ND v1, OpenWrt Barrier Breaker r37092 / LuCI Trunk (svn-r9844) ). Anyone with success in this setup?

Best Regards from Rio de Janeiro, Brasil

overlay not working for me. I am using trunk 37092. so here is my fstab config

config global
    option    anon_swap    '0'
    option    anon_mount    '0'
    option    auto_swap    '1'
    option    auto_mount    '1'
    option    delay_root    '1'

config mount
    option    target    '/overlay'
    option    uuid    '4656715c-9fdb-40d5-b610-54d9eff5e813'
    option    fstype    'ext4'
    option    enabled    '1'

config swap
    option    uuid    '5e3edb58-8430-4acd-9b7e-a635a264a947'
    option    enabled    '1'

config mount
    option    target    '/mnt/Lisa_HD'
    option    uuid    'a7285ac1-82a1-4eee-97df-8815d9af6b8b'
    option    fstype    'ext4'
    option    enabled    '1'

config mount
    option    target    '/mnt/WD_HD'
    option    uuid    'd7648b88-52f2-4fa7-9192-56cbcc8b2cef'
    option    fstype    'ext4'
    option    enabled    '1'

when I reboot swap is working and the last two data partitions are mounted successfully. but the first mount (/overlay) is not working. here are my mounted partitions after a reboot

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    5.1M      4.0M      1.1M  78% /
/dev/root                 1.8M      1.8M         0 100% /rom
tmpfs                    61.7M    280.0K     61.4M   0% /tmp
/dev/mtdblock3            5.1M      4.0M      1.1M  78% /overlay
overlayfs:/overlay        5.1M      4.0M      1.1M  78% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sdb1               916.8G     43.5G    826.7G   5% /mnt/Lisa_HD
/dev/sdc1                 1.8T      1.7T     31.5G  98% /mnt/WD_HD