• October 15, 2019, 05:10:38 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: Wrong drive being formatted when converting to RAID1?  (Read 4801 times)

wrlee

  • Level 2 Member
  • **
  • Posts: 29
Wrong drive being formatted when converting to RAID1?
« 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:
  • Removed old drives.
  • Installed new drive (in right bay, though I am not sure it matters).
  • Start up NAS and format new drive.
  • [possibly, optional] Restart the NAS to make sure that it "knows" the new drive's configuration.
  • Shutdown and insert one of the old RAID drives (into the left bay). Restart. The NAS will start with two single drives.
  • Copy data from old drive (Volume_2) to new drive (Volume_1) ... this can take days, unless you've set up the drive to log in with telnet or ssh, where you can use rsync or cp, directly.
  • Shutdown the NAS and remove the old RAID drive.  It is important to keep one of the two original drives safe until you are sure that the new configuration is stable.
  • Install the other new drive to be added to the NAS and restart the NAS.
  • [IMPORTANT: This step, described below, is the focus of this posting]
  • Open the NAS configuration web page and follow the prompts to create a RAID1 configuration, formatting the new drive, in the process. Make sure that the RAID is "rebuilt."

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...
  • Load the FFP utilities that allow command line access and include the important 'dd command. Do this before installing the new drive.
  • Install new drive and restart the NAS.
  • In the menu, skip any reformatting.
  • Log into the device with telnet or ssh, for example:
    telnet dns-323
  • The new drive should be on referenced by device name "/dev/sdb" verify this by checking the mount of the "good" drive at "/dev/sda"
    # mount
    rootfs on / type rootfs (rw)
    ...
    /dev/sda2 on /mnt/HD_a2 type ext2 (rw)
    ...
    # _
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...
« Last Edit: July 19, 2011, 02:21:12 PM by wrlee »
Logged

jamieburchell

  • Level 6 Member
  • *
  • Posts: 947
Re: Wrong drive being formatted when converting to RAID1?
« Reply #1 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?
Logged
If your little 323 is not working right,
You've racked your brains and been up all night
Take a deep breath and wipe away the sweat,
Login as web admin and try a factory reset!

dosborne

  • Level 5 Member
  • *****
  • Posts: 598
Re: Wrong drive being formatted when converting to RAID1?
« Reply #2 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).
Logged
3 x DNS-323 with 2 x 2TB WD Drives each for a total of 12 TB Storage and Backup. Running DLink Firmware v1.08 and Fonz Fun Plug (FFP) v0.5 for improved software support.

wrlee

  • Level 2 Member
  • **
  • Posts: 29
Re: Wrong drive being formatted when converting to RAID1?
« Reply #3 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.
« Last Edit: May 08, 2010, 09:22:10 PM by wrlee »
Logged

wrlee

  • Level 2 Member
  • **
  • Posts: 29
Re: Wrong drive being formatted when converting to RAID1?
« Reply #4 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.
Logged

wrlee

  • Level 2 Member
  • **
  • Posts: 29
Re: Wrong drive being formatted when converting to RAID1?
« Reply #5 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.
Logged

wrlee

  • Level 2 Member
  • **
  • Posts: 29
Re: Wrong drive being formatted when converting to RAID1?
« Reply #6 on: July 19, 2011, 02:21:44 PM »

*bump*
Logged