I have the NSA 325 V2 and placed raid1 on disk1 while disk2 had not yet a volume

2456

All Replies

  • Carlusha99
    Carlusha99 Posts: 39  Freshman Member
    is it possible to resize the filesystem to the format of the psysical size of the device?
    I have tried resize2fs -f /dev/md0 but got a reply that one of the blocks returned a short read.and that i have to do e2fsck.new -fy /dev/md0

  • Mijzelf
    Mijzelf Posts: 2,598  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    e2fsck is supposed to do the job. If you run it a second time, does it give the same output?
    (BTW, you can simply select the text in PuTTY with your mouse. It will automatically be copied to your clipboard)
    i have rebooted after the first e2fsck action by turning the NAS off and on again.
    By shutting it down, I hope, not by cutting the power.

  • Carlusha99
    Carlusha99 Posts: 39  Freshman Member
    I shut the NAS down and restarted the NAS again....by the power button.

    When i run the fsck.new another time i got the report as attached.


  • Mijzelf
    Mijzelf Posts: 2,598  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Hm. For some reason e2fsck doesn't work on your setup. The only other option is to bring it back to jbod. Can you post the output of
    <div>su</div><div><br></div><div>mdadm --examine /dev/sd?2</div>
    Do you have important data on that disk? In that case it might be a better idea to first copy everything over to the other disk.
  • Carlusha99
    Carlusha99 Posts: 39  Freshman Member
    how can i copy data to another disk?
  • Mijzelf
    Mijzelf Posts: 2,598  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    By mounting it. The NSA325 uses metadata version 0.9 for the raid arrays. In that case the header is at the end of the partition. That also means that the start of the partition is also the start of the filesystem. And so it's possible to mount the partition.
    To do so, you first have to stop the raid array, else the partition is marked busy, and cannot be mounted.
    If you have only that disk in the nas, you can mount it by
    <div>mkdir /mnt/mountpoint</div><div><br></div><div>su</div><div><br></div><div>mdadm --stop /dev/md0 && mount /dev/sda2 /mnt/mountpoint</div>
    Explanation: first create a mountpoint, then execute 'su' to make sure you are root, then stop the array, and immediately after that mount the partition. That because the firmware might re-assemble the array, if there is more time. Don't know.

    Now you should be able to see your shares in /mnt/mountpoint:
    ls /mnt/mountpoint/
    If you have 2 disks in, it's a bit more complicated, as I don't know if the array is /dev/md0 and the partition /dev/sda2. That could also be /dev/md1 and/or /dev/sdb2. The can be seen by studying the output of
    <div><br></div><div>cat /proc/mounts</div><div>cat /proc/mdstat</div>
    Which shows which partitions are used by the arrays, and which array is already mounted. The mounted array is the new disk, and target for your copy action. It will have a mountpoint like /i-data/<8-digit-hexadecimal-number>/

    If you have mounted the other disk, you can copy everythink over with
    <div>cd /mnt/mountpoint/</div><div><br></div><div>su</div><div><br></div><div>cp -a /i-data/<8-digit-hexadecimal-number>/</div><div></div>
    That will take some time. For big files about 50MB/sec, smaller files are slower.

    Thinking about it, it should also be possible to shrink the filesystem on the partition a bit, and then grow it on the array, solve your problem. You can't shrink it on the array, because resize2fs first runs e2fsck, and won't proceed if that raises an error.

  • Carlusha99
    Carlusha99 Posts: 39  Freshman Member
    Dear Mijzelf, Thank you so far your support. This evening i will first investigate the arrays and partitions of both disks in the NAS. I will come back to you with the results and hopefully you can help me with right mounting command afterwards.
  • Carlusha99
    Carlusha99 Posts: 39  Freshman Member
    Hi Mijzelf: Attached are the results of cat /proc/mdstat and cat /proc/mounts
    dev/md1 is the mounted one i believe, because it has i-data/3cc8587e

    md0 is the one with problems and is in raid1.

    If i copy the data from md0 to md1 and put a raid1 over both discs, won't i lose data then?

    Either way can you give me the command to copy data from md0 to md1?

    Again thank you.

  • Mijzelf
    Mijzelf Posts: 2,598  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Your conclusions are right. So the command sequence is
    <div>mkdir /mnt/mountpoint</div><div><br></div><div>su</div><div><br></div><div>mdadm --stop /dev/md0 && mount /dev/sda2 /mnt/mountpoint</div>
    Now the partition should be mounted. Check with
    cat /proc/mounts
    If that is OK, start copying
    <div>cd /mnt/mountpoint</div><div><br></div><div>copy -a * /i-data/3cc8587e/</div>
    I have seen on some ZyXEL nas that a mounted partition was automagically moved to /i-data/, so if /proc/mounts shows another mountpoint, change your 'cd'.

    If i copy the data from md0 to md1 and put a raid1 over both discs, won't i lose data then?
    You'll have to sacrifice the content of one of the disks. After copying you'll have one raid1 disk with a damaged filesystem, and one jbod disk, both containing the same data.
    I think you can't expand the jbod, as that will give the same problem as your original disk.
    So my proposal is to first copy everything over, then do the risky filesystem repair by shrinking the filesystem on /dev/sda2, assemble the array, and grow it again on /dev/md0.
    If the data is then still OK, the 2nd disk can be added.
  • Carlusha99
    Carlusha99 Posts: 39  Freshman Member
    I did:mkdir

    ~ # mkdir /mnt/mountpoint
    ~ # su


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

    ~ # mdadm --stop /dev/md0 && mount /dev/sda2 /mnt/mountpoint
    mdadm: stopped /dev/md0
    mount: you must specify the filesystem type <== <Did i forget something to enter?>

    ~ # 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/md1 /i-data/3cc8587e ext4 rw,noatime,barrier=0,data=writeback,usrquota 0 0
    /dev/md1 /usr/local/apache/web_framework/data/cache ext4 rw,noatime,barrier=0,data=writeback,usrquota 0 0
    /dev/mtdblock4 /usr/local/apache/web_framework/data/config yaffs2 rw,relatime 0 0
    /dev/md1 /usr/local/apache/htdocs/adv,/res/imdb_poster ext4 rw,noatime,barrier=0,data=writeback,usrquota 0 0
    /dev/md1 /usr/local/zy-pkgs ext4 rw,noatime,barrier=0,data=writeback,usrquota 0 0
    /dev/md1 /etc/zyxel/zy-pkgs ext4 rw,noatime,barrier=0,data=writeback,usrquota 0 0
    /dev/md1 /usr/local/apache/htdocs/adv,/pkg ext4 rw,noatime,barrier=0,data=writeback,usrquota 0 0

    ~ # cd /mnt/mountpoint
    /mnt/mountpoint # copy -a * /i-data/3cc8587e/
    sh: copy: not found

    I think something went wrong or did i forget something?




Consumer Product Help Center