• October 27, 2020, 07:21:50 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: DNS-321 RAID-1 upgrade to 2TB x 2 without copying files across network  (Read 12149 times)

ypchen

  • Level 1 Member
  • *
  • Posts: 2

Several days ago, I successfully upgraded the two hard drives, configured as RAID-1, in my DNS-321 without copying files across network. I guess there may be others interested in knowing how to do it. So, I am posting the steps (probably incomplete, sorry) here. Please note that
  • I didn't write anything down when I did it, and so, I might miss one step or two here.
  • I don't provide a lot of reference information here for two reasons: (i) I am lazy; (ii) I don't want some one who does not know what he/she is doing to follow the instructions.
  • Of course, I am not responsible for anyone using these instructions on their DNS-321. Following these instructions at your own risk.

Ok, the steps are as follows:

0. You need a computer which is capable of attaching two extra SATA hard drives and capable of booting with KNOPPIX. I used KNOPPIX 6.0.1, but I think later versions should be better.

1. Make sure your DNS-321 is compatible with 2TB hard drives. My firmware version is 1.03. I don't know what's the minimum version which supports 2TB drives. I use two 2TB drives: (i) Seagate ST32000542AS; (ii) Hitachi HDS722020ALA330.

2. Have fun_plug installed. (In fact, it might not be necessary... I am not sure which utilities are from fun_plug.)

3. Make sure your RAID-1 is not under rebuilding or some situations that prevent your from trusting the data on only one drive.

4. Turn off your DNS-321.

5. Remove the one of two old hard drives that you like better and connect it to the computer.

6. Connect a new drive to the computer.

7. Boot the computer with KNOPPIX, open a console, and "su" yourself.

8. Use fdisk or parted to check the partitions of the old drive and duplicate the configuration on the new drive except for partition 2. Here is the partition configuration of my 2TB drive:

Command (m for help): p
Disk /dev/sdb: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xXXXXXXXX

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1          66      530113+  82  Linux swap / Solaris
/dev/sdb2             131      243201  1952467807+  83  Linux
/dev/sdb4              67         130      514080   83  Linux

Partition table entries are not in disk order

The sizes of /dev/sdb1 and /dev/sdb4 are identical to the old ones. The rest part goes to /dev/sdb2.

9. Format partition 1 as a swap partition and partition 4 as an ext3 file system.
(Don't just copy these instructions. Your new drive might not be sdb.)
Code: [Select]
mkswap /dev/sdb1
mke2fs -j /dev/sdb4

10. Load linux software raid module in KNOPPIX. I am not sure if linear, multipath, and raid0 are necessary or not. I just load them every time.
Code: [Select]
modprobe md
modprobe linear
modprobe multipath
modprobe raid0
modprobe raid1

11. Activate the old drive as a degraded array.
Code: [Select]
rm /etc/mdadm/mdadm.conf
mdadm --examine --scan >> /etc/mdadm/mdadm.conf
mdadm --assemble --scan

12. You should be able to see something like

Personalities : [linear] [raid0] [raid1]
md0 : active raid1 sda2[0]
      XXXXXXXXX blocks [1/2] [U_]

unused devices: <none>

with
Code: [Select]
cat /proc/mdstat

13. Copy the data by rebuilding the array. The process runs about 4 to 6 hours (if I remember correctly) on my machines. You can use "cat /proc/mdstat" to check whether the process finishes.
Code: [Select]
mdadm /dev/md0 --add /dev/sdb2

14. If everything goes well, after rebuilding, (softly) power off the computer, remove the old hard drive, connect the other new hard drive, and boot with KNOPPIX again.

15. Repeat steps 8 & 9 to create partitions and file systems on new drive no.2.

16. Repeat steps 10 & 11 to activate new drive no.1 as a degraded array.

17. Grow the array size to the maximum.
Code: [Select]
mdadm --grow /dev/md0 --size=max

18. Check the file system before resizing it.
Code: [Select]
e2fsck -f /dev/md0

19. Resize the file system to the maximum.
Code: [Select]
resize2fs /dev/md0

20. Check the file system again after resizing it.
Code: [Select]
e2fsck -f /dev/md0

21. Add new drive no.2 (assumed to be sda) to the array.
Code: [Select]
mdadm /dev/md0 --add /dev/sda2

22. Without waiting for the rebuilding process to finish, (softly) power off the computer, remove the two new hard drives, put them into your DNS-321. I am not sure if the position matters. I put new drive no.1 on the right slot and no.2 on the left slot.

23. Power on your DNS-321.

24. ssh into your DNS-321 and use
Code: [Select]
mdadm to check if the rebuilding process starts. If yes, then after 4 to 6 hours, your DNS-321 is ready for action.

I thought everything was ok at this time until I logged into the web management interface. The web interface asked me how I would like to configure my hard drives (individual, JBOD, raid0, and raid1), and luckily I could click "skip."

Then I realized that certain system information existed on /dev/sdX4 which were mounted at /mnt/HD_X4. Luckily again, I found a post by grazoulious: hd_verify -w and getting rid of "RebuildYour Harddrive" message (Thank you!! Actually some of my steps are also described in this post.)

25. So, I executed hd_verify
Code: [Select]
hd_verify -w

Finally, everything seems to run smoothly now.

P.S. I just realized that the whole thing may be done with only the DNS-321 box (i.e., without a computer and KNOPPIX) and that fun_plug is required for the ssh login.
« Last Edit: December 25, 2010, 06:59:45 AM by ypchen »
Logged

b-morgan

  • Level 1 Member
  • *
  • Posts: 1

Following up on your P.S., I'm wondering if this will work to upgrade from smaller to larger RAID-1...

1. Remove first smaller drive from DNS-321.

2. Insert first larger drive and let DNS-321 add it into the RAID-1 set.

3. Remove second smaller drive from DNS-321.

4. Using SSH to DNS-321, run your steps 17-20 to increase the size of the partition to fill the larger drive.

5. Insert second larger drive and let DNS-321 add it into the RAID-1 set.




Logged