Migration from RAID1 on NAS200

Discussion in 'Cisco/Linksys Network Storage Devices' started by baudy2, Aug 28, 2009.

  1. baudy2

    baudy2 LI Guru Member

    Hi all !

    Is there a way (via telnet or SSH, of course) to move from RAID1 to 2-single drives configuration without loosing the data ? I need it on order to remove 1 disk from NAS200.

    Thanx in advance,
  2. computeguy

    computeguy Network Guru Member

    RAID 1

    when a drive is in a RAID 1 array.. the data is stripped across both disks..
    so if 1 disk were to fail.. then you lose all data in the array.

    only way i could see of backing it up is to map a drive to the NAS from your
    pc... then download all data to a folder.... remove drive from the RAID 1

    use NAS firmware to reformat drives as 2 separate disks.. then copy data

    so to answer your question.. there is no way of breaking the RAID1 without
    data loss.
  3. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    RAID1 is mirroring (@computeguy: no, the data is NOT striped in RAID 1, if one drive fails, you still have all your data. Striping (one "P") is RAID 0 and yes, if you lose one disk of a striped set, your data is gone) so in theory it should be possible to do this by breaking the mirror (by removing the second drive) and copying the data. However as soon as you insert the second drive again, the NAS will assume that you're replacing the second drive of your mirror, and it will start rebuilding the mirror.

    While it may be possible to prevent it from doing that by killing the necessary programs, there is always the chance that you're going to do something wrong and destroy your data.

    So (perhaps ironically) the more precious your data is to you, the more important it is to do this the proper way and not try to hack it. But if you want, you can probably do it a lot faster by doing the following:
    1. Turn the NAS off with the power button (it beeps, works a few seconds, then switches itself off).
    2. Remove one of the hard disks
    3. Attach the hard disk to another computer that runs Linux and has the mdadm command and understands the file system it was formatted with (ext2 for non-journaled, XFS for journaled)
    4. Use the mdadm command to mount your hard disk on the other computer as a broken mirror. Preferably you should mount the drive read-only.
    5. If you can't access the drive on your other computer, stop here. You can still put the drive back in the NAS and you should still see all your data (if you didn't write to the drive, the mirror won't even need to be rebuilt). Don't continue with the rest of this instruction! Instead, find another way to backup and restore your files, e.g. write them to a hard disk in another machine or back it up to DVD-R's.
    6. If you are able to access all files on your other computer, you can turn the NAS back on (still with the one drive in it). It will start running with a broken mirror, but because you have all that data on your other computer too, you can change the NAS configuration to Separate Disk mode and format the one drive that's still in it.
    7. You can now use the other computer to copy all the data from the second disk (attached to that computer) back to the NAS. (Alternatively, after formatting the first disk in the NAS, you can turn the NAS off and attach the first disk to the other computer as second disk for faster copying)
    8. After you're done copying, you can turn the other computer and the NAS off and put the second drive back into the NAS. You can then format it and you will have an empty disk.

    No, I don't know what the mdadm commands are to mount one drive of a mirrored set. You will have to read the mdadm man page.

    Hope this helps (needless to say, I won't take responsibility for your data whether you decide to follow these instructions or not. If you want to do it the right way, you should regard the NAS as a "black box" and copy everything over the network, then reconfigure it to Separate Disk mode and reformat).



    I just thought of another way if you don't have a Linux PC:
    • Turn your NAS off with power switch
    • Remove both drives
    • Turn the NAS on
    • Change the configuration to Separate Disks
    • Turn the NAS off again
    • Insert both disks and turn it on again
    • If the NAS recognizes the disks as a mirror and automatically mounts them, stop here and don't continue.
    • Hopefully the NAS will still be in Separate Disk mode and will not automatically mount the data partitions. It should show both disks as present but not in use. Use the web interface to format the first disk but not the second disk!
    • Log in through SSH, and from the SSH prompt, use the mdadm command to manually mount the second disk as broken mirror. Then (still on the SSH prompt) copy everything from the second disk to the first.
    • After you verify that everything has been copied, use the web GUI to format the second disk in Separate Disk mode.

    Another way if you don't have a Linux PC is to download the rescue CD from the www.partimage.org website. If you boot a PC with this, you should be able to use PartEd to convert the data from the XFS or ext2 raid partition on one disk to another type of partition on the other disk.

    Once again, I will not take responsibility, whether you follow these instructions or not. The proper way is to copy the data off via the network (or possibly via a USB-connected hard disk), change the configuration and copy the data back. Whether you cheat or not by using one of the methods above, you can always lose data for a number of reasons. Make backups!

  4. alejandro_liu

    alejandro_liu Addicted to LI Member

    Have you tried changing the partition type from FD (RAID auto detect) to 83 (Linux native)?

    You can mount RAID1 partitions directly (without using MDADM). This is how you can boot from a MD1 partition.

    This is possible because the MD superblock is at the end of the partition. That means that the filesystem code would look at the underlying partition of an RAID1 MD as a filesystem that is not using the full block device.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice