Welcome! Log In Create A New Profile

Advanced

Debian on NSA325 V1/V2

Posted by Buttzy10169 
Re: NSA 325 V2 Debian Is Possible!
March 21, 2019 08:52PM
szucsati Wrote:
-------------------------------------------------------
> First of all, big thank you for all who
> contributed to this project. It's awesome to have
> Debian running on this old hardware.
>
> I have one question (or problem) though. I have
> the latest uBoot installed, should it boot the
> factory software if no rootfs partition is found?
> I was careless and managed to use flash_erase_all
> instead of flash_erase on mtd0, and of cours
> misplaced the memory stick where I saved the
> backup. Could this be why the original Zyxel
> system is not starting?

No, you can no longer boot stock OS with my new uboot (it is too modern for stock OS in this box). Even if stock OS is still intact on NAND.

This is something I have not found free time to work on. I think it is possible, though.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
March 22, 2019 01:51AM
Oh, it's good to know, I don't know why I thought it would. Is there a way to set it up though to fall back to NAND of there's no usb or sata device with rootfs? Or at least to manually configure it to boot from there should one would like to boot stock FW?
And how badly did I mess up the system by erasing the full partition?
Re: NSA 325 V2 Debian Is Possible!
March 22, 2019 02:47AM
szucsati,

> Oh, it's good to know, I don't know why I thought
> it would. Is there a way to set it up though to
> fall back to NAND of there's no usb or sata device
> with rootfs? Or at least to manually configure it
> to boot from there should one would like to boot
> stock FW?

As I said, not possible at the moment. Typically, stock OS is on NAND. The new u-boot won't boot it. When I do get around to work on it, without USB or HDD rootfs, it will fallback to boot either stock OS, or OpenWrt in NAND (but not Debian or Arch).

> And how badly did I mess up the system by erasing
> the full partition?

Pretty bad, stock OS in NAND is gone :) so your box will only boot with USB or HDD.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
March 22, 2019 05:22PM
Well, I should try to find that memory stick then :). At some point I will want to sell this, and would be useful to have the chance to get back to the official (and outdated) software.
Isn't mtd0 only the uBoot partition? If I erased that, wouldn't I still have the OS?

The reason why I wanted to try the official FW was that I just bought this NAS second hand, and I jumped straight to Debian, before testing the speeds. Now I'm getting about 70MBps read and 40MBps write (on an SSD, just for testing). Some benchmarks on the internet showed 100/80, but I also read similar results to mine. So a bit confused there, and wanted to check it myself.

Btw, what you are doing here is absolutely amazing! The software and the guides you put together are excellent, it was totally my fault that I missed a few bits, there's a lot to understand for someone new, but it's all there, just needs reading. And extre thumbs up for your patience towards those who come here with questions!
Re: NSA 325 V2 Debian Is Possible!
March 22, 2019 05:33PM
szucsati,

> Well, I should try to find that memory stick then
> :). At some point I will want to sell this, and
> would be useful to have the chance to get back to
> the official (and outdated) software.
> Isn't mtd0 only the uBoot partition? If I erased
> that, wouldn't I still have the OS?

Yes, it you've erased mtd only, then stock OS is still intact on other mtds. So you only need to restore u-boot image on mtd0 to go back to full stock.

>
> The reason why I wanted to try the official FW was
> that I just bought this NAS second hand, and I
> jumped straight to Debian, before testing the
> speeds. Now I'm getting about 70MBps read and
> 40MBps write (on an SSD, just for testing). Some
> benchmarks on the internet showed 100/80, but I
> also read similar results to mine. So a bit
> confused there, and wanted to check it myself.

Yes, that would be expected. Since stock FW was tuned and tested (often in a way that we don't want to do, i.e. kludge) to maximize the performance (how they were able to sell the box). What I provided here is a basic rootfs and full kernel. I expect users to do the tuning themselves and share the hints here to benefit all.

So if you see the IO or network performance is less than stock FW, you should post the benchmarks, and let other jump in to share theirs. At the end, if nobody figures out the tuning parameters, then I'd try to investigate.

One more thing, a lot of time, it is just how you set up your Samba, NFS, network ... that results in less performance.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 03/22/2019 05:35PM by bodhi.
Markus Fuger
Re: NSA 325 V2 Debian Is Possible!
May 10, 2019 01:49PM
I am not absolutely sure whether this is the correct thread or if this:https://forum.doozan.com/read.php?2,12096 or https://forum.doozan.com/read.php?3,19093 this wouldn't be better.

My NSA325 is working properly with all the given guides.
I am having a flash drive with 2 partitions
/dev/sda1 ext4 with /boot/ dir and uImage and uInitrd
/dev/sda2 f2fs with the rest of the rootfs file system (and named rootfs)

I do understand the limitation that the USB3 port at the front is not available at boot time - but how would it be after loading the kernel?
I found this thread (https://forum.doozan.com/read.php?3,19093, https://forum.doozan.com/read.php?3,24212, and the boot section from here: https://forum.doozan.com/read.php?2,23630) - but since it is that old I am not sure if using the newer uBoot 2017.07 wouldn't be better.

Here is my question: is it possible to have one (slow) flash drive at the back USB2 for booting with the most basic thing - and then the remaining stuff on a faster drive connected to USB3 at the front. How would I need to set up this configuration?

With kind regards,
Markus
Re: NSA 325 V2 Debian Is Possible!
May 10, 2019 05:04PM
Markus,

> Here is my question: is it possible to have one
> (slow) flash drive at the back USB2 for booting
> with the most basic thing - and then the remaining
> stuff on a faster drive connected to USB3 at the
> front. How would I need to set up this
> configuration?

Yes, definitely. The USB 2 in the back is where you should have /boot. Since the goal here is to use a fast drive for rootfs, you can store the rootfs on the faster USB 3.0 drive in front.

The requirement is:

- The rootfs drive on USB 3 has single partition, and the partition label is rootfs.
- The latest uboot.2017.07-tld-1.nsa325.mtd0.kwb was installed.
- And the u-boot env for bootargs is unchanged from the u-boot installation. If it was changed, then you should make sure the boot device looks like
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
root=LABEL=rootfs is the important arg that tell the kernel where to mount the rootfs.

The kernel will mount the rootfs on the USB 3.0 drive correctly after it booted.

-bodhi
===========================
Forum Wiki
bodhi's corner
Markus Fuger
Re: NSA 325 V2 Debian Is Possible!
May 13, 2019 01:34PM
Thanks bodhi!

it worked great! My initial mistake has been, that I just used the flash drive from the back in the front (which obviously had more partitions)
furthermore I found that f2fs seems to be to "unstable" to be used properly - therefore I am going to revert back to ext4 for the rootfs.

-Markus
Re: NSA 325 V2 Debian Is Possible!
May 13, 2019 05:50PM
Markus,

> it worked great! My initial mistake has been, that
> I just used the flash drive from the back in the
> front (which obviously had more partitions)

Cool!

> furthermore I found that f2fs seems to be to
> "unstable" to be used properly - therefore I am
> going to revert back to ext4 for the rootfs.
>

I think it is OK when you put the f2fs rootfs explicitly in fstab. IIRC, to rely on initrd to mount f2fs is not quite stable (we would need to tweak the initscript).

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 05/13/2019 07:17PM by bodhi.
fgh
Re: NSA 325 V2 Debian Is Possible!
August 12, 2019 09:21AM
I would like to make use of the copy button to run a simple bash copy command. Tried the script from the first post but didnt work. Does anyone have any other solution?


Also, i would take the opportunity to again thank bodhi so much for helping me out with the installation process. You should know that taking your time as you do here really makes people happy and bring some lights to the world. :-)
Re: NSA 325 V2 Debian Is Possible!
August 12, 2019 02:14PM
Hi fgh,

> I would like to make use of the copy button to run
> a simple bash copy command. Tried the script from
> the first post but didnt work. Does anyone have
> any other solution?

We use the esekeyd on these boxes.

It is listed in the Wiki thread

Quote

Key daemon (button control)

Multimedia keyboard daemon for Linux

> Also, i would take the opportunity to again thank
> bodhi so much for helping me out with the
> installation process. You should know that taking
> your time as you do here really makes people happy
> and bring some lights to the world. :-)

My pleasure :)

-bodhi
===========================
Forum Wiki
bodhi's corner
Leviathan01x
Re: NSA 325 V2 Debian Is Possible!
September 19, 2019 01:48PM
First of all, thank you for this thread!
It is awesome to run Debian on my aging NSA-325v2, being able to play with it however I want.

However, I am seeing very slow write speeds.
I have the following setup:
  • SSD 120Gb (an older Samsung one I had around) connected to a back USB2.0 port, this has only one ext3 partition
  • WD Green 2tb - one ext4 partition
  • Seagate 4tb - one ext4 partition

I am only running:
  • miniDLNA
  • Transmission
  • samba
  • all on top of mergerfs folders

Speeds are very low, I've seen 6-12mbs, while I used to see 30-40mbs over my gigabyte wired network with the stock firmware.
I did disable journaling.

It's not a real problem, I love the freedom I have, so I can live with the decreased write speeds, but I was wondering if maybe I'm doing something obviously wrong that's causing this.
Let me know if I need to supply more info.
Re: NSA 325 V2 Debian Is Possible!
September 19, 2019 02:12PM
Just moved to a new place so my NAS is sleeping in a box somewhere... but I had similar experience when I switched to Debian. I think the stock fw used SMB 1, Debian uses SMB 3, and that needs a lot more CPU power. I however checked with NFS and that was pretty slow as well.
Re: NSA 325 V2 Debian Is Possible!
September 19, 2019 06:21PM
All,

You will need to look at how you have tuned (or lack of) NFS and Samba.

The network speed iselft is not a problem. It should get you about 700 or 800 Mbs on a Gigabits network.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
September 20, 2019 02:25AM
Wiki thread

Samba tuning

Quote

Samba

Samba smb.conf for a simple set up
HowTo setup Samba/CIFS shares

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
September 20, 2019 02:36AM
Wiki Thread


Quote

NFS

NFS - HowTo set up NFS shares (and boot NFS rootfs)
Boot your Dockstar (and other plugs) using NFS rootfs
Increase NFSD max_block_size

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
September 20, 2019 02:46AM
Pure network benchmarks for NSA325 and GoFlex Net.

Both are connected to a Gbits ethernet switch.

ZyXEL NSA325

iperf -n2000M -i 3 -c 192.168.0.234
------------------------------------------------------------
Client connecting to 192.168.0.234, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.227 port 35812 connected with 192.168.0.234 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 3.0 sec   282 MBytes   789 Mbits/sec
[  3]  3.0- 6.0 sec   281 MBytes   786 Mbits/sec
[  3]  6.0- 9.0 sec   282 MBytes   790 Mbits/sec
[  3]  9.0-12.0 sec   282 MBytes   789 Mbits/sec
[  3] 12.0-15.0 sec   282 MBytes   789 Mbits/sec
[  3] 15.0-18.0 sec   282 MBytes   788 Mbits/sec
[  3] 18.0-21.0 sec   282 MBytes   789 Mbits/sec
[  3]  0.0-21.3 sec  1.95 GBytes   788 Mbits/sec

GoFlex Net

iperf -s -i 3
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size:  128 KByte (default)
------------------------------------------------------------
[  4] local 192.168.0.234 port 5001 connected with 192.168.0.227 port 35812
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 3.0 sec   281 MBytes   787 Mbits/sec
[  4]  3.0- 6.0 sec   281 MBytes   787 Mbits/sec
[  4]  6.0- 9.0 sec   282 MBytes   789 Mbits/sec
[  4]  9.0-12.0 sec   282 MBytes   789 Mbits/sec
[  4] 12.0-15.0 sec   282 MBytes   789 Mbits/sec
[  4] 15.0-18.0 sec   282 MBytes   789 Mbits/sec
[  4] 18.0-21.0 sec   282 MBytes   789 Mbits/sec
[  4]  0.0-21.3 sec  1.95 GBytes   788 Mbits/sec

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 09/20/2019 02:47AM by bodhi.
Re: Debian on NSA325 V1/V2
October 05, 2019 05:24PM
Found the box :). Although one HDD tray is missing, hmf...

Anyway. Did a clean install with the latest Debian, and still getting the same network speed. No tuning has been done, SMB Read: ~36MBps, SMB Write ~33MBps
And I tested copying a file internally, different folder on the same SSD (pv -pra test.iso > test/test.iso), it was ~48MBps.

Could this be a bottleneck at the SATA interface?
Re: Debian on NSA325 V1/V2
October 05, 2019 07:37PM
Run hdparm test.

This is an HDD I use for daily backup. With SSD you should get a faster disk I/Os.

[    8.522803] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    8.536972] ata1.00: ATA-9: ST4000DM000-1F2168, CC54, max UDMA/133
[    8.552005] ata1.00: 7814037168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    8.576862] ata1.00: configured for UDMA/133
[    8.592366] scsi 0:0:0:0: Direct-Access     ATA      ST4000DM000-1F21 CC54 PQ: 0 ANSI: 5

hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   592 MB in  2.00 seconds = 295.81 MB/sec
 Timing buffered disk reads: 364 MB in  3.02 seconds = 120.72 MB/sec

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on NSA325 V1/V2
October 06, 2019 01:54AM
Hm... similar.

root@nsa325:~# hdparm -tT /dev/sdb1

/dev/sdb1:
Timing cached reads: 600 MB in 2.00 seconds = 299.75 MB/sec
Timing buffered disk reads: 360 MB in 3.00 seconds = 119.91 MB/sec


[ 15.162763] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[ 15.192936] ata2.00: supports DRM functions and may not be fully accessible
[ 15.203654] ata2.00: supports DRM functions and may not be fully accessible
[ 15.211934] ata2.00: configured for UDMA/133
[ 26.823080] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)


I need more time for testing. It's such a shame that I messed up the stock fw on the system and can't go back for comparison. Is there a way to fully re-flash factory image when I wiped partitions I shouldn't have and didn't make a backup...?
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: