Extroot on nfs share problem

Hi guys, I'm trying to extend rootfs on my tp-link wr1043nd to nfs drive. nfs was chosen because internal usb in the router is occupied with a dongle without sd slot.
As far as overlayfs does not support nfs for upperdir, I'm trying to use an image on nfs drive connected to /dev/loop0 and formatted as ext4. I built a custom image with nfs client embedded and hotplug script based on script from here I put corresponding section to /etc/config/fstab:

config mount 'rwm'
        option device '/dev/mtdblock4'
        option target '/rwm'

config mount 'overlay'
#       option  uuid  '0d8790a4-4f6f-4257-826d-fbc151691f97'
        option device '/dev/loop0'
        option target '/overlay'

/dev/loop0 connects to the image properly during startup, however it turned out that preinit configures overlayfs before network becomes ready and my hack does not work in preinit time.

Using info from here I put in /etc/rc.local

export PREINIT=1
mount_root

However I see this in messages:

[   40.552698] block: extroot: cannot find device loop0

So, nither way works.

Any help would be very much appreciated

there is a thread on roots on nfs... there are tips in that on altering preinit more to your liking... ( here and there are others similar )

there is another thread on doing this at runtime dynamically if you can find it... (it's more of a snapshotting thing I think... but would probably work better)

2 Likes

Thank you. The link you provided does exactly what I want to accomplish. However, the script from that thread located on a google disk is not accessible any more. As far as you commented that thread, may be you can share a copy of that script, if you have one?

ask the maintainer ( OP ) first... fair chance there are newer modifications / new code that significantly changes things...

they are not often here so may take over a week... I can take a look if I have it ( and licence etc. but should be ok )

I asked the author in PM. Which maintainer you have in mind?

Good, thank you

1 Like