NAS325-v2 volume missing after shut down.

tycoonlee
tycoonlee Posts: 16
Fourth Anniversary
 Freshman Member
edited December 2019 in Personal Cloud Storage
Does anybody know how to recovery the volume ? I have two disk, 1TB, and 2 TB. on raid1.
It shows no volume inside of storage gui page.
It serves me for almost two years and my wife turn off the power from the plug before our fmaily trip.
I believe my data is still insdie cause there is parition using after plugin to a linux reader.

Here is my /proc/mounts
~ $ cat /proc/mounts
rootfs / rootfs rw 0 0
/proc /proc proc rw,relatime 0 0
/sys /sys sysfs rw,relatime 0 0
none /proc/bus/usb usbfs rw,relatime 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
/dev/mtdblock8 /zyxel/mnt/nand yaffs2 ro,relatime 0 0
/dev/sda1 /zyxel/mnt/sysdisk ext2 ro,relatime,errors=continue 0 0
/dev/loop0 /ram_bin ext2 ro,relatime,errors=continue 0 0
/dev/loop0 /usr ext2 ro,relatime,errors=continue 0 0
/dev/loop0 /lib/security ext2 ro,relatime,errors=continue 0 0
/dev/loop0 /lib/modules ext2 ro,relatime,errors=continue 0 0
/dev/ram0 /tmp/tmpfs tmpfs rw,relatime,size=5120k 0 0
/dev/ram0 /usr/local/etc tmpfs rw,relatime,size=5120k 0 0
/dev/ram0 /usr/local/var tmpfs rw,relatime,size=5120k 0 0
/dev/mtdblock4 /etc/zyxel yaffs2 rw,relatime 0 0
/dev/mtdblock4 /usr/local/apache/web_framework/data/config yaffs2 rw,relatime 0 0



#NAS_Dec_2019
«13

All Replies

  • Mijzelf
    Mijzelf Posts: 2,044
    100 Answers 1000 Comments Friend Collector Fourth Anniversary
     Guru Member
    What is the output of

    cat /proc/partitions
    cat /proc/mdstat
    su
    mdadm --examine /dev/sd[ab]2


  • tycoonlee
    tycoonlee Posts: 16
    Fourth Anniversary
     Freshman Member
    Hi, Mijzelf, here are my output.

    ~ # cat /proc/partitions
    major minor  #blocks  name

       7        0     143360 loop0
       8        0 1953514584 sda
       8        1     514048 sda1
       8       16  976762584 sdb
       8       17     514048 sdb1
       8       18  976245952 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

    ~ # cat /proc/mdstat
    Personalities : [linear] [raid0] [raid1]
    unused devices: <none>

    ~ # mdadm --examine /dev/sd[ab]2
    mdadm: cannot open /dev/sda2: No such device or address
    mdadm: No md superblock detected on /dev/sdb2.

    Could it be saved?

  • Mijzelf
    Mijzelf Posts: 2,044
    100 Answers 1000 Comments Friend Collector Fourth Anniversary
     Guru Member
    edited December 2019
    The partition table on sda is damaged. /proc/partitions lists only the first partition. Yet the disk is alive, as sda1 is mounted.
    Your sdb disk has a valid partition table, but for some reason sdb2 doesn't contain a raid header.

    If your disks were really in raid1, sda2 should be as big as sdb2, although sda is twice as big as sdb.
    You can clone the partition table of sdb to sda, and see if the raid array member on sda2 is recognized:

    dd if=/dev/sdb of=/dev/sda count=32

    This will copy the first 32 sectors (16kB) from InputFile /dev/sdb to OutputFile /dev/sda. I don't know if your box uses MBR or GPT partitions, that depends on the firmware version when you created the array, but 16kB is enough for each.

    After that, reboot your box:

    reboot

    and cross your fingers while rebooting.
  • tycoonlee
    tycoonlee Posts: 16
    Fourth Anniversary
     Freshman Member
    Hi, Mijzelf
    Thanks for the instruction.
    After the table copy to sda2, I still could not find my volume from the GUI.
    Here is the command out.
    # cat /proc/partitions
    major minor  #blocks  name

       7        0     143360 loop0
       8        0 1953514584 sda
       8        1     514048 sda1
       8        2  976245952 sda2
       8       16  976762584 sdb
       8       17     514048 sdb1
       8       18  976245952 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

    ~ # cat /proc/mdstat
    Personalities : [linear] [raid0] [raid1]
    unused devices: <none>

    ~ # mdadm --examine /dev/sd[ab]2
    mdadm: No md superblock detected on /dev/sda2.
    mdadm: No md superblock detected on /dev/sdb2.



  • Mijzelf
    Mijzelf Posts: 2,044
    100 Answers 1000 Comments Friend Collector Fourth Anniversary
     Guru Member
    And you only pulled the plug on the wrong moment?

    On my 325 with volumes created in 2012 a version 0.9 superblock is used. Which means the header is at the end of the partition. It also means the start of the partition is also the start of the filesystem. So you can try to mount the filesystem directly:

    mkdir /mnt/attempt1
    mount -o ro /dev/sda2 /mnt/attempt1
    mkdir /mnt/attempt2
    mount -o ro /dev/sdb2 /mnt/attempt2

    If one of the mounts succeeds, you can copy your data elsewhere.
     As you started with raid1, the data on both disks should be identical.
  • tycoonlee
    tycoonlee Posts: 16
    Fourth Anniversary
     Freshman Member
    Yes, I didn't do extra action except unplugging the power and it made me buy a UPS to protect.

    After type these commands.
    ~ # mkdir /mnt/attempt1
    mkdir: can't create directory '/mnt/attempt1': File exists
    ~ # mount -o ro /dev/sda2 /mnt/attempt1
    mkdir /mnt/attempt2
    mount -o ro /dev/sdb2 /mnt/attempt2
    mount: you must specify the filesystem type
    ~ # mkdir /mnt/attempt2
    mkdir: can't create directory '/mnt/attempt2': File exists
    ~ # mount -o ro /dev/sdb2 /mnt/attempt2
    mount: you must specify the filesystem type

    It shows file exists and do I still keep the data?


  • Mijzelf
    Mijzelf Posts: 2,044
    100 Answers 1000 Comments Friend Collector Fourth Anniversary
     Guru Member
    It shows file exists and do I still keep the data?
    The file exists because you executed it twice. mkdir does 'make directory', and it will stay there until you reboot the box. (Or explicitly delete it). It has no influence on the contents of your disks.

    mount: you must specify the filesystem type
    try:
    mount -t ext3 -o ro /dev/sda2 /mnt/attempt1



  • tycoonlee
    tycoonlee Posts: 16
    Fourth Anniversary
     Freshman Member
    Glad to hear my data is still here.

    I reboot it and try to mount it again following by your command.
    Here is my output.

    ~ # mkdir /mnt/attempt1
    ~ # mount -o ro /dev/sda2 /mnt/attempt1
    mkdir /mnt/attempt2
    mount -o ro /dev/sdb2 /mnt/attempt2mount: you must specify the filesystem type
    ~ # mkdir /mnt/attempt2
    ~ # mount -o ro /dev/sdb2 /mnt/attempt2
    mount: you must specify the filesystem type
    ~ # mount -t ext3 -o ro /dev/sda2 /mnt/attempt1
    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
  • Mijzelf
    Mijzelf Posts: 2,044
    100 Answers 1000 Comments Friend Collector Fourth Anniversary
     Guru Member
    So no recognizable filesystem at the start of the partition. According to this post in 2018 a raid array was created with metadata version 1.2, which in our case means the offset of the inner data volume is at 2048 sectors.
    So let's create a loopdevice at that offset, and try to mount that.

    losetup /dev/loop1 -o 1048576 /dev/sdb2
    mkdir -p /mnt/attempt2
    mount -o ro /dev/loop1 /mnt/attempt2


  • tycoonlee
    tycoonlee Posts: 16
    Fourth Anniversary
     Freshman Member
    edited December 2019
    Done.

    All command is executed.
    No other message is displayed.

    ~ # losetup /dev/loop1 -o 1048576 /dev/sdb2
    ~ # mkdir -p /mnt/attempt2
    ~ # mount -o ro /dev/loop1 /mnt/attempt2

Consumer Product Help Center