ExtRoot issues

Hello there!

Router: Asus RT-AC51U
Version: 22.03.3

I'd like to start off with saying im very new to this, and do not have a lot of relevant experience for Openwrt. I am however, using this is as a way to learn and eventually set up something useful for myself.

Onto the issue at hand: I've been trying to get ExtRoot to work since yesterday(put in about 10 hours so far) and I really don't feel like im getting anywhere. I was able to get my disk formatted to ext4 and it was recognized by my router with both "block info" and "ls -l /dev/sd* ". But it would not let me mount it to /overlay/.

However, yesterday I gave the image builder a try, to make the process automated instead, but that like most other things failed.

I now feel like im back where I started, I have a pretty much fresh install of OpenWRT now, with some different USB tools installed and updated. Problem is: I formatted my external hdd to ext4 in Ubuntu and now it doesn't recogize it at all, but it did however recognize it when it was formatted with NTFS earlier today.

Any help would be very appreciated.

Maybe something here will help? Persisting /var to a usb drive

Will definitely be looking into this today! Thanks for your input, I'll update the thread if I get anywhere.

First, temporarily mount the external drive on the existing empty directory /mnt and check that files can be read and written.

mount /dev/sda1 /mnt
ls /mnt

The mount command should complete with no error. If the partition is ext4, you should see a lost+found directory in the otherwise empty filesystem.

Did you follow a tutorial to setup your extroot? The extroot article on the OpenWrt wiki should give you the complete process, but it is important to follow each step (unless you have a reason not to, like already having an ext4 filesystem setup on the drive).

What does block info return?

Followed it about 5 times total with a fresh install each time before giving up and posting here.

/dev/mtdblock5: UUID="1fae3911-b98c0673-a5a6acb2-56794830" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock6: MOUNT="/overlay" TYPE="jffs2"
/dev/sda1: UUID="6050F8FC50F8D9AC" LABEL="Nytt volum" TYPE="ntfs"

I just reformatted the disk to NTFS.

Why? You should use ext4 for extroot.

As mentioned in the original post, ext4 wasn't recognized at all, so I atleast wanted to know nothing was wrong with the disk.

For me personally, it's easier to take a step back instead of going forward and stepping into more shit.

1 Like

Did you install kmod-fs-ext4?

Sure... often it does make sense to start at a known-good position, but you'll just need to reformat this device again into ext4, so just extra work... no big deal, though

1 Like

It is installed, yeah. I'll try and reformat the drive to ext4 and see what happens.

Exactly! Like I said, I have little to no experience with this sort of thing, so having a point where I feel comfortable enough to think I haven't fucked up til that point is good.

I must've done something wrong when formatting the disk earlier, as it get's recognized now. One step closer to my goal thankfully.

Now, before I proceed. Im thinking about using OpenWRT as a webserver to start (just to dabble with, maybe try and set my domain up with it etc..) Would I need to make multiple partitions on my disk for them to store different files from different parts of the system, or does the /overlay/ folder give me enough space to work with the webserver and other projects aswell? As far as I could tell overlay only stores installed packages?

Really shitty formulated, I know, im just struggling to put this into words.

Finally got it to work

But my questions regarding whether or not doing this is enough for me to freely set stuff up on my router without having to worry about space still stands.

This is not a good idea with uhttpd. This is a very lightweight webserver and it is not hardened for exposure to the internet (it's fine for a trusted network like a LAN, for example). For this, you'll probably want to use nginx or apache, and then go through the process of properly hardening it (I'm not an expert on this part).

All packages installed from this point forward will go into your extroot partition... so you have almost 500GB available.

Typically, you don't need more than a few hundred megs (at most) for OpenWrt... you could setup 2 partitions on that disk -- the first (for extroot) 1GB, the second (for files related to your webserver's content, etc.) would be the rest of the disk.

1 Like

Yeah, seen a couple of comments saying don't expose it to the internet. Im probably only keeping it on my own network, but my main goal and focus right now is just to learn from doing.

If it's not too much to ask, how would I go about doing this, now that I have already mounted the disk to overlay? Dismount it, partition it, and then remount the 1gb partition?

If that's the case, what do I do with partition 2? Not expecting a full how to guide, but a nudge in the right direction would be awesome.

:warning: this will delete the data on your extroot disk (but it'll give you another opportunity to run the extroot process :stuck_out_tongue_winking_eye: )

You'll probably find that it is easier to do this on your computer... use the same disk utility you used to format, but this time create a new partition (1GB) and then create a 2nd (the rest). Format both of them ext4.

Plug that drive into OpenWrt and run the exdtroot process again for sda1.

After that, you can create a mount point for sda2 (which will be where you'll point your webserver for its data).

1 Like

All I did was shrink the original partition in Gparted, and make a new partition with the newly freed space.

So now I can mount sda2 anywhere I please, then assign the webserver the same dir when I get that far?

(Gotta really thank you for your help today aswell, started out this project yesterday and i've already learnt so much from this.)

yup... you'll mount it using the fstab (see this article)

1 Like

Thank you very much!

This may be a bit beyond the point of your enquiry, but…

You have a 16/64 mt7620a device, running at 1*560 MHz, which gives you 15.6 MB of free storage to play with - realistically speaking, RAM and CPU performance will hinder your package installation orgy way earlier than the available flash…

Currently a standard OpenWrt installation weighs around 6.5 MB, that contains everything you need for a default router setup, leaving you (accounting for ~0.1 MB random config files) ~9 MB to play with - that is quite a lot for OpenWrt. Yes, there are heavy packages like samba or asterisk, but this device is a bit too weak on its chest to leverage those to their full extent. Extroot is a quite heavy complication for day-to-day operations (especially on upgrades), which makes me personally to avoid it as much as possible, so you might consider if either the 15.6 MB you got for free might be sufficient (with slightly adapted expectations) or if upgrading to a more modern device (multi-core ARM) with more RAM and flash might not be a better option.

Another thing to just note, you don't need extroot to mount a simple data partition, blockd is fine to hook that just about anywhere in the filesystem tree where it doesn't overlay/ shadow the existing rootfs (e.g. /srv/). Handling non-executable/ just-static-data partitions this way is much easier to cope with on sysupgrades, than having to redo the extroot each time from scratch again. 450 GB on extroot is just a quite obvious alarm flag of a wrong configuration approach, at least separate extroot and mere data into two partitions (of which the static data partition may survive a sysupgrade untouched, while only the real extroot (of a few hundred MBs at most) has to be redone).

3 Likes

A little hard for my tiny noob brain to understand, but I think I got some of it.

  • Hard way of doing things, especially if I plan on keeping Openwrt updated.
  • Storage device is very overkill

I plan on getting a better setup for openwrt, or just set up a dedicated server for this, who knows.

As for this making updates harder, when initially trying to make extroot work, I started reading about image building for automating the extroot process and I assume there are other factors you can add in if you wanted to. Wouldn't this make the process much easier and eliminate the most obvious problem about this solution, or am I noobing out?