NanoPi R4S 4GB - Disk Space 99% Full

So between trying to get:


...installed on my device I hit the 100MB limit of the SquashFS install. I've tried every single way to expand it but every way in which it is said to have worked (which is somehow like 6+ different ways including the official method) but none of them work. All attempts to expand my SquashFS install fails at one point or another. Is there some up-to-date method that is guaranteed to work for 23.05.3 in 2024 on this device with SquashFS? Can it all be done on device VIA SSH? I really don't want to use EXT4 or the FriendlyWRT fork that auto-expands the SD card. Thanks!

The easiest solution is to leave your system's squashfs partition alone and then partition the rest of the space with ext4. Then simply mount that partition within OpenWrt and do whatever you want with it as normal bulk storage.


Can this additional EXT4 partition seamlessly be used by OpenWRT for package installs and what-not? My issue was installing packages from the tutorials above completely filled up my default 100MB space and failed at some point in the middle. Now I can't do anything with it until I either expand or reflash.

Yes, if you mount it it as extroot, yes.

1 Like

Thank you for that and what if I wanted to just format the SD card, reflash the OpenWRT SquashFS image and redo everything? That would be ideal.

You can approach it any number of ways.

That said, how much space do you think you'll really be using for OpenWrt + packages (usually this is not particularly large) vs space you need for general purpose file storage/sharing.

1 Like

I don't HAVE to have the entire 32GBs of space but I for sure need more than 100MB. I'd like to have all 32GBs I guess but if say 1GB, 2GB, 4GB, preferrable in your opinion then I'll do that.

You could make the whole thing just an ext4 image (assuming ext4 is supported as a boot partition type for your device), then you can consume the whole card with a single partition.

1 Like

EXT4 images are available for my device but from what I gather SquashFS is preferrable for a number of reasons. I have all of my networking behind a 1500VA UPS so I guess some of those pros for SquashFS are moot but not all. I take it SquashFS images really aren't good to expand?

A tried and true way to expand my SquashFS image storage space on device VIA SSH is desired but if you're suggesting I should not then I'll just go with the EXT4 image.

Thank you either way for everything so far.

Let's go back to basics...

  • What packages are you installing on OpenWrt.
  • How much space does that require (not counting any other general purpose data)?
  • How much 'buffer' space do you want to have for future package installation?
  • How much general data storage do you need? (I assume whatever is left over after the above)
  • How often will you be making changes to the configuration of OpenWrt?

You could build a squashfs image with all your packages pre-installed (and some room to spare for future) and then the rest could be allocated as a general read/write sharing partition. I think that would probably make the most sense.

But there are other options:

  • Make 2 ext4 partitions, one for OpenWrt, the other for general purpose use (this is also a good option)
  • Make a squashfs partition + an extroot partition + the rest for general purpose use
  • make one big ext4 partition for everything (this is probably the most risky should you have a power outage -- i.e. when the UPS is depleted -- while writing data.

I don't know that I have a strong opinion about the best/worst options here, but it should be dictated by your expected data needs. OpenWrt doesn't require a lot of space, and it's probably best if it is not on the same partition as your general data.

  1. Besides the packages that are listed in the links above, I do SQM and AdBlock. Beyond that...I don't know that I'll need much more but you never know. I'd maybe like to do some VPN integration stuff maybe (Mullvad) or perhaps some video serving to IoT devices like DLNA or whatever is current. Not a bunch more, I don't think.

  2. I'm really not sure but based on my experience with this install, I know it's more than 100MB but I couldn't imagine requiring more than 1GB probably (which may also be more than enough).

  3. I don't think I need any general storage specifically in relation to the SD card itself. All I need OpenWRT to have space for is things specific to OpenWRT like packages and what-not. Now, I do plan on sharing a 2TB USB3 Toshiba Canvio Basics external hard drive VIA samba that has a bunch of things like images, documents, video, etc...but that's besides your question I believe.

  4. See above.

  5. I'm a tinkerer by nature but after having this device for a while and using FriendlyWRT (no offense but I wasn't comfortable running a Chinese OS on my personal network), switching over to OPNsense for a while (wasn't really compatible or stable enough for my use case) and now recently coming back to vanilla OpenWRT I think I'll just set this thing up and let it for the odd touch up with AdBlock or opening a port for gaming or issues a static IP to a new device or whatever.

I hope that gives you a better picture of what I'm trying to accomplish here. If there's anything I can clarify or be more specific about, let me know. All I know (or I think I know) is I want SquashFS for sure but I want it bigger than 100MB. I think your idea of building a SquashFS image with all the packages I assume I'll need with room to spare is a good idea. That's what I want. Call it 1GB if that makes any sense to you based on what I would like to do. Whatever you would consider appropriate if not the entire 32GBs for the obvious reason that I'll probably never use or need all 32GBs of space and having that much extra could be a potential attack vector (I'm assuming based on my reading in these forums) or whatever other issue it could cause.

Thank you for your time! I await your response.

Ok... in that case, I'd recommend just using ext4 with one large partition. Its more than you will likely ever need for any core+extended OpenWrt functions (i.e. everything other than general purpose data storage), but 4GB isn't really that huge anyway (it's not like you're wasting 4TB here).

1 Like

Damn. Not the answer I'd hoped to hear but probably the one I should / will listen to. I really liked the idea of SquashFS but I guess it's not really that important if you don't think it is. Last question then I guess (if you don't mind):

When I flash the EXT4 image to the freshly formatted SD card, should I bring it into GParted on my PC to expand first or should I put it into the device first, let it boot up and run for a bit and then remove it to pop it back into my PC and then expand with GParted? Much appreciated.

I don't think the order of operations matters in terms of increasing the size of the ext4 partition. Personally, I'd probably do it before putting it into the target device just in case I mess up the process (I don't have to repeat any setup, just the wiring to card part)


OK, sounds good. I appreciate your time. I guess I'll mark this as solved and get on with it!

Sounds good! Good luck!

1 Like

Try these steps mentioned here

If that method doesn’t work for you then try this
Expanding OpenWrt squashfs image (SDcard) - #16 by andiohn

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.