Please Help Me Get A Clean Start NSA325

Marvell Kirkwood based
Post Reply
pitcritter
Posts: 103
Joined: Tue Oct 08, 2013 12:51 am

Please Help Me Get A Clean Start NSA325

Post by pitcritter » Sun Oct 22, 2017 12:28 pm

Here's my usual disclaimer...I am an absolute newbie with Linux. I know only what I've learned here and just enough to be dangerous. I'm not afraid to read and I'm equally willing to make mistakes in order to learn.

Due to the efforts of many users here, I've managed over the past few years to have my NSA325 running and making my life easier. Specifically @burbulence and @mijzelf have made this possible, although many others have been very helpful too.

Thanks to you all.

OK, enough of the sucking up :D , now I need some help...again.

I've been happily running SickRage, CouchPotato, and NZBGet using @burbulence's scripts, first via FFP and more recently, Entware-ng.

A few weeks ago, SickRage quit on me. It appeared to come out of the blue with no reason I could think of.

I tried the usual reboot routine, but nothing helped. A couple of days ago, I found a little time to work on the system, but I'm running into some roadblocks.

I decided to update the firmware on my 325 since I was starting from scratch anyway. I'm now at NSA325_4.81(AAAJ.1) if it makes any difference.

After the update, I did a full reset on my box. I pushed the recessed button on the back for a full 30 seconds. I heard a series of beeps.

Afterwards, one of the LEDs on the front flashed for over an hour. I decided to do another reset.

This time, the box seemed to boot normally.

I opened the gui using the default login and set some new credentials.

I enabled SSH, at least, I tried to. For some reason, the check mark was always cleared when I went back to the SSH page and Putty reported "connection refused".

I then enabled Telnet. That seemed to work.

I looked in the Packages tab in the GUI and installed Entware (which had shown as disabled).

It took quite a while, but it finally changed to "enabled".

Now, back to Telnet.

Code: Select all

NSA325 login: root
Password:


BusyBox v1.17.2 (2017-06-21 16:20:33 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # opkg update
-sh: opkg: not found
~ # cd /opt/bin
/usr/local/zy-pkgs/opt/bin # ls
aclocal                               infotocap
aclocal-1.15                         ld
addr2line                            ld.bfd
ar                                   locale.new
arm-openwrt-linux-gnueabi-c++        localedef.new
arm-openwrt-linux-gnueabi-g++        m4
arm-openwrt-linux-gnueabi-gcc        make
arm-openwrt-linux-gnueabi-gcc-6.3.0  mc
as                                   mcdiff
autoconf                             mcedit
autoheader                           nano
autom4te                             ncursesw6-config
automake                             nm
automake-1.15                        nzbget
autoreconf                           objcopy
autoscan                             objdump
autoupdate                           opkg
bzip2                                perl
c++                                  perl5.22.1
c++filt                              pip
captoinfo                            pip2
cheetah                              pip2.7
cheetah-analyze                      pkg-config
cheetah-compile                      python
clear                                python2
cpp                                  python2.7
curl                                 ranlib
easy_install                         readelf
easy_install-2.7                     reset
elfedit                              rtmpdump
ffmpeg                               scp
file                                 size
find                                 ssh
g++                                  strings
gcc                                  strip
gcc_env.sh                           tabs
gcov                                 tic
git                                  toe
git-receive-pack                     tput
git-shell                            tset
git-upload-archive                   unrar
git-upload-pack                      wget
gprof                                wget-ssl
ifnames                              xargs
infocmp
/usr/local/zy-pkgs/opt/bin # opkg update
-sh: opkg: not found
/usr/local/zy-pkgs/opt/bin #
As you can see, although the GUI reports that Entware is enabled, I cannot run opkg.

Even stranger, when I looked in the Entware log in /usr/local/zy-pkgs/opt/var/log I found lines relating to @burbulence's script for SickRage, etc. This is after what I thought should have been a complete reset.

When I went to the admin page for NZBGet, it was happily up and running, waiting for input. SickRage was still unresponsive.

In short, what I'd like to do now is get a real, honest, clean start.

Is there a way to return my box to absolute stock without losing my data?

I'd like to be able to remove all packages, including Entware, SickRage, CP, NZBGet, etc but still keep the media I've downloaded.

Is there a set of folders that I could delete that would give me a clean start?

Alternatively, am I just doing something wrong during the reset process?

Thanks. as always, for any and all replies.

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Please Help Me Get A Clean Start NSA325

Post by Mijzelf » Mon Oct 23, 2017 9:05 am

pitcritter wrote:Here's my usual disclaimer...I am an absolute newbie with Linux.
After 95 posts here, and having modded your box, you should adapt your disclaimer a bit. 'Absolute' seems a bit exaggerated.

Anyway, a factory reset doesn't remove the packages, it only disables them. And after re-enabling they should work as before. I guess you didn't re-login on Telnet, after enabling Entware-ng, which causes your inability to run opkg. The Entware-ng environment is only loaded on login.

You can simply uninstall and reinstall Entware-ng from the webinterface to get a fresh install.

If you rather start over with a clean package system, rename the directory /i-data/md0/.system/zy-pkgs, and reboot. AFAIK the box should generate a new package system. If that works for you, and you can install packages, you can delete the renamed directory.

pitcritter
Posts: 103
Joined: Tue Oct 08, 2013 12:51 am

Re: Please Help Me Get A Clean Start NSA325

Post by pitcritter » Mon Oct 23, 2017 1:12 pm

Thanks @Mijzelf. I had some time on my hands yesterday so I decided to give it a shot on my own.

I removed all packages through the gui and rebooted. Then, another reset.

That took me back where I needed to be.

I reinstalled Entware, SR...

Everything looked good.

Then not so much.

As I was rescanning my media into SR, the box froze.

I now think I have a hardware issue, likely irreversible.

The unit will not boot.

The blue light on the power button is illuminated but nothing else works. Even the fan has stopped. The unit does not pull an IP from my router.

I'm hoping that I've got a bad power supply but I'm pretty sure I'm being optimistic on that.

Opinions? Next steps?

pitcritter
Posts: 103
Joined: Tue Oct 08, 2013 12:51 am

Re: Please Help Me Get A Clean Start NSA325

Post by pitcritter » Mon Oct 23, 2017 2:43 pm

I won't be able to test with a new power supply for a few days.

Assuming the worst, is the Zyxel 326 compatible with the 325?

For $90 I'd be willing to buy a new box if I could just drop in my existing drives and save all my media.

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Please Help Me Get A Clean Start NSA325

Post by Mijzelf » Mon Oct 23, 2017 6:19 pm

pitcritter wrote:As I was rescanning my media into SR, the box froze.
Scanning the media is a burden for the disk(s), the power supply and the SoC. You can easily test if the box boots without disk(s).
pitcritter wrote:is the Zyxel 326 compatible with the 325?
Unfortunately not. The 326 won't accept the disks of a 325. If you have raid1 it is possible to convert it, but that boils down to copying everything twice.

pitcritter
Posts: 103
Joined: Tue Oct 08, 2013 12:51 am

Re: Please Help Me Get A Clean Start NSA325

Post by pitcritter » Mon Oct 23, 2017 9:03 pm

Bad news. I found another power supply with the same plug. Its12vdc but only 3.5A. I tried to boot the box without disks. No go. Looks like it's the box, not the p/s.

More bad news, I was setup as JBOD not RAID.

Looks like it's time for a new box and a 5TB backlog of TV shows.

Not the news I was looking for.

pitcritter
Posts: 103
Joined: Tue Oct 08, 2013 12:51 am

Re: Please Help Me Get A Clean Start NSA325

Post by pitcritter » Fri Oct 27, 2017 10:02 pm

The box is definitely dead.

Now, I know I've lost everything. Before I buy another NAS, I have one question.

Will the directions here for installing packages such as Entware, NZBGet, SickRage, etc work on the new NAS326?

If so, that's the route I'll likely go.

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Please Help Me Get A Clean Start NSA325

Post by Mijzelf » Sat Oct 28, 2017 8:30 am

pitcritter wrote:Now, I know I've lost everything.
That's not true. Your disks can be read by any Linux system, even by a 326. Only the 326 doesn't accept the disks 'as is', so you'll have to mount them manually and copy the contents to *somewhere*.
Will the directions here for installing packages such as Entware, NZBGet, SickRage, etc work on the new NAS326?
Entware runs on the 326. So if you packages are Entware packages, they will run also.
Actually, all 3th party packages I know of run on the 326, except FFP, Anyterm and 'Encrypted shares'.

pitcritter
Posts: 103
Joined: Tue Oct 08, 2013 12:51 am

Re: Please Help Me Get A Clean Start NSA325

Post by pitcritter » Sat Oct 28, 2017 11:30 am

I'm now more than a little confused.

My 2 disks were set up as JBOD. I assumed that there was no way to access the data now.

If I install each drive in an external enclosure then mount that drive on a Raspberry Pi for instance, then are you telling me that I may have access to the data?

If so I'm pretty damn happy this morning.

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Please Help Me Get A Clean Start NSA325

Post by Mijzelf » Sat Oct 28, 2017 12:00 pm

pitcritter wrote:If I install each drive in an external enclosure then mount that drive on a Raspberry Pi for instance, then are you telling me that I may have access to the data?
Sure. It's a normal 'linear' raid array. To mount them, do something like

Code: Select all

su
mdadm --assemble /dev/md0 /dev/sda2 /dev/sdb2
mount /dev/md0 /some/mountpoint
mdadm will read the headers in /dev/sda2 and /dev/sdb2, and assemble the array accordingly. Doesn't matter if it's raid1, raid0 or linear. (Of course it *does* matter if one of the disks dies).

/edit: on a PI maybe you'll have to install mdadm, and maybe also kernel modules for raid. For the latter I'd expect mdadm to pull them.

pitcritter
Posts: 103
Joined: Tue Oct 08, 2013 12:51 am

Re: Please Help Me Get A Clean Start NSA325

Post by pitcritter » Tue Nov 07, 2017 10:53 pm

Warning...shameless request for spoonfeeding follows :)

I started off with a fresh Raspbian installation. I ran apt-get update and apt-get upgrade.

I installed mdadm.

I attached both of my 4TB Reds from the NAS as well as a 5TB External drive to my RPi via an external, powered USB hub.

When I run fdisk -l, I see

Code: Select all

Disk /dev/sda: 4.6 TiB, 5000981077504 bytes, 9767541167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 6326DA44-4003-414D-894D-3E47A690FCFF

Device     Start        End    Sectors  Size Type
/dev/sda1   2048 9767540735 9767538688  4.6T Microsoft basic data


Disk /dev/sdb: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: A404C9B5-BB03-43ED-84FC-FCFACF71E86D

Device      Start        End    Sectors  Size Type
/dev/sdb1    2048     999423     997376  487M Linux swap
/dev/sdb2  999424 7814035455 7813036032  3.7T Microsoft basic data


Disk /dev/sdc: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F1256ABE-8E17-4639-9179-3E89ADC21EBB

Device      Start        End    Sectors  Size Type
/dev/sdc1    2048     999423     997376  487M Linux swap
/dev/sdc2  999424 7814035455 7813036032  3.7T Microsoft basic data


Disk /dev/md127: 7.3 TiB, 8000546799616 bytes, 15626067968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
I try

Code: Select all

sudo mdadm --assemble /dev/md0 /dev/sdc2 /dev/sdb2
and get

Code: Select all

mdadm: /dev/sdc2 is busy - skipping
mdadm: /dev/sdb2 is busy - skipping
I have no idea why they'd be "Busy".

Also, I can't even get my external HD mounted. I've tried

Code: Select all

 sudo mount -t ntfs /dev/sda1 /media/EXT
and get

Code: Select all

 mount: wrong fs type, bad option, bad superblock on /dev/sda1,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

Code: Select all

sudo parted /dev/sda 'print'
returns

Code: Select all

Model: Seagate Expansion Desk (scsi)
Disk /dev/sda: 5001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  5001GB  5001GB  ntfs         unknown  msftdata
The external drive works fine when plugged into a Windows machine.

OK, that's my sad story. Any suggestions?

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Please Help Me Get A Clean Start NSA325

Post by Mijzelf » Wed Nov 08, 2017 7:01 am

pitcritter wrote:I have no idea why they'd be "Busy".
Here is the answer:

Code: Select all

Disk /dev/md127: 7.3 TiB, 8000546799616 bytes, 15626067968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
The array was assembled automagically. So you only need to mount /dev/md127. (Maybe it's a good idea to see if it is already mounted too. cat /proc/mounts)
Also, I can't even get my external HD mounted. I've tried

Code: Select all

 sudo mount -t ntfs /dev/sda1 /media/EXT
and get

Code: Select all

 mount: wrong fs type, bad option, bad superblock on /dev/sda1,
       missing codepage or helper program, or other error
Does the PI support ntfs? (cat /proc/filesystems)
Have a look at ntfs-3g

pitcritter
Posts: 103
Joined: Tue Oct 08, 2013 12:51 am

Re: Please Help Me Get A Clean Start NSA325

Post by pitcritter » Thu Nov 09, 2017 12:28 pm

Well, we're making small steps...

After mounting /dev/md127 I can access the spanned drive, at least partially.

After installing ntfs-3g, i was able to mount and access my external drive.

On a closer look at the former NSA325 JBOD drives, I can read and access the contents, but it looks like I'm missing a bunch of content.

I'm currently copying the contents to my external drive, but the activity lights on my former JBOD drives show that only one of the two is being accessed.

I'm guessing that something has likely gotten corrupted and the second drive cannot be accessed.

As per fdisk -l, /dev/md127 shows as a 7.3TB drive, but to me, it looks like a large portion of that is inaccessible.

I'm happy to have recovered some of the content.

I'll be ordering a NAS326 and starting from scratch, this time, likely with some form of RAID protection.

Thanks for the help @Mijzelf.

Mijzelf
Posts: 6224
Joined: Mon Jun 16, 2008 10:45 am

Re: Please Help Me Get A Clean Start NSA325

Post by Mijzelf » Thu Nov 09, 2017 8:02 pm

pitcritter wrote:I'm currently copying the contents to my external drive, but the activity lights on my former JBOD drives show that only one of the two is being accessed.
It guess that can be a valid situation. In a linear raid the disks are glued after each other. So in an unfragmented filesystem only one file can span 2 disks, and all other files are on a single disk.
As I don't know how the filesystem distributes the files in the available space, I guess it's possible that while copying it will first copy the files from one disk, and then from the other.
I'm guessing that something has likely gotten corrupted and the second drive cannot be accessed.

Code: Select all

cat /proc/mdstat
should tell the status of the disks in the array. And

Code: Select all

df
can tell how much space is available according to the filesystems.

pitcritter
Posts: 103
Joined: Tue Oct 08, 2013 12:51 am

Re: Please Help Me Get A Clean Start NSA325

Post by pitcritter » Thu Nov 09, 2017 8:19 pm

mdstat reports the array correctly.

df shows 7690303844 1k blocks with only 10% used. The size looks right, the percentage is definitely not.

I know that the original array was around 60% full. I've definitely lost data.

The silver lining here is that this whole process has probably doubled my Linux knowledge. There's also probably nothing missing that I can't replace given enough time.

Let's close the door on this one. Many thanks again to @Mijzelf.

Post Reply