General NAS-Central Forums

Welcome to the NAS community
It is currently Wed Nov 22, 2017 2:01 am

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu Jan 26, 2017 4:16 pm 
Offline

Joined: Thu Jan 26, 2017 3:57 pm
Posts: 9
Hello NAS-Central,

I have a problem with my NSA 325 v2 and hope you can help me. Today I wanted to upgrade my system from 1x 2tb to 1x2tb and 1x4tb, following the instructions I created a New Internal Volume as JBOD. Now that it is finished, my orginal 2tb harddrive is shown as "down" (Status) and "RAID1" (Configuration) what is definitly not what I wanted.

Is there any possiblity to undo this and get my Data from back?

Checking the drive within the zyxel webinterface gives following message:

"e2fsck 1.41.14 (22-Dec-2010)
The filesystem size (according to the superblock) is 488249232 blocks
The physical size of the device is 488249198 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort? no
/dev/md0 contains a file system with errors check forced.
Pass 1: Prüfe Inodes, Blöcke und Größen
Pass 2: Prüfe Verzeichnisstruktur
Pass 3: Prüfe Verzeichnisverbindung
Pass 4: Prüfe Verweiszähler
Pass 5: Prüfe zusammenfassende Gruppeninformationen
/dev/md0: 496661/122068992 files (9.5% non-contiguous) 423805863/488249232 blocks
Ok
"


Thank You very much.

Sincerely Yours Luca


Top
 Profile  
 
PostPosted: Fri Jan 27, 2017 9:43 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6073
Are you seeing 2 volumes, 1 JBOD of 4TB, and 1 RAID1 of 2TB?

Somehow the fsck dump you show sees a volume of about 500GB (488249198 'blocks'. A block is 1KiB). So more information is needed.

Can you open a shell (Maybe by using the Telnet backdoor, or else by installing the ssh package) and execute
Code:
cat /proc/partitions
cat /proc/mdstat
cat /proc/mounts
and past the output here? This commands will show all found block devices (disks, partitions and raid arrays), the status of the raid arrays, and all mounted devices.


Top
 Profile  
 
PostPosted: Sat Jan 28, 2017 1:07 pm 
Offline

Joined: Thu Jan 26, 2017 3:57 pm
Posts: 9
Yes, it is showing:

Status | Name | Configuration | Disc | Usage
-----------------------------------------------------------
Down Volume1 RAID1 disk1 N/A
Healthy Daten JBOD disk2 3.58TB

In the Attachment you can find the outcome of the commands.


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
PostPosted: Sat Jan 28, 2017 2:10 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6073
The raid array is up and healthy. The size is normal, so apparently 'only' the filesystem is damaged. It would be strange if that would be coincidental. Maybe somehow the raid header was exchanged, and the data partition now is on a different offset. You can ask for details on the raidheaders. Login as root (using your admin password) and execute
Code:
mdadm --examine /dev/sd[ab]2
(BTW, you can simply copy&paste from PuTTY. Just select the text with your mouse, it's automatically put on the clipboard)

Further it's strange that e2fsck tells that the physical size of the device (which should be md0) is 488249198 blocks, while /proc/partitions tells it's 1952996792 blocks. I suggest to repeat it without webinterface in between:
Code:
e2fsck -n /dev/md0
(The -n tells e2fsck not to change anything. Just show the output)


Top
 Profile  
 
PostPosted: Sat Jan 28, 2017 4:15 pm 
Offline

Joined: Thu Jan 26, 2017 3:57 pm
Posts: 9
Ah ok great, thanks. I didn't knew that.


Mijzelf wrote:
Code:
mdadm --examine /dev/sd[ab]2


Output
Code:
~ # mdadm --examine /dev/sd[ab]2
/dev/sda2:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : f5ae42f3:ae073e6c:da67a9a2:77b25e66
           Name : NSA325-v2:0
  Creation Time : Thu Jan 26 16:27:09 2017
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 1952996928 (1862.52 GiB 1999.87 GB)
     Array Size : 1952996792 (1862.52 GiB 1999.87 GB)
  Used Dev Size : 1952996792 (1862.52 GiB 1999.87 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : 8d6f4425:d010e1cd:df164425:baf5098e

    Update Time : Sat Jan 28 17:01:15 2017
       Checksum : e47dc6fb - correct
         Events : 70


   Device Role : Active device 0
   Array State : A. ('A' == active, '.' == missing)
/dev/sdb2:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 46f5cf6d:568e27fc:11025e18:d3b31281
           Name : NSA325-v2:1
  Creation Time : Thu Jan 26 16:29:39 2017
     Raid Level : linear
   Raid Devices : 1

 Avail Dev Size : 3906516992 (3725.55 GiB 4000.27 GB)
  Used Dev Size : 0
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : 1f5af914:f7bbbbd5:572ba65d:8b664281

    Update Time : Thu Jan 26 16:29:39 2017
       Checksum : a295987e - correct
         Events : 0

       Rounding : 0K

   Device Role : Active device 0
   Array State : A ('A' == active, '.' == missing)



Mijzelf wrote:
Code:
e2fsck -n /dev/md0


Output
Code:
sh: e2fsck: not found


How do you mean it, to repeat it without webinterface in between? I was just putting the commands into PuTTY ,is there also another way to do this?


Top
 Profile  
 
PostPosted: Sat Jan 28, 2017 6:31 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6073
Luca127 wrote:
Code:
  Creation Time : Thu Jan 26 16:27:09 2017
 Avail Dev Size : 1952996928 (1862.52 GiB 1999.87 GB)
<snip>
  Creation Time : Thu Jan 26 16:29:39 2017
 Avail Dev Size : 3906516992 (3725.55 GiB 4000.27 GB)
The 2TB raid array has been created at about the same time as the 4TB raid array. From your startpost I understand the 2TB array was already active for a significant time, so apparently the firmware re-created the array as part of your adding of the 4TB array.

As you can read here, the position of the raid header is dependent on the 'metadata version'. The current header is version 1.2, which is at the start of the partition. ZyXEL used to use version 0.9, but that had a size limit, which made it impossible to resize a raid1 array to >2TiB when exchanging the disks one by one by disks >2TiB. So later firmwares used 1.2 by default.
Yet I don't know if the 325v2 is old enough to have had the '0.9 version' of firmware.

Assuming it is, and the original metadata version was 0.9, you can try to mount the partition itself. (A single disk raid array with the raid header at the end of the partition, has the same data offset as the containing partition). So
Code:
# First stop the array
mdadm --stop /dev/md0
# Create a mount point
mkdir -p /tmp/mountpoint
# Try to mount the partition
mount -o ro -t ext4 /dev/sda2 /tmp/mountpoint
# if that fails, try ext3
mount -o ro -t ext3 /dev/sda2 /tmp/mountpoint


Quote:
How do you mean it, to repeat it without webinterface in between? I was just putting the commands into PuTTY ,is there also another way to do this?

Quote:
Checking the drive within the zyxel webinterface gives following message:

"e2fsck 1.41.14 (22-Dec-2010)
The webinterface internally clearly calls e2fsck. And it does also some filtering on the output, as I can't imagine that command line tool to produce German output.

If the system can't find e2fsck, maybe it has a different name. Try to enter 'e2fs' and then press TAB to let the shell autocomplete. Try the same with 'fsck'. There might be an fsck.ext3 and/or fsck.ext4


Top
 Profile  
 
PostPosted: Sun Jan 29, 2017 8:38 am 
Offline

Joined: Thu Jan 26, 2017 3:57 pm
Posts: 9
Quote:
The 2TB raid array has been created at about the same time as the 4TB raid array. From your startpost I understand the 2TB array was already active for a significant time, so apparently the firmware re-created the array as part of your adding of the 4TB array.


Yes it was already in action, but as JBOD and not as RAID.


Quote:
# Try to mount the partition
mount -o ro -t ext4 /dev/sda2 /tmp/mountpoint
# if that fails, try ext3
mount -o ro -t ext3 /dev/sda2 /tmp/mountpoint


For both commands it says:


Code:
mount: wrong fs type, bad option, bad superblock on /dev/sda2,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so


Quote:
Try to enter 'e2fs' and then press TAB to let the shell autocomplete



it autocompletes to "e2fsck." but afterwards its saying again "not found".

If it helps, I can give you direct access through TeamViewer or some similar software.

Thank You so much for your help and patience.


Top
 Profile  
 
PostPosted: Sun Jan 29, 2017 8:28 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6073
Luca127 wrote:
Yes it was already in action, but as JBOD and not as RAID.
There is no real difference between a single disk raid1 array, and a single disk jbod array. The header is different, but the payload is identical.
Yet is proves that a new header was created.
Quote:
For both commands it says:


Code:
mount: wrong fs type, bad option, bad superblock on /dev/sda2,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
I guess it means that the previous metadata version was not 0.9. But of course it can also mean the current header has damaged the filesystem.
Quote:
Quote:
Try to enter 'e2fs' and then press TAB to let the shell autocomplete


it autocompletes to "e2fsck." but afterwards its saying again "not found".
It means that there more than one executable starting with "e2fsck." . I looked on my box, and I have a e2fsck.sh and a e2fsck. Both in /usr/sbin/. The .sh file is a script which unmounts the volume, if necessary, and then calls e2fsck. Maybe the 'real' e2fsck is called e2fsck.bin or something like that on your system.
You can try to double tab to get a list of possibilities, or execute
Code:
ls /usr/sbin/e2*
to get a list of all files starting with e2 in /usr/sbin/

Meanwhile it begins to look like some low level rescue might be needed. If e2fsck fails in detecting the physical size of the volume, I don't think it will be able to repair the filesystem. (And repairing a filesystem which is unrepairable (maybe due to an offset on the startpoint) can cause more damage).

It's a good habit to create a bit-by-bit backup before attempting to repair the filesystem. In that case you can always revert. Does your 4TB disk have enough free space to put a copy of that disk on it?

What is the nature of your data? A tool like PhotoRec can recover files without help of the filesystem. And despite it's name it can recover much more than photo's alone.
The files need to have a recognizable header, from which you somehow also can read the filesize. And the files should not be fragmented. A downside is that without the filesystem you won't have metadata from the filesystem. So no filename, path and timestamp.


Top
 Profile  
 
PostPosted: Tue Jan 31, 2017 9:54 am 
Offline

Joined: Thu Jan 26, 2017 3:57 pm
Posts: 9
ok.

Double tab and the command gives me those possibilities

Code:
~ $ e2fsck.
e2fsck.new  e2fsck.sh
~ $ ls /usr/sbin/e2*
/usr/sbin/e2fsck.new  /usr/sbin/e2fsck.sh


So I executed following command again:
Quote:
e2fsck -n /dev/md0


This is the output:
Code:
~ $ e2fsck.sh -n /dev/md0
BusyBox v1.17.2 (2016-05-02 14:07:13 CST) multi-call binary.

Usage: grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

BusyBox v1.17.2 (2016-05-02 14:07:13 CST) multi-call binary.

Usage: grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

e2fsck: Only one of the options -p/-a, -n or -y may be specified.
e2fsck -f -y return value:8


Yes the 4tb disk is completly free, I haven't used it yet. Is there also a command for copying? I already tried to connect the disk directly to my laptop, but it couldn't read the filesystem.

Quote:
What is the nature of your data? A tool like PhotoRec can recover files without help of the filesystem. And despite it's name it can recover much more than photo's alone.
The files need to have a recognizable header, from which you somehow also can read the filesize. And the files should not be fragmented. A downside is that without the filesystem you won't have metadata from the filesystem. So no filename, path and timestamp.


Most of the files are indeed photos, then there are a lot of documents and some multimedia files like music or videos. Most of them I could find on the list for PhotoRec. If some files/ Metadata gets lost its ok, I have an old backup, which might cover about 60% of the files, I have stored on the 2tb disk.


Top
 Profile  
 
PostPosted: Tue Jan 31, 2017 12:19 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6073
Quote:
This is the output:
I think you'd better use e2fsck.new instead of e2fsck.sh
Quote:
Is there also a command for copying?
Code:
dd if=/dev/sda2 of=/i-data/46f5cf6d/admin/Copy_of_sda2 bs=64M
This will copy the whole content of /dev/sda2 to a file /i-data/46f5cf6d/admin/Copy_of_sda2 (should show up in your admin share), using a memory buffer of 64MiB.
I don't think the copy speed will exceed 50MB/sec, so do the math.
The command has to run as root, as anyone else doesn't have the permission to read a raw block device.

To revert simply exchange the if and of (inputfile and outputfile) values. BTW, when using dd, always doublecheck the value of of=, as dd will happily overwrite anything you offer as target.

Quote:
Most of the files are indeed photos, then there are a lot of documents and some multimedia files like music or videos. Most of them I could find on the list for PhotoRec. If some files/ Metadata gets lost its ok, I have an old backup, which might cover about 60% of the files, I have stored on the 2tb disk.
In that case you can give PhotoRec a shot. Theoretically it can run on the NAS, but as it omits filesystem data, you can also run it on one of the other supported platforms. (Windows, MacOS).

I think I can provide a script which can filter out (after restoring them) the 60% which is already in backup. (A simple dedup should do. Maybe while ignoring the last 4kB, as both the originals as the restored files might have or have not padding bytes at the end.

Ideally (when you have storage room enough) the sequence would be:
  • Create a binary backup.
  • Let PhotoRec restore whatever it can.
  • Do an attempt to repair on /dev/md0. If that fails, and the disk content is changed, put back the backup.
  • Do an attempt to repair on /dev/sda2. If that fails, and the disk content is changed, put back the backup.
  • Do an attempt to repair on several offsets on /dev/sda2.
If one of the repair attempts succeed, you can probably drop all PhotoRec data.

It is possible to install a newer version of e2fsck on the NAS, by installing Entware-ng, and installing e2fs-tools on that. I don't know if that will give better repair results.


Top
 Profile  
 
PostPosted: Sun Feb 05, 2017 8:22 pm 
Offline

Joined: Thu Jan 26, 2017 3:57 pm
Posts: 9
Hi,

it took a while to answer. I became quite ill last week and had aditionally a lot of assignments to finish.

The copying to the 4tb harddrive worked correctly.

Now I am trying to use PhotoRec. The only problem with it is, I can not choose my 4tb NAS Hard Drive as destination folder. For testing I have now choosen my Notebook HDD with 400GB left, what is definetly not enough for all files.

The NAS Harddrive is mounted.

PhotoRec already says it has found several thousand files and has started recovering them, but when I look in the folder most the files are .elf, .tz, .gif, .png, ... with less then 100kb. They seem to be files from the NAS Software itself and including the Button Images for the Webinterface or some Information about my system, Router, ...

edit: now from time to time some of my private files are appearing, but they are very rare. The biggest files are some *.xz with up to 2gb. Tomorrow I can say more.


Top
 Profile  
 
PostPosted: Mon Feb 06, 2017 6:46 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6073
Luca127 wrote:
The copying to the 4tb harddrive worked correctly.
Just curious. How long did it take?

Quote:
Now I am trying to use PhotoRec. The only problem with it is, I can not choose my 4tb NAS Hard Drive as destination folder. For testing I have now choosen my Notebook HDD with 400GB left, what is definetly not enough for all files.

The NAS Harddrive is mounted.
Mounted as in 'it has a driveletter'?

Quote:
PhotoRec already says it has found several thousand files and has started recovering them, but when I look in the folder most the files are .elf, .tz, .gif, .png, ... with less then 100kb. They seem to be files from the NAS Software itself and including the Button Images for the Webinterface or some Information about my system, Router, ...

Are you scanning the whole drive, or only the data partition? On the first partition a part of the firmware is stored, containing mainly the webinterface, in one big file (system.img, when I remember well). This file internally contains a filesystem, containing a lot of files. PhotoRec will have no problem to find them, if you scan the whole drive.


Top
 Profile  
 
PostPosted: Mon Feb 06, 2017 8:07 am 
Offline

Joined: Thu Jan 26, 2017 3:57 pm
Posts: 9
Quote:
Just curious. How long did it take?


I started with it in the morning and in the evening it was finished, it took about 10-12 hours (~1,8tb and 45mb/s).

Quote:
Mounted as in 'it has a driveletter'?


Yes, it has now the letter Z, but Photorec is not showing it. I have solved it now this way, that I connected my 2tb harddrive with a docking station to my Notebook and now I am copying every 10 hours my restored files from my notebook to my NAS manually. Photorec is not that fast, so it works up to now.

Quote:
Are you scanning the whole drive, or only the data partition? On the first partition a part of the firmware is stored, containing mainly the webinterface, in one big file (system.img, when I remember well). This file internally contains a filesystem, containing a lot of files. PhotoRec will have no problem to find them, if you scan the whole drive.


I have choosen the whole drive because I was unsure. Overnight it restored a lot of Audiodata and started with some pictures. The most common file are *.txt with no or nearly no content.


Top
 Profile  
 
PostPosted: Mon Feb 06, 2017 8:25 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6073
Luca127 wrote:
45mb/s
Wow. I wasn't much wrong with 50MB/s

Quote:
The most common file are *.txt with no or nearly no content.
PhotoRec does a 'raw scan', which means it reads each sector and decides if it could be a header of a known file type. If it is, it tries to guess the length. Fortunately many header types contain a file length, in which case it can just store that number of bytes, starting with the header. (That's the reason why the filesystem should not be fragmented. It's nearly impossible to find the fragments without help of the filesystem).
A .txt file generally has no header, it's just text. But maybe those files start with a BOM. In that case the file would get on until the data can no longer be text. A hexviewer can tell if they have a BOM.

Quote:
Photorec is not that fast
No. It has to read each single sector, and compare it to a few hundreds of file type templates. I *think* that even if it finds a file, it still will examine each sector in that file, in case the header it found was a deleted file, which is partly overwritten.


Top
 Profile  
 
PostPosted: Thu Feb 09, 2017 1:36 pm 
Offline

Joined: Thu Jan 26, 2017 3:57 pm
Posts: 9
Yes really good.


Photorec is now finished with recovering files, unfortunatelly only 114gb could be recovered. Most of them are Mediafiles (movies, music or pictures) next to the textfiles. Not the best, but at least something.

This evening I will try to install a newer Version of e2fsck on the NAS and then try to repair the disk.

How does the repair work with e2fsck?

I have already checked some websites for the commands, but there are always several options and I don't want to risk anything.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 64 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group