Zyxel 325v2 migration issue - raid 1 array down

Marvell Kirkwood based
DLe
Posts: 10
Joined: Fri Dec 29, 2017 3:02 pm

Zyxel 325v2 migration issue - raid 1 array down

Post by DLe » Fri Dec 29, 2017 4:14 pm

Hello,

my scenario is following:

NAS Zyxel 325 v2 (fw 4.81) with 2TB WD Red in first slot. This Christmas I've bought 4 TB WD Red for second slot. My idea was either to build JBOD 2+4TB, or at least switch "primary" disc to 4TB and 2TB disc to use for backup of family photos and videos from "primary" one.

In web interface / storage / logical drive i used "migrate" hoping for some setup dialogue, but NAS started process immediately. I let it run during afternoon and checked result in the evening - Logical drive was in down state in RAID 1 configuration (with first/original disc 2TB and second/added disc 4TB).

From Zyxel web interface I've tried check logical drive without and later with automatic file repair option, but with no luck, ending with info table like this:

Code: Select all

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? yes
e2fsck -f -y return value:8
I thought that RAID 1 array with 2TB and 4TB is nonsense, so I've bought another (identical type) 2TB WD Red disc and connected it instead of 4TB one, hoping, that RAID1 will rebuild itself and then i can access data. After insertioin second 2TB disc, Zyxel obviously started to copy data, which took several hours, but in the end, when there was no activity visible, logical disc stay still in down state.

So i have ended with original 2TB disc (unreadable), new 4TB disc with probably mirrored 2TB partition (unreadable) and with second 2TB disc with mirrored 2TB partiton (unreadable)

After i made some googling, i've found, that people had some migration issues with Zyxel NAS ending with unreadable RAID partitions. As i'm not familiar with Linux so far, i'm searching for any help regarding accessing my data.

I put second/new 2TB disc into computer and now I'm trying TestDisk tool on it, to try to recover partition: select disc / GPE partition / analyse / abort / deepscan which runs right now (6% after 5 hours)

Meanwhile Zyxel NAS through PUTTY command

Code: Select all

fdisk -l
gives me this (now only original 2TB disc is in first bay, second/new 2TB disc is in PC trying luck with TestDisk as i mentioned above):

Code: Select all

ZyXEL-1 login: root
Password:


BusyBox v1.17.2 (2017-06-23 10:40:08 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # fdisk -l

Disk /dev/sda: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x755def46

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          64      514048+   8  AIX
/dev/sda2              65      243201  1952997952+  20  Unknown
~ #

/ # fdisk -l

Disk /dev/sda: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x755def46

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          64      514048+   8  AIX
/dev/sda2              65      243201  1952997952+  20  Unknown
/ #
Thanks in advance for any thoughts on this.

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

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by Mijzelf » Fri Dec 29, 2017 6:04 pm

I think I know what happened to your filesystem, and I described it here.

So you have the options:
  • Create a new volume on one of the new disks, mount the raw partition on the original 2TB disk, and copy everything over.
  • Shrink the filesystem on the orginal disk.
BTW, have you tried to start the NAS with only the 4TB disk inserted? Depending on how the raid volume is created, it might contain a mountable ext3 filesystem. And if not, it might be possible to manually grow the array a bit.

A RAID1 array of a 2 and a 4 TB disk makes perfect sense. Only problem is that you waste 2TB space on the 4 TB disk. (Which theoretically can be used to contain an extra partition)

DLe
Posts: 10
Joined: Fri Dec 29, 2017 3:02 pm

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by DLe » Sat Dec 30, 2017 8:25 am

BTW, have you tried to start the NAS with only the 4TB disk inserted? Depending on how the raid volume is created, it might contain a mountable ext3 filesystem. And if not, it might be possible to manually grow the array a bit.
Nope I haven't, great idea, it absolutely didn't come into my mind. I'll try after New year (i'm on visit at my parents right now) and let you know. If it won't be viable, we have, at least, plenty of disks to experiment on :-) Thanks a lot.

DLe
Posts: 10
Joined: Fri Dec 29, 2017 3:02 pm

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by DLe » Mon Jan 01, 2018 8:49 pm

Hi again,

i tried to insert only 4TB disc and i got this (see attachment). Obviously 4TB disc hadn't got mirrored anything from 2TB one, as i thought :-(

Although web interface says that 715,30 MB of its capacity is used, disc appears to be completely empty when i connect to it from windows file explorer.
So you have the options:

• Create a new volume on one of the new disks, mount the raw partition on the original 2TB disk, and copy everything over.
• Shrink the filesystem on the orginal disk.
As first following step i would like to try to create new volume on 4TB disc (which in fact is done), mount raw partition from 2TB disc and move data. I saw link you posted (in fact i saw it and tried to follow it even before i wrote my problem here). When i followed instructrions i successfully disbanded raid array with:

Code: Select all

mdadm --stop /dev/md0
, but i weren't able to mount raw partition as i'm not linux experienced user, so i somehow managed to reassemble raid array again through (if i remember it correctly):

Code: Select all

mdadm --assemble
.

So, could you please provide me with correct commands, so i can accomplish this successfully? Thanks a lot.
You do not have the required permissions to view the files attached to this post.

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

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by Mijzelf » Tue Jan 02, 2018 11:56 am

The command to mount the raw partition should be something like:

Code: Select all

mkdir /tmp/mountpoint
mount -t ext3 -o ro /dev/sda2 /tmp/mountpoint
Assuming the old disk is sda. It could be sdb either. You can see that using

Code: Select all

cat /proc/partitions
If you installed RandomTools (on your new volume), you can start a screen session to do the copying. Using screen you can close your ssh/telnet client, and later pick it up again using 'screen -r'.

DLe
Posts: 10
Joined: Fri Dec 29, 2017 3:02 pm

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by DLe » Wed Jan 03, 2018 12:18 am

I've put original 2TB disc into bay1 and 4TB disc into bay2 of my Zyxel.

I've started Putty and connected to Zyxel via telnet:

Code: Select all

ZyXEL-1 login: root
Password:


BusyBox v1.17.2 (2017-06-23 10:40:08 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

then:

Code: Select all

~ # cat /proc/partitions
gave me:

Code: Select all

major minor  #blocks  name

   7        0     143360 loop0
   8        0 1953514584 sda
   8        1     514048 sda1
   8        2 1952997952 sda2
  31        0       1024 mtdblock0
   8       16 3907018584 sdb
   8       17     498688 sdb1
   8       18 3906518016 sdb2
  31        1        512 mtdblock1
  31        2        512 mtdblock2
  31        3        512 mtdblock3
  31        4      10240 mtdblock4
  31        5      10240 mtdblock5
  31        6      48896 mtdblock6
  31        7      10240 mtdblock7
  31        8      48896 mtdblock8
   9        0 1952996792 md0
   9        1 3906516992 md1
and

Code: Select all

~ # fdisk -l
gave me this:

Code: Select all

Disk /dev/sda: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x755def46

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          64      514048+   8  AIX
/dev/sda2              65      243201  1952997952+  20  Unknown

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 4000.7 GB, 4000787030016 bytes
255 heads, 63 sectors/track, 486401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      267350  2147483647+  ee  GPT
then i've used:

Code: Select all

~ # mkdir /tmp/mountpoint
~ # mount -t ext3 -o ro /dev/sda2 /tmp/mountpoint
which returned:

Code: Select all

mount: /dev/sda2 already mounted or /tmp/mountpoint busy
so i've disbanded 2TB disc from its RAID with:

Code: Select all

~ # mdadm --stop /dev/md0
which gave me this:

Code: Select all

mdadm: stopped /dev/md0
then i've used

Code: Select all

~ # mount -t ext3 -o ro /dev/sda2 /tmp/mountpoint
and i've ended up with:

Code: Select all

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
Any clues what to do next? Should i try the same witch second 2TB disc (mirrored one?), or it will be the same? Thx for any help.

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

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by Mijzelf » Wed Jan 03, 2018 6:02 pm

Did you migrate that disk from an older ZyXEL nas? In that case the filesystem might be xfs, or even reiserfs.

DLe
Posts: 10
Joined: Fri Dec 29, 2017 3:02 pm

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by DLe » Thu Jan 04, 2018 3:05 am

Mijzelf wrote:Did you migrate that disk from an older ZyXEL nas? In that case the filesystem might be xfs, or even reiserfs.
Nope. Original 2TB was bought for this particular Zyxel. Can i mess something when i try to mount partition with filesystems you described in your post?

Although that 2TB disc was alone in Zyxel NAS, i think it was configured as JBOD (if i remember it correctly). Could it have infulence on Zyxel's descision which type of filesystem uses for that disc? Unfortunately i can't remember which type of FS was used on original disc :-(

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

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by Mijzelf » Thu Jan 04, 2018 7:15 pm

DLe wrote:Can i mess something when i try to mount partition with filesystems you described in your post?
No, as long as you use the '-o ro' flag (mount readonly), the filesystem driver will not write anything to the disk.
Could it have infulence on Zyxel's descision which type of filesystem uses for that disc?
AFAIK not. Only the firmware version which was installed when you created the volume is important. I think a 325v2 is too new to have used anything else than ext3/4, but I'm not sure. On firmware 2 reiserfs was used, but after the maintenance was stopped (Hans Reiser is in jail for murder) ZyXEL switched to xfs. Later is became ext3. On firmware 5 ext4 is used.

DLe
Posts: 10
Joined: Fri Dec 29, 2017 3:02 pm

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by DLe » Sun Jan 28, 2018 1:18 pm

Hi again,
Mijzelf wrote: So you have the options:

• Create a new volume on one of the new disks, mount the raw partition on the original 2TB disk, and copy everything over.
Mijzelf wrote:
DLe wrote:Can i mess something when i try to mount partition with filesystems you described in your post?
No, as long as you use the '-o ro' flag (mount readonly), the filesystem driver will not write anything to the disk.
So I've tried to mount RAW partition from original 2TB disc with different filesystems and I got this:

Code: Select all

~ # mount -t ext3 -o ro /dev/sda2 /tmp/mountpoint
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

~ # mount -t ext4 -o ro /dev/sda2 /tmp/mountpoint
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

~ # mount -t xfs -o ro /dev/sda2 /tmp/mountpoint
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

~ # mount -t reiserfs -o ro /dev/sda2 /tmp/mountpoint
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
Same result I got, when I tried same with second (new) 2TB disc.

But when I've used:

Code: Select all

~ # fdisk -l
I've noticed that new 4 TB disc, which is configured as JBOD (same way as original 2TB disc was configured before failed migration), show filesystem "GPT":

Code: Select all

Disk /dev/sda: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3dfe9761

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          64      514048+   8  AIX
/dev/sda2              65      243201  1952997952+  20  Unknown

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 4000.7 GB, 4000787030016 bytes
255 heads, 63 sectors/track, 486401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      267350  2147483647+  ee  GPT
~ # cat /proc/partitions
major minor  #blocks  name

   7        0     143360 loop0
   8        0 1953514584 sda
   8        1     514048 sda1
   8        2 1952997952 sda2
   8       16 3907018584 sdb
   8       17     498688 sdb1
   8       18 3906518016 sdb2
  31        0       1024 mtdblock0
  31        1        512 mtdblock1
  31        2        512 mtdblock2
  31        3        512 mtdblock3
  31        4      10240 mtdblock4
  31        5      10240 mtdblock5
  31        6      48896 mtdblock6
  31        7      10240 mtdblock7
  31        8      48896 mtdblock8
   9        1 3906516992 md1
What does it mean?

when I've tried:

Code: Select all

~ # mount -t GPT -o ro /dev/sda2 /tmp/mountpoint
I got this:

Code: Select all

mount: unknown filesystem type 'GPT'
I would be grateful for every thought on this. Thanks.

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

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by Mijzelf » Sun Jan 28, 2018 8:45 pm

GPT is not a filesystem, but a partition table. It stands for GUID Partition Table. The 'old' partition table MBR (Master Boot Record) is old. About 30 years, I think. It was designed for disks sized up to 512MB. The format has changed a few times, to support bigger disks, and the latest incarnation can handle disks up to 2^32 - 1 sectors, which is a bit bigger than 2TB (or a bit smaller than 2TiB), when you use sectors of 512 bytes.
So for bigger disks GPT is invented. fdisk cannot handle that, and tells you so. If you want to view the table you have to use parted.

Code: Select all

parted /dev/sda print

DLe
Posts: 10
Joined: Fri Dec 29, 2017 3:02 pm

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by DLe » Mon Jan 29, 2018 2:27 am

using

Code: Select all

parted /dev/sda print
i got this for original 2TB disc (for new 2TB disc i got the same):

Code: Select all

~ # parted /dev/sda print
Model:  WD20EFRX-68EUZN0 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  526MB   526MB   primary  ext2
 2      526MB   2000GB  2000GB  primary
for 4TB disc i got this:

Code: Select all

~ # parted /dev/sdb print
Model:  WD40EFRX-68N32N0 (scsi)
Disk /dev/sdb: 4001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system     Name       Flags
 1      1049kB  512MB   511MB   linux-swap(v1)  mitraswap
 2      512MB   4001GB  4000GB                  eexxtt44
Which seems strange to me, because before failed migration, original 2TB disc was set up as JBOD, in fact same way as 4TB is set up now and both discs (original 2TB and now new 4TB) were set up on same Zyxel device :-/

Do you have any idea how to mount raw partition from 2TB and copy it to 4TB disc to access data?

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

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by Mijzelf » Tue Jan 30, 2018 8:21 am

JBOD has nothing to do with the partition table. The RAID member is stored in a partition. That one partition table is 'msdos', and one GPT might be strange. Either the firmware looks at the size of the disk, and chooses one, which is indeed strange, GPT can do them all. But I can imagine GPT is added in a firmware update. Can't remember if the 325 originally supported disks >2TB.
Do you have any idea how to mount raw partition from 2TB and copy it to 4TB disc to access data?
Reading this thread we didn't look at the raid header yet, did we?
Have a look

Code: Select all

mdadm --examine /dev/sda
It can tell where the payload of the raid member is stored, relative to the start of the partition.

DLe
Posts: 10
Joined: Fri Dec 29, 2017 3:02 pm

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by DLe » Thu Feb 01, 2018 11:14 am

Hello,

for this attempt I've used "new" 2TB disc

i've tried:

Code: Select all

mdadm --examine /dev/sda
and got this:

Code: Select all

~ # mdadm --examine /dev/sda
mdadm: No md superblock detected on /dev/sda.
then this:

Code: Select all

mdadm --examine /dev/sda1
gave me this:

Code: Select all

~ # mdadm --examine /dev/sda1
mdadm: No md superblock detected on /dev/sda1.
and finally this:

Code: Select all

~ # mdadm --examine /dev/sda2
gave me this:

Code: Select all

~ # mdadm --examine /dev/sda2
/dev/sda2:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : fe0b8f56:e01c0f60:0af62a28:f9065a54
           Name : ZyXEL-1:0  (local to host ZyXEL-1)
  Creation Time : Mon Dec 25 12:03:37 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 : 9325b11c:45b30811:c54d6607:9bbd3f83

    Update Time : Thu Feb  1 12:02:04 2018
       Checksum : 9a8a5107 - correct
         Events : 226


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

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

Re: Zyxel 325v2 migration issue - raid 1 array down

Post by Mijzelf » Thu Feb 01, 2018 12:50 pm

DLe wrote:got this:

Code: Select all

~ # mdadm --examine /dev/sda
mdadm: No md superblock detected on /dev/sda.
Sorry. My error. It indeed had to be /dev/sda2

Code: Select all

    Data Offset : 2048 sectors
And here is the reason why the raw partition cannot be mounted. The data starts at 2048 sectors, not at 0.
This can be worked around by using a loop device. A virtual block device, which passes it's access to a file (and because this is Linux everything is a file, also a partition.)
So we create a loop device which starts at sector 2048 of /dev/sda2:

Code: Select all

losetup /dev/loop3 -o 1048576 /dev/sda2
(1048576 is 2048 512 byte sectors in bytes)
Now the loopdevice can be mounted:

Code: Select all

mkdir -p /tmp/mountpoint
mount -o ro /dev/loop3 /tmp/mountpoint
(/dev/loop3 is choosen arbitrary. The firmware has one or two loop devices in use. When I remember well there are 8 available.)

Post Reply