DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2010-05-09 07:24:38

wrlee
Member
Registered: 2008-02-23
Posts: 17

Wrong drive being formatted when converting to RAID1?

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. The easier solution is probably to configure and format both drives as RAID1 and attach the old drive with a cable and copy the files over--that won't be an option for those who are converting a single drive setup to RAID1, so those might want to follow these additional steps, unless my theory is proved wrong.

Bill...

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB