How to install new drive as RAID1?

151 views
Skip to first unread message

chq...@gmail.com

unread,
May 22, 2013, 12:04:07 PM5/22/13
to al...@googlegroups.com
Hi, Joao,
I have read previous posts but my situation is a little bit different, so  I post it here.
My story:
I have a RAID1 DNS previously using firmware 1.10. One drive died and I switched to ALT-F0.1RC3 and sent the failed drive to factory.
Today the drive comes back, HOW can I add it back in?

DNS 323 , Hitachi 2* 2TB (one current in use, one just come back brand new).
Currently the box has two orange leds.

Also,  my current old drive has ran 2+ years, I think the brand new drive may has less chance to fail again. So is there necessary for me to set the new drive as "primary" drive for the RAID1? If yes, then do I put the new drive in the left or right Bay of the box?

I notice you have provided the following instruction for the person with TWO drives need to be replaced, but I only need to install one, and I think it is different and don't want to take the risk to do it directly.

You will be using the right bay for swapping disks and will not turn power down.
0-System->Utilities->Services->StopAll
1-Disk->Utilities->Eject right bay. This will turn the new RAID into degraded state, but usable
2-Physically remove the right disk without turning power down -- this is hot-plugging
3-With the power still on insert the good disk from the old RAID in the right bay. It should be assembled in degraded mode and ready for use
4-Setup->Folders to examine the contents and copy the data from the old to new RAID. This is going to take a while, possibly hours. Your session will probably expire, keep waiting until there is no disk led activity for a while (this is an issue of the Folders copy/move operation when the operation take a very long time to accomplish)
5-Disk->Utilities->Eject right bay
5-Physically remove the right disk and re-insert the new one
6-Go to the RAID page and "Component Operations", "Partition", select the new disk partition, then "Component Operations", "Operation", "Add". A lengthily resync will start, but you can start using the RAID
 
My status page currently as:
Alt-F 0.1RC3 Status Page help
System
Temperature
38.0°C/100.4°F
Fan speed
0
Load
0.00
CPU
10%
Swap
0.0/517MB
Name: DNS323Device: DNS-323 rev-B1Mode: Flashed
Date: Wed May 22 03:59:59 EDT 2013Uptime: 0 day(s) 0 hour(s)
Network
Speed: 100Mbps Duplex: full MTU: 1500 TX: 18.5KiB Rx: 8.7KiB IP: 192.168.0.11
Disks
BayDev.ModelCapacityPower StatusTempHealth
leftsdaHitachi HDS5C3020ALA6322000.4 GBactive or idle35°C/95°Fpassed
RAID
Dev.CapacityLevelStateStatusActionDoneETA
md01861.0 GBraid1cleandegradedidle
Mounted Filesystems
Dev.LabelCapacityAvailableFSModeDirtyAutomatic FSCK in
md01.8TB
1.2TB
ext4RW28 mounts or 172 days
sda4484.3MB
396.8MB
ext4RW24 mounts or 172 days



João Cardoso

unread,
May 22, 2013, 4:27:00 PM5/22/13
to al...@googlegroups.com


On Wednesday, May 22, 2013 5:04:07 PM UTC+1, chq...@gmail.com wrote:
Hi, Joao,
I have read previous posts but my situation is a little bit different, so  I post it here.
My story:
I have a RAID1 DNS previously using firmware 1.10. One drive died and I switched to ALT-F0.1RC3 and sent the failed drive to factory.
Today the drive comes back, HOW can I add it back in?

Nobody likes to play with other's people data.

Assuming that the new disk has the same or a greater capacity than the old one:

0-Backup your data first
1-System->Utilities->Services->StopAll
2-Go to the Status page and write down in a paper the box bay where the old disk is. In your case it is in the left bay. Write it down!
3-Power off the box, insert the new empty disk in the available bay and power the box on,
OR
3-just plug-in the new empty disk in the available bay even with power of.
4-Go to the Status page and write down in the paper the device name of each disk (under the Dev. column of the Disks section)
  Currently in your case the old disk is on the left bay and the device name is "sda". But that *CAN* change after the new disk is inserted!
  *Probably*  your new disk in the right bay will be called "sdb". *BUT* it might not! This is why your should write it down!
5-Go to Disk->Partitioner and in the "Select the disk you want to partition" section, select the row of the old disk, and under "Partition Table", select "CopyTo" and select the new disk name.
  Make sure that the device name that appear is really the device name of the new disk. This operation will make all data available in the CopyTo disk to become inaccessible.
6-After a few seconds the operation should succeed and the Disk Partitioner page redraws and you will have two disks with identical partition tables.
 Verify that by selecting the appropriate disk in the upper Partition column.
  Write down the device name of the partition marked as RAID(*) of the new disk (under the "Dev" column of the "Partition xxx disk, xxxGB, ..." section
  If the new disk device name is "sdb" probably it will be "sdb2" or sdb3, but it *might* not!
 (*) D-Link doesn't mark RAID partitions with the RAID type, instead it will be the larger partition marked as "linux"
7-Go to Disk->Raid and under the "RAID Maintenance" section, "Component Operations",
 -select the device name of the new disk partition in the Partition menu, "sdb2" in the *example* above.
 -select "add" in the Operation menu.
8-The RAID should now automatically start rebuilding and its progress can be monitored in the Status Page.
 It might take several hours to finish, as all data from the old disk will be copied to the new disk, but the data will be available.

In short, you will copy the old disk partition table to the new disk and add the new disk RAID partition to the RAID array. That's it!
Amazing how that occupies about 20 lines of text!
 
Any issue?
Please report back any difficulties, misunderstandings, clarifications or deviations from what I said above, so I will update the Wiki with known-to-work instructions.


DNS 323 , Hitachi 2* 2TB (one current in use, one just come back brand new).
Currently the box has two orange leds.

Also,  my current old drive has ran 2+ years, I think the brand new drive may has less chance to fail again. So is there necessary for me to set the new drive as "primary" drive for the RAID1? If yes, then do I put the new drive in the left or right Bay of the box?

There is no concept of primary or secondary disks in RAID, they all are equal.

chq...@gmail.com

unread,
May 22, 2013, 10:05:49 PM5/22/13
to al...@googlegroups.com
Hi, Joao,
Thank you for your response, I still have a little problem at the step6. Please see following: 


On Wednesday, May 22, 2013 4:27:00 PM UTC-4, João Cardoso wrote:


On Wednesday, May 22, 2013 5:04:07 PM UTC+1, chq...@gmail.com wrote:
Hi, Joao,
I have read previous posts but my situation is a little bit different, so  I post it here.
My story:
I have a RAID1 DNS previously using firmware 1.10. One drive died and I switched to ALT-F0.1RC3 and sent the failed drive to factory.
Today the drive comes back, HOW can I add it back in?

Nobody likes to play with other's people data.

Assuming that the new disk has the same or a greater capacity than the old one:

0-Backup your data first
1-System->Utilities->Services->StopAll
2-Go to the Status page and write down in a paper the box bay where the old disk is. In your case it is in the left bay. Write it down!

I have checked:  the left as "sda" here for the current drive
 
3-Power off the box, insert the new empty disk in the available bay and power the box on,
OR
3-just plug-in the new empty disk in the available bay even with power of.

I have powered if off and then insert new disk into the righ bay,
 
4-Go to the Status page and write down in the paper the device name of each disk (under the Dev. column of the Disks section)
  Currently in your case the old disk is on the left bay and the device name is "sda". But that *CAN* change after the new disk is inserted!
  *Probably*  your new disk in the right bay will be called "sdb". *BUT* it might not! This is why your should write it down!

You are right, it has changed: left --> sdb;   right  --> sda
 Disks
BayDev.ModelCapacityPower StatusTempHealth
right
sdaHitachi HDS5C3020ALA6322000.4 GBactive or idle35°C/95°Fpassed
leftsdb
Hitachi HDS5C3020ALA6322000.4 GBactive or idle
37°C/98.6°Fpassed

5-Go to Disk->Partitioner and in the "Select the disk you want to partition" section, select the row of the old disk, and under "Partition Table", select "CopyTo" and select the new disk name.
  Make sure that the device name that appear is really the device name of the new disk. This operation will make all data available in the CopyTo disk to become inaccessible.

 I have partition the right disk. here is the new table.
Partition right disk, 2000.4 GB, Hitachi HDS5C3020ALA632

Using MBR partitioning.

Every disk must have a swap partition as its first partition, 0.5GB is generally enough.

KeepDevStart sectorLenghtSize (GB)Type
sda1
sda2
sda3
sda4
Free:



6-After a few seconds the operation should succeed and the Disk Partitioner page redraws and you will have two disks with identical partition tables.
 Verify that by selecting the appropriate disk in the upper Partition column.
  Write down the device name of the partition marked as RAID(*) of the new disk (under the "Dev" column of the "Partition xxx disk, xxxGB, ..." section
  If the new disk device name is "sdb" probably it will be "sdb2" or sdb3, but it *might* not!
 (*) D-Link doesn't mark RAID partitions with the RAID type, instead it will be the larger partition marked as "linux"

sda2 is the RAID partition, labeled as "linux" here since it is comes from Firmware 1.10
 
7-Go to Disk->Raid and under the "RAID Maintenance" section, "Component Operations",
 -select the device name of the new disk partition in the Partition menu, "sdb2" in the *example* above.
 -select "add" in the Operation menu.

Problem is here!  I did not see the "sda2" in my case.
RAID Maintenance
Dev.CapacityLevelComponentsArrayRAID OperationsComponent Operations
md01861.0 GBraid1sdb2

the "Operation" droplist only has one choice: "sdb2",  but I think I should select "sda2", right???
 
I have saved the settings and reboot the box, nothing changes,
Please help me out. 

chq...@gmail.com

unread,
May 22, 2013, 10:23:36 PM5/22/13
to al...@googlegroups.com
 One more thing,
 I also notice the "sda2" and "sda4" are available under the filesystem.

Filesystems
Dev.SizeFSMntLabelMount OptionsFS OperationsNew FS Operations
md01.8TBext4*
sda21861.0GBnone
sda40.5GBnone
sdb4484.3MBext4*

But I read antoher post you said RAID before file system? Is is because the partition not been formatted thus not appear during "maintain RAID"?


No, you have not read the instructions. You have to create th RAID *before* 
putting a filesystem on it.A RAID is like a partition, is a *device*; devices 
need a filesystem on them to handle your data.
Steps:
1-create partitions, first must be of type swap, will not contail data.
2-create raid
3-create filesystem
in post:  [Alt-F] Re: Adding 2nd Drive to DNS-323 

João Cardoso

unread,
May 22, 2013, 11:35:40 PM5/22/13
to al...@googlegroups.com
OK, only partitions marked as type RAID will appear there, you have to change the second partition type to type RAID.
But D-Link has partitioned the drives out of order (notice that in the Disk Partitioner the sda2 start sector appears after the sda4 start sector), and Alt-F only supports "properly" made partitions.

You have two options. Choose the one you feel more comfortable with:

-ssh or telnet the box, login as the 'root' user, same password as the webUI, and type the following command (assuming that "sda" is the new disk!)
sfdisk -c /dev/sda 2 da
Now "sda2" will appear as one of the component partitions, and you can proceed.

OR

-In the Disk Partitioner, repartition the "sda" disk (assuming that it is the new disk) by unchecking all the "Keep" checkboxes and filling in

Dev  Size     Type
sda1 0.543    swap
sda2 1998.235 RAID
sda3 0.524    linux
sda4 0        empty

and hit the Partition button. Make sure you are partitioning the correct (new) disk!
Now "sda2" will appear as one of the component partitions, and you can proceed.

 
RAID Maintenance
Dev.CapacityLevelComponentsArrayRAID OperationsComponent Operations
md01861.0 GBraid1sdb2

the "Operation" droplist only has one choice: "sdb2",  but I think I should select "sda2", right???

Right
 
 
I have saved the settings and reboot the box, nothing changes,
Please help me out. 


8-The RAID should now automatically start rebuilding and its progress can be monitored in the Status Page.
 It might take several hours to finish, as all data from the old disk will be copied to the new disk, but the data will be available.

In short, you will copy the old disk partition table to the new disk and add the new disk RAID partition to the RAID array. That's it!
Amazing how that occupies about 20 lines of text!
 
Any issue?

Could the instructions be better? How? less detail? :-) 

chq...@gmail.com

unread,
May 23, 2013, 12:27:39 AM5/23/13
to al...@googlegroups.com
This is perfect, I have used the second method, since I am not familiar with Telnet; have no idea what is ssh..... sorry,
And now I have maintained the RAID1. the status page said it needs 220mins to finish.

feel so goooooooooooooood to see the two orange leds blinking there!!

Two minor things still need your suggestion:
1. what's "sda4" and "sdb4" for ? Can they be delete/merge to the large partition somehow?  Maybe the best way to use is set them as a JBOD ? Also there is still 1.1G space not located on each drive, is that been left for purpose?
2. I read some articles said that "RAID 1 is still safe in case one drive fails, there is chance that the other drive will copy the failed sectors and mess the data." what's your point? is that true? If yes, how can I avoid that?

Your instruction is perfect, I will give it a 5 star.  :)
You response is really quick too.
Actually I can smell that we are people of same kind on technology and ways to do things, only in different fields.

thank you so much for all the replies!



OK, only partitions marked as type RAID will appear there, you have to change the second partition type to type RAID.
But D-Link has partitioned the drives out of order (notice that in the Disk Partitioner the sda2 start sector appears after the sda4 start sector), and Alt-F only supports "properly" made partitions.

You have two options. Choose the one you feel more comfortable with:

-ssh or telnet the box, login as the 'root' user, same password as the webUI, and type the following command (assuming that "sda" is the new disk!)
sfdisk -c /dev/sda 2 da
Now "sda2" will appear as one of the component partitions, and you can proceed.

OR

-In the Disk Partitioner, repartition the "sda" disk (assuming that it is the new disk) by unchecking all the "Keep" checkboxes and filling in

Dev  Size     Type
sda1 0.543    swap
sda2 1998.235 RAID
sda3 0.524    linux
sda4 0        empty

and hit the Partition button. Make sure you are partitioning the correct (new) disk!
Now "sda2" will appear as one of the component partitions, and you can proceed.


João Cardoso

unread,
May 23, 2013, 10:23:41 AM5/23/13
to al...@googlegroups.com


On Thursday, May 23, 2013 5:27:39 AM UTC+1, chq...@gmail.com wrote:
This is perfect, I have used the second method, since I am not familiar with Telnet; have no idea what is ssh..... sorry,
And now I have maintained the RAID1. the status page said it needs 220mins to finish.

feel so goooooooooooooood to see the two orange leds blinking there!!

Two minor things still need your suggestion:
1. what's "sda4" and "sdb4" for ?

They are leftovers from D-Link disk formating.
 
Can they be delete/merge to the large partition somehow?

Only consecutive partitions can be merged, and RAID partitions must have the same size.
Anyhow it is always risky to play with a disk partition table that already contains data, so I advise to keep them as are.
You probably have/want to install packages, so use one of those small partition for that purpose. Those partitions appear under Disk->Filesystems (read the page online help), and you have to first create a filesystem on them for them to be able to contain any data. Your old disk sd?4 partition already has a filesystem on it.
 
 Maybe the best way to use is set them as a JBOD ? Also there is still 1.1G space not located on each drive, is that been left for purpose?

Leftovers from D-Link. They seem big, 1GB, but its only 0.05% of the total disk space...

You can merge the new disk free space with its sd?3 partition, (before putting any data or filesystem on it!, although it is possible to enlarge or shrink a filesystem), just uncheck the Keep button in the Disk Partitioner and increase the (last, sd?3) partition size so as the free space approaches 0; leave a small amount of free space, don't be to greedy.  
 
2. I read some articles said that "RAID 1 is still safe in case one drive fails, there is chance that the other drive will copy the failed sectors and mess the data." what's your point? is that true? If yes, how can I avoid that?

By definition a bad sector is one that can't be read, so it can't be copied to the other drive.
As soon as a bad sector appears, the RAID might go to the degraded state.

When a bad sector appears, while reading, the disk drive internally marks is for remapping to a good sector, and a write to the bad sector will deploy the remapping -- from now on, every access to the bad sector will be done for the remapped sector, at least while the remapping table is not full.

To guard against this, SMART tests should be regularly made and the produced report analysed to see if a tendency exists; SMART don't repair nor prevent disk failures, it only warns the user ahead of time that a tendency exists. Some detected errors are one-time, and most of the time not to worry, but that is another topic, better search on a SMART forum.
 

Your instruction is perfect, I will give it a 5 star.  :)
You response is really quick too.

Thanks, I will try to write the wiki as soon as possible.
Joao

chq...@gmail.com

unread,
May 25, 2013, 6:04:44 PM5/25/13
to al...@googlegroups.com
Hi, Joao,
One more related question to you:  In case I have single hard drive (standard) from firmware 1.10 rather than a degraded RAID1, HOW can I add the new disk and create a RAID1 without losing the data?
Here is my planned step: load the new drive, copy the partition table from the old disk, create a RAID by select two partitions from the two drives separately?

Also, you mentioned that many alt-f and ffp packages can communicate with their own ports , such 9091 for transmission, how can I view/set these ports?

Thanks,


Thanks, I will try to write the wiki as soon as possible.
Joao
 

João Cardoso

unread,
May 27, 2013, 2:00:03 PM5/27/13
to al...@googlegroups.com


On Saturday, May 25, 2013 11:04:44 PM UTC+1, chq...@gmail.com wrote:
Hi, Joao,
One more related question to you:  In case I have single hard drive (standard) from firmware 1.10 rather than a degraded RAID1, HOW can I add the new disk and create a RAID1 without losing the data?

There is a synthetic wiki that covers that
 
Here is my planned step: load the new drive, copy the partition table from the old disk, create a RAID by select two partitions from the two drives separately?

Also, you mentioned that many alt-f and ffp packages can communicate with their own ports , such 9091 for transmission, how can I view/set these ports?

It depends, in general on its configuration files under /etc, sometimes they are fixed, check the app homepage. Some are for internal usage.
After embeding the app web page, use the browser status line, or similar

couchpotato: 8083
couchpotato2: 8084
minidlna: 8200 ??
forked_daapd:3689
cups: 631
mediatomb: 50500
...
Reply all
Reply to author
Forward
0 new messages