D-Link Forums

The Graveyard - Products No Longer Supported => D-Link Storage => DNS-323 => Topic started by: wrlee on May 06, 2010, 04:26:37 PM

Title: Wrong drive being formatted when converting to RAID1?
Post by: wrlee on May 06, 2010, 04:26:37 PM
July 14, 2011, 11:04:00 AM— Okay, my original instructions, below, though perhaps interesting, did not exactly work. Re-tested with firmware 1.08, the most important thing when converting a drive from standard to RAID1 is that, after copying the data to the new drive, the drive with the data you want to preserve be in the LEFT bay (when looking from the drive-entry side, with the cover). No matter what I did to prep the drive (as described below), if that source drive is on the right, that is the one that is formatted! I do not know if the "zeroing-out" is even necessary.

July 19, 2011, 02:20:33 PM— Since I wrote the original post (below), it appears that, as of f/w 1.08, the method described may not work (as noted above). So this time, I put my new drive with the copied data on it in the left slot. Rebooted once to have it be recognized as the main drive. Then I put the new, zeroed drive into the right slot, rebooted, and formatted; this time the correct drive was formatted. I had turned off the auto-rebuild to keep that as a separate step. So it seems the 1.08 f/w will format the right drive when converting to RAID1, regardless of which drive has data.

When I rebooted after the format, there appeared to be no data on the volume and the share names were not accessible. I shutdown and checked the left (data) drive and it still had its data, so I think this is a weird conflict due to the raid array not having been rebuilt. In my attempt not to destroy the data again, I destroyed the data, so I was not able to finish this process. :-P Perhaps someone else can validate whether moving the data-filled drive to the left slot is sufficient.

Since I now have a SATA-->USB adapter, I reformatted the drives as a clean RAID1 configuration and am coping from the old drive to the array. I do not recommend this if you have a lot of data because this is VERY slow!


May 08, 2010, 09:18:35 PM— I have a theory about why the wrong drive is formatted when trying to convert a single drive setup to a RAID1 configuration (thereby losing all the data that you wanted to protect).

The normal steps that I went through as I upgraded my original RAID1 from 1TB drives to 1.5TB drives:

This is how it is supposed to work (without the "IMPORTANT" step). And for most(?) you this might be fine. I was one of the unlucky ones that had my data copy of the drive reformatted (if you are upgrading from a single drive to dual, without a backup, then you'd be in big trouble... perhaps the following will help).

My theory is that the NAS recognizes the addition of a new drive but may not recognize which drive is "new."  This might happen if the new drive is pre-formatted or the cursory check sees random data that it interprets to be formatted. If this is true, then we can take some steps to make sure that the NAS does not think that this is the case--i.e., make sure that the new drive absolutely recognized as "new."

So, the "IMPORTANT" steps follow:

To do this, you will need or access to a machine that you can plug the new drive into: Windows with cygwin installed, Linux, Mac, or the NAS with Fonz FFP utilities installed. The key is command line access to run the 'dd' command (there may be other ways to do it, but that was the easiest, for me).

If are using the NAS itself to perform these steps...
Regardless of whether you're using the NAS device, as just described, with the drive mounted and access to a command line, "zero out" the leading part of the drive. 1 MB should be sufficient. To do this run the 'dd' command as follows:
dd if=/dev/zero of=/dev/sdb count=2048
It is very important that the 'of=' spec is the correct setting for the drive, you can do SERIOUS damage to a device or it's data if it is not correct.

If the drive is not already installed in the NAS, install it.

Restart the NAS.

Now continue on with the steps in the configuration web page to create a RAID1, reformatting the new drive.

Though this was a bit complex, I hope this helps avoid any problems for anyone else.

Bill...
Title: Re: Wrong drive being formatted when converting to RAID1?
Post by: jamieburchell on May 07, 2010, 01:52:05 AM
Wouldn't it be safer (and easier) to install and format your two new disks together in RAID1 configuration and copy your data back from one of your old disks via a PC or USB enclosure?
Title: Re: Wrong drive being formatted when converting to RAID1?
Post by: dosborne on May 07, 2010, 06:20:20 PM
I picked up a second WD 1.5TB HDD today, popped it into the second drive bay, then followed the prompts and a few hours later it completed the Raid1 morroring without any loss of data or any real issues.

It did have me worried when it stalled at 98% complete on the formatting for a few minutes, but resumed without any issue.

It also had me worried with the text in the prompts saying all data would be erased when formatting, but all my data is fine.

The only thing that happend was the SMB shares seemed to get messed up. I had to reset the table and re-enter the shares (I only have 6 so it was easy).
Title: Re: Wrong drive being formatted when converting to RAID1?
Post by: wrlee on May 08, 2010, 08:40:04 PM
Wouldn't it be safer (and easier) to install and format your two new disks together in RAID1 configuration and copy your data back from one of your old disks via a PC or USB enclosure?
Yeah, probably  ;)  I didn't have a way to connect my SATA drive to the USB port, so I chose the software approach.

PS -- For those that are trying to convert a single drive to a dual RAID1 setup, they might still want to take the extra step(s), unless my theory is proved wrong.
Title: Re: Wrong drive being formatted when converting to RAID1?
Post by: wrlee on May 08, 2010, 08:43:12 PM
It also had me worried with the text in the prompts saying all data would be erased when formatting, but all my data is fine.
Yeah, for most people, I think it does work fine. It fine for me when I'd upgrade disks the first time, a couple of years ago... not this time.

Next time, I will take this extra step first. Or I will follow @jamieburchell's suggestion and get myself a SATA->USB cable or box.
Title: Re: Wrong drive being formatted when converting to RAID1?
Post by: wrlee on July 14, 2011, 11:05:07 AM
Added updated information at the top (so this entry is just to "bump" the topic to the top.
Title: Re: Wrong drive being formatted when converting to RAID1?
Post by: wrlee on July 19, 2011, 02:21:44 PM
*bump*