Using OpenWrt as NAS

Hello,
I've been testing OpenWRT for 2 weeks ago and I like it more and more. This OS offers unlimited possibilities!
I have a x86 PC with OpenWRT installed and works like a charm. Now I want to take profit of a 750GB HDD, but I don't know how to it on the best way. I've tested the OS in the same HDD with ext4 and squashFS, in both cases the system have very small partitions.

What can I do? Extend the main EXT4 partition and install the necessary stuff for NAS, or make another EXT4 partition NAS dedicated? Sounds better the second option..
But I don't have clear if its better using squashFS (I like the restore function) + EXT4 partition.

Anyway.. i want to hear your opinions and I will decide uppon that.

Thanks and Greetings!

I would use an offline editor like the GParted LiveCD to expand the partition. I would use EXT4 for the NAS partition.

2 Likes

Sorry, @lleachii is wrong in this instance.

NO. By modifying the existing partitions a future sysupgrade will erase your data.

That's the way to go. Create one (or more) additional partitions and mount them to wherever you please (personally, I mount them to a subdirectory in /srv if they contain file server data).

In your case, MBR is sufficient for the drive and a sysupgrade will respect and leave alone additional partitions. (It doesn't hurt to try it first, though ... just immediately after you created your additional partitions using fdisk, sysupgrade from OpenWrt to the same version you already installed. You will see if the additional partitions survived.)

If you ever choose to use GPT (necessary for a disk > 2TB) you will have to do additional work after a sysupgrade, since sysupgrade does not know or respect GPT tables (yet). I would refer you to https://openwrt.org/toh/wd/mybooklive#upgrading -- not targeted at x86, but running into the same issues.

1 Like

That's what I suggested. Apologies if that was not clear. You should not place OpenWrt on the same partition as the NAS data. You should create a separate NAS partition and expand it using the offline disk utility.

1 Like

You wrote "expand the partition" though, that's very much not "create a partition". :slight_smile: I try not to be nitpicky, but in this case it's prudent to be very clear.

2 Likes

Thanks for your quick answers.

So in conclusion, we discard squashFS and just create another EXT4 partition.
Do I have to do it from OpenWRT console itself or can I do it from another computer? I've tried from another computer and then the system wont boot. :S

I will forward you any news.

Not clear what this means. The solution above is in regards to creating an EXT4 partition for the NAS data. Since SquashFS is OpenWrt, what you mean by this is unclear. You never noted if you're actually using the SquashFS or EXT4 version of OpenWrt. You will not be disgarding any partition that was created for OpenWrt - you're making a new EXT4 parition.

As noted above:

I was meaning for the main OS partition, if is it better Squash FS or EXT4. Documentation says to use EXT4 for HDD, but i really apreciate the factory restore option implemented in SquashFS.