Please check on the link for any new version.

http://forums.dlink.com/index.php?topic=11631.0

This is a workaround solution that might help you that bought the

WDXXEARS HDD (Normally come with 64Mb Cache)

The Drive is on Advanced Format which is because it have a physical 4K sector and emulator as 512K Sector. Problem that you might face is that constant pause between read and write and also awful read write speed.

I do recommend that you install this in a whole new configuration without any old HDD  just in case if it wipe out the 3rd HDD like me. (That happen if the old hdd wasn’t there and we manually add it later :( )

Preparation:

1 x DNS-343

2 x WDXXEARS HDD (1.5T or 2.0T)

1 x ramdrive funplug telnet        http://wiki.dns323.info/_media/howto:utelnetd-ram.tar.gz

1 x telnet tools (from windows)

Steps:

1. Getting ready

Please install the 2 x HDD to the DNS-343/DNS-323

Power up the Device and format the 2 x HDD as RAID 1. (Please choose manually Re-Build)

That will take like 1~2 hours dependent on the size of your HDD.

Reboot when done.

2. Getting telnet on DNS-343/323

We have to install minimal funplug which would enable the telnet and copy fdisk to the ramdrive.

You can get this version and skip all below. http://wiki.dns323.info/_media/howto:utelnetd-ram.tar.gz 

Telnte daemon

Doanload --> http://wiki.dns323.info/howto:telnet and download utelnet-kit.tar.gz.

We are unable to full funplug telnet/ssh we must use the minimal because we would have to umount the drive at some point. So if you have the full funplug install, please remove it or replace them.

fdisk

Download --> http://forum.dsmg600.info/attachment.php?item=393 

We are also unable the build in fdisk, it would have caused a segment fault somehow.

I’ve no idea why, maybe that was the design to avoid us to get things dirty.

fdisk library

Download  --> http://forum.dsmg600.info/attachment.php?item=574

These are the missing library on the fdisk program above.

Extract all files under the root of volume_1 on the DNS-343

And you should have the followings files:

/fdisk

/ffp/lib/ld-uClibc.so.0

/ffp/lib/libc.so.0

/fun_plug

/lnx_bin/utelnetd

/lnx_bin/busybox3

/starttelnet.sh

Let us make some changes on the starttelnet.sh

#!/bin/sh

# improved starttelnet.sh, enabling the filesystems to be unmounted and checked, if need be.

# copy the provided components to a directory on the ramdisk

# the ramdisk is regenerated with every boot, so the copy has no lasting effects at all

# simply copy the files over

cp /mnt/HD_a2/lnx_bin/utelnetd /sbin/utelnetd

cp /mnt/HD_a2/ffp /ffp

cp /mnt/HD_a2/fdisk /tmp/fdisk

# and start the Telnet service from the ramdisk as well

/sbin/utelnetd -l /bin/sh -d

This will copy all needed files to the ramdrive.

Now reboot your DNS-343 and check if for “dmesg.out” under volume_1 which tell you that the funplug is running correctly.

 

3. Telnet to DNS-343 and collect info

Now start your telnet and access to your DNS-343.

You will see the following prompt.

stdin, stdout, etderr: 0 1 2

BusyBox v1.00-pre1 (2009.05.04-09:03+0000) Built-in shell (ash)

Enter 'help' for a list of built-in commands.

Where is the “#

Please type in 5784468

And you will get the prompt “#” (Please remember the password you will need it quite often during this)

  1. Getting detail raid info

Now we already have the prompt.

What we need to do is to have a few information of the current raid device configuration. Please copy them down in any text format.

# mdadm -detail /dev/md0

/dev/md0:

        Version : 00.90.03

  Creation Time : Wed May  5 07:54:55 2010

     Raid Level : raid1

     Array Size : 1462766336 (1395.00 GiB 1497.87 GB)

    Device Size : 1462766336 (1395.00 GiB 1497.87 GB)

   Raid Devices : 2

  Total Devices : 2

Preferred Minor : 0

    Persistence : Superblock is persistent

    Update Time : Thu May  6 23:54:21 2010

          State : clean

 Active Devices : 2

Working Devices : 2

 Failed Devices : 0

  Spare Devices : 0

           UUID : 819f051b:2dd25e97:3317e8f5:328dab09

         Events : 0.2

    Number   Major   Minor   RaidDevice State

       0       8        2        0      active sync   /dev/sda2

       1       8       18        1      active sync   /dev/sdb2

Actually this already have all the information we need. which includes:

  1. Physical Size        1395.00 GiB 1497.87 GB
  2. UUID        819f051b:2dd25e97:3317e8f5:328dab09
  3. Drive Config        /dev/sda2, /dev/sdb2

Some more info, just to double verify

# mdadm -Es

ARRAY /dev/md0 level=raid1 num-devices=2 UUID=819f051b:2dd25e97:3317e8f5:328dab09

UUID should be the same

# cat /proc/mdstat

Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4]

md0 : active raid1 sda2[0] sdb2[1]

      1462766336 blocks [2/2] [UU]

Array Size should be the same

# cat /mnt/HD_b4/raidtab2web

status,1

filesystem,ext3

nonraid,null,null,null,null

md0,raid1,1395,1,sda2,sdb2,null,null,ext3

md1,null,null,null,null,null,null,null,null

md2,null,null,null,null,null,null,null,null

md3,null,null,null,null,null,null,null,null

Array Size should be the same and so does the drive arrrangement.

# cat /mnt/HD_b4/mdadm.conf

ARRAY /dev/md0 level=raid1 num-devices=2 UUID=819f051b:2dd25e97:3317e8f5:328dab09

UUID should be the same

  1. Getting Disk info

We also need to get some disk information using fdisk

# /tmp/fdisk -lu

Disk /dev/sda: 1500.3 GB, 1500301910016 bytes

255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors

Units = sectors of 1 * 512 = 512 bytes

Disk identifier: 0x5c25e06f

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1              63     1060289      530113+  82  Linux swap / Solaris

/dev/sda2         3164805  2928697694  1462766445   83  Linux

/dev/sda4         1060290     3164804     1052257+  83  Linux

Partition table entries are not in disk order

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes

255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors

Units = sectors of 1 * 512 = 512 bytes

Disk identifier: 0x5c25e06e

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1              63     1060289      530113+  82  Linux swap / Solaris

/dev/sdb2         3164805  2928697694  1462766445   83  Linux

/dev/sdb4         1060290     3164804     1052257+  83  Linux

Partition table entries are not in disk order

Please take note on the highlight value that are the value that our change based on

We have to do some calculation here, as you might know to proper align the disk the start sector have to be a value that can be fully divided by 8. So we will take the closest possible.

63        --> 64

3164805        --> 3164808

4. Repartition HDD to re-alignment  

We will repartition the HDD creating new raid and include this new info to the system drive on the next few steps.

  1. Stop the SMB and raid progress

We will stop SMB process and also stop the raid.

Also we will stop the swap on both HDD

# smb stop

$Shutting down SMB services:

$Shutting down NMB services:

# raidstop md0

mdadm: stopped /dev/md0

# cat /proc/mdstat

Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4]

unused devices: <none>

Double confirm that md0 is gone.

# swapoff /dev/sda1

# swapoff /dev/sdb1

  1. Re-Partition the Disks

Warning, once you have started on this Step you will not be able interrupted the progress without ending up have to reformat the HDD again from the web admin. That including power failure and etc. You have been warn.

You will need to do this step twice for both /dev/sda & /dev/sdb

# ./fdisk -u /dev/sda

The number of cylinders for this disk is set to 182401.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): d

Partition number (1-4): 1

Command (m for help): d

Partition number (1-4): 2

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First sector (63-2930277167, default 63): 64 <- Realignment of the swap partation

Last sector, +sectors or +size{K,M,G} (64-1060289, default 1060289):

Using default value 1060289

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 2

First sector (63-2930277167, default 63): 3164808 <- Realignment of the Data partation

Last sector, +sectors or +size{K,M,G} (3164808-2930277167, default 2930277167): +1498GB

**I’ve been trying to keyin sector value but it don’t seem to get the right value but using size seem to be ok, so we input the phisical size (GB) that we get from the raid detail.**

Command (m for help): p

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes

255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors

Units = sectors of 1 * 512 = 512 bytes

Disk identifier: 0x5c25e06e

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1              64     1060289      530113   83  Linux

/dev/sdb2         3164808  2928946058  1462890625+  83  Linux

/dev/sdb4         1060290     3164804     1052257+  83  Linux

Partition table entries are not in disk order

Command (m for help): t

Partition number (1-4): 1

Hex code (type L to list codes): 82

Changed system type of partition 1 to 82 (Linux swap / Solaris)

Command (m for help): p

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes

255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors

Units = sectors of 1 * 512 = 512 bytes

Disk identifier: 0x5c25e06e

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1              64     1060289      530113   82  Linux swap / Solaris

/dev/sdb2         3164808  2928946058  1462890625+  83  Linux

/dev/sdb4         1060290     3164804     1052257+  83  Linux

Partition table entries are not in disk order

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

#

Please do the same for /dev/sdb

Let check the result

# ./fdisk -ul

Disk /dev/sda: 1500.3 GB, 1500301910016 bytes

255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors

Units = sectors of 1 * 512 = 512 bytes

Disk identifier: 0x5c25e06f

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1              64     1060289      530113   82  Linux swap / Solaris

/dev/sda2         3164808  2928946058  1462890625+  83  Linux

/dev/sda4         1060290     3164804     1052257+  83  Linux

Partition table entries are not in disk order

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes

255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors

Units = sectors of 1 * 512 = 512 bytes

Disk identifier: 0x5c25e06e

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1              64     1060289      530113   82  Linux swap / Solaris

/dev/sdb2         3164808  2928946058  1462890625+  83  Linux

/dev/sdb4         1060290     3164804     1052257+  83  Linux

Both disk are now properly align.

  1. Remake swap and enable them

# mkswap /dev/sda1

Setting up swapspace version 1, size = 542830592 bytes

# mkswap /dev/sdb1

Setting up swapspace version 1, size = 542830592 bytes

# free

              total         used         free       shared      buffers

  Mem:       126844        59360        67484            0        25900

 Swap:            0            0            0

Total:       126844        59360        67484

# swapon /dev/sda1

# swapon /dev/sdb1

# free

              total         used         free       shared      buffers

  Mem:       126844        59792        67052            0        25908

 Swap:      1060208            0      1060208

Total:      1187052        59792      1127260

  1.  Re-create of raid

We will now have to re-create the raid, change the uuid and etc.

But before you mightt need to do a hd_verify to check if all hdd is mounted

# hd_verify

# mdadm --create /dev/md0 --level=1 --raid-devices=2 --spare-devices=0 /dev/sd[ab]2

mdadm: /dev/sdb2 appears to contain an ext2fs file system <--message might be vary

    size=1462766336K  mtime=Fri May  7 08:14:01 2010

mdadm: array /dev/md0 started.

#

# cat /proc/mdstat

# raidstart md0

# cat /proc/mdstat

Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4]

md0 : active raid1 sdb2[1] sda2[0]

      1462766336 blocks [2/2] [UU]

      [>....................]  resync =  0.0% (600064/1462766336) finish=487.3min speed=50005K/sec

     

unused devices: <none>

As long as the size of the array is same or bigger and it is re-sync then you are good to continue the next step. We can continue these steps without waiting for the re-sync to be complete but still we need to have the sync complete before we reboot.

Let us check the new raid detail.

# mdadm -Es

ARRAY /dev/md0 level=raid1 num-devices=2 UUID=9493aeb9:638621dc:7077d203:3af1c058

#mdadm --detail /dev/md0

/dev/md0:

        Version : 00.90.03

  Creation Time : Fri May  7 08:29:09 2010

     Raid Level : raid1

     Array Size : 1462766336 (1395.00 GiB 1497.87 GB)

    Device Size : 1462766336 (1395.00 GiB 1497.87 GB)

   Raid Devices : 2

  Total Devices : 2

Preferred Minor : 0

    Persistence : Superblock is persistent

    Update Time : Fri May  7 08:29:09 2010

          State : clean, resyncing

 Active Devices : 2

Working Devices : 2

 Failed Devices : 0

  Spare Devices : 0

 Rebuild Status : 0% complete

           UUID : 9493aeb9:638621dc:7077d203:3af1c058

         Events : 0.1

    Number   Major   Minor   RaidDevice State

       0       8        2        0      active sync   /dev/sda2

       1       8       18        1      active sync   /dev/sdb2

You might have noticed that there are not much changes other then the uuid and that is the most important things we are up to. Let replace the old uuid with this one.

 

# mdadm -Es > /mnt/HD_b4/mdadm.conf

# mdadm -Es > /mnt/HD_a4/mdadm.conf

# mdadm -Es > /etc/mdadm.conf

# cat /mnt/HD_b4/mdadm.conf

ARRAY /dev/md0 level=raid1 num-devices=2 UUID=9493aeb9:638621dc:7077d203:3af1c058

# cat /mnt/HD_a4/mdadm.conf

ARRAY /dev/md0 level=raid1 num-devices=2 UUID=9493aeb9:638621dc:7077d203:3af1c058

# write_hdverify

This command is a must to re-write the uuid.

  1. Reformat the new Raid

Now let reformat the new raid.

If the raid is still re-sync then this format might be slow. However it will still be ok.

# mke2fs -j -m 0 -T largefile4 /dev/md0

*** Device name for mke2fs: /dev/md0

mke2fs 1.41.2 (02-Oct-2008)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

357152 inodes, 365691584 blocks

0 blocks (0.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=0

11161 block groups

32768 blocks per group, 32768 fragments per group

32 inodes per group

Superblock backups stored on blocks:

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

        102400000, 214990848

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information:

done

This filesystem will be automatically checked every 32 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

exit status 0

success

Format success. We can continue to the next step.

  1. RAID Re-Sync Completed and Testing

For this step we will have to wait for the re-sync of the RAID to be fully complete.

The time take to re-sync the raid is vary for different HDD. For me it toke about 460 mins...

It is about 8 hours, so you will have to prey that nothing bad had happen during these time.

You can check it constantly with the following command

# cat /proc/mdstat

Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4]

md0 : active raid1 sdb2[1] sda2[0]

      1462766336 blocks [2/2] [UU]

      [>....................]  resync =  3.8% (56269248/1462766336) finish=478.1min speed=49020K/sec

When it is finished you will be able to see like

# cat /proc/mdstat

Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4]

md0 : active raid1 sdb2[1] sda2[0]

      1462766336 blocks [2/2] [UU]

Great we are now all set.

Let try to see if the raid are working fine. We will check using raidstar and raidstop

# raidstop md0

mdadm: stopped /dev/md0

# cat /proc/mdstat

Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4]

unused devices: <none>

# raidstart md0

Raid Table Parser version V1.14_04222009

Assemble the previously created Raid array.

/tmp/spare_dsk not exist!!!

mdadm: /dev/md0 has been started with 2 drives.

Raid Level Parser version v1.02

[: missing ]

Raid Table Parser version V1.14_04222009

Assemble the previously created Raid array.

/tmp/spare_dsk not exist!!!

mdadm: device /dev/md0 already active - cannot assemble it

mdadm: device /dev/md0 already active - cannot assemble it

Raid Level Parser version v1.02

# cat /proc/mdstat

Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4]

md0 : active raid1 sda2[0] sdb2[1]

      1462766336 blocks [2/2] [UU]

     

unused devices: <none>

#

# mdadm --detail /dev/md0

/dev/md0:

        Version : 00.90.03

  Creation Time : Fri May  7 08:29:09 2010

     Raid Level : raid1

     Array Size : 1462766336 (1395.00 GiB 1497.87 GB)

    Device Size : 1462766336 (1395.00 GiB 1497.87 GB)

   Raid Devices : 2

  Total Devices : 2

Preferred Minor : 0

    Persistence : Superblock is persistent

    Update Time : Fri May  7 22:14:04 2010

          State : clean

 Active Devices : 2

Working Devices : 2

 Failed Devices : 0

  Spare Devices : 0

           UUID : 9493aeb9:638621dc:7077d203:3af1c058

         Events : 0.8

    Number   Major   Minor   RaidDevice State

       0       8        2        0      active sync   /dev/sda2

       1       8       18        1      active sync   /dev/sdb2

#

If you are able to use raidstart and raidstop command to start the drive without triggle a re-sync, you can now save to reboot the system to enjoy you new configuration.

I do found that after this reboot my system is asking me to do another re-sync after I do the re-sync everything seem to be normal and the speed is Great :)

Thank You

 

Last Modify: 13-May-2010