upgrading my dns-323 to 2 X 2 TB II - format
As explained in the first part, it makes far more sense to use 2 separate drives as opposed to JBOD, RAID 0 or RAID 1. However, if you are keen on using RAID, I included a guide at the end, courtesy of dmcwai.
In summary, I will be formatting the drives with the DNS-323 utility, install funplug, root it, install the functional fdisk, telnet into the box,
I followed this step-by-step procedure:
1. Label the drives, then install them; access the web interface and format. I had already upgraded to the latest firmware (1.08), but if you have not, consider doing so after format is complete.
2. Download and install funplug. Go to the URL in the image (also linked below, in sources), then download the latest fun-plug (i.e., the fun_plug and fun_plug.tgz files) and save them into the root of Volume_1 via the network share. Reboot your unit and if the install is successful, the .tgz file will have been exploded into the /ffp directory.
3. After making sure that the /ffp directory exists and the .tgz file has been deleted (signifying a successful install of funplug), telnet into the box. I prefer Putty; if you don’t, just press Windows Key + R and then type “telnet 192.168.x.y” then enter, replacing x and y with the appropriate numbers you can get from your router; or just use the name of the device instead of 192.. – in my case, dlinky.
After getting a prompt, set the root password then login as root:
/ # passwd
Changing password for root
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
New password:
Bad password: too simple.
Warning: weak password (enter it again to use it anyway).
New password:
Re-enter new password:
Password changed.
/ # login root
Password:
No mail.
root@dlinky:~#
I used something simple, as it is only temporary.
5. Download & install fdisk. The default fdisk will fail with a “segmentation fault”. Luckily, you can download a working version from the link below. It’s bzipped, so you’ll have to uncompress it to the root of Volume_1. I used 7zip on my desktop, but any archiver will do. Rename the existing fdisk by adding a .old extension, then move the new fdisk in the sbin directory and make it executable:
root@dlinky~# cd /mnt/HD_a2/ffp/sbin
root@dlinky:/mnt/HD_a2/ffp/sbin# mv fdisk fdisk.old
root@dlinky:/mnt/HD_a2/ffp/sbin# ls ../..
fdisk ffp ffp.log fun_plug
root@dlinky:/mnt/HD_a2/ffp/sbin# mv ../../fdisk .
root@dlinky:/mnt/HD_a2/ffp/sbin# chmod +x fdisk
6. Stop mess-around processes. I used /dev/sd?1 in the swapoff command, but I see no reason why it shouldn’t works just for b, as that’s the only one you’ll be using.
root@dlinky:/# smb stop
$Shutting down SMB services:
$Shutting down NMB services:
root@dlinky:/# nfs stop
-sh: nfs: not found
root@dlinky:/# swapoff /dev/sdb1
root@dlinky:/# umount -a
umount: can't umount /dev/pts: Device or resource busy
umount: can't umount /mnt/HD_a2: Device or resource busy
umount: can't umount /sys/crfs: Device or resource busy
umount: can't umount /: Device or resource busy
umount: can't umount /: Device or resource busy
7. You’re finally ready to fdisk it:
root@dlinky:/# fdisk -u /dev/sdb
The number of cylinders for this disk is set to 243201.
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): p
Disk /dev/sdb: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000Device Boot Start End Blocks Id System
/dev/sdb1 63 1060289 530113+ 82 Linux swap / Solaris
/dev/sdb2 2088450 3907024064 1952467807+ 83 Linux
/dev/sdb4 1060290 2088449 514080 83 LinuxPartition table entries are not in disk order
Command (m for help): d
Partition number (1-4): 1Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First sector (63-3907029167, default 63): 64
Last sector, +sectors or +size{K,M,G} (64-1060289, default 1060289):
Using default value 1060289Command (m for help): d
Partition number (1-4): 2Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First sector (63-3907029167, default 63): 3164808
Last sector, +sectors or +size{K,M,G} (3164808-3907029167, default 3907029167):
Using default value 3907029167Command (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: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000Device Boot Start End Blocks Id System
/dev/sdb1 64 1060289 530113 82 Linux swap / Solaris
/dev/sdb2 3164808 3907029167 1951932180 83 Linux
/dev/sdb4 1060290 2088449 514080 83 LinuxPartition 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.
Syncing disks.
8. Create the swap and turn it on. In my initial round, I turned all of them on (sd?1) because I had turned all of them off.
root@dlinky:/# mkswap /dev/sdb1
Setting up swapspace version 1, size = 542831616 bytes
root@dlinky:/# swapon /dev/sdb1
9. Format the partition with make2fs. This will take a while.
root@dlinky:/# mke2fs -j -m 0 -T largefile4 /dev/sdb2
mke2fs 1.41.0 (10-Jul-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
476576 inodes, 487983045 blocks
0 blocks (0.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
14893 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, 214990848Writing inode tables: 0/14893 ..
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
10. Make it permanent.
root@dlinky:/# hd_verify –w
hd verify v1.23.10072009
Force write verify to hd
11. Shutdown, swap discs among themselves, then reboot and repeat the whole procedure to properly 4k format the other disc as well. Make sure you reboot and test that both drives are formatted with the second partition starting on 64 and that they are writable.
12. I will now commence the copying of the data from my 2 TB array onto one or both drives. To do so, I will place the 2 RAID drives in the DNS-323 and the 2 x 2 TB will be mounted under Linux on my multiboot desktop, using Thermaltake Blacx docking station and / or a 5.25” Trayless SATA Hot Swap Drive Bay.
I don’t expect any problems in copying the data, but I will update this document if I encounter any. It turns out that copying the whole thing might take the whole day. I’m thinking to attach the 2TB monster to dlinky via USB and rsync the data using DNS-323.
Sources / More info: funplug-dl, funplug-howto, fdisk-forum, fdisk-download, dcmwai-raid-guide
Comments
-----------------------------
...
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
-----------------------------
I've read that this problem may be caused by "incorrect work of FDISK" and seen recommendation to use PARTED...
I am trying to connect just 1 WD 2TB HDD like yours into NAS-323, but almost gave up after few days of failed attempts...
Thnaks for your immediate reply. I've tried mentioned combinations but with no success. Still, thanks for pointing into the right direction!!
I believe the root of problem is in using SINGLE HDD. To be able to "detach" everything from HDD, telnet server should be loaded into memory (ramdrive).
I am now trying to use followign instruction now: http://docs.google.com/document/pub?id=1FIcG6ORtV9yqIK-4MLNgNLlQeHOb3Fxpu_OpLbd4Npg
Due to some reason I am not able to install Telnet into memory disk so will find additional temporary SATA drive.
It seems to me you have 3 choices:
1. Install into memory following that guide
2. Format the drive under linux on your computer (e.g., start linux with a live distro, without installing and work your magic there)
3. Attach a USB key to the NAS and install / run ffp from there. In the next article you will find a guide on how to accomplish that.
4. Use a spare in the NAS.
You're right, my guide works only for 2 disks, as that's what I had. If I were you, I would try to get ffp to boot from a USB key, as that will give you the most benefits - i.e., it is a good idea to be able to attach USB storage to the NAS, isn't it?
And all worked fine!!!
Thanks again for all support! Actually you did a job D-Link/WD should! (UP)
-
Respects,
Pavlo
As a customer, I'm angry at D-Link for their lack of support. OTOH, as someone who worked in IT, I know that before you support something potentially problematic, you want to ensure that you can answer any questions. Supporting something inadequately could cause bigger headaches than not supporting it at all.
The problem is that nobody knows (I certainly didn't) at purchase that there is an issue with 4k. In all fairness, this is more of a WD lack of disclosure problem - and adequately mentioning in marketing materials - than it is a D-Link problem. D-Link could have raised to the occasion and quickly supported it, like other manufacturers did (Netgear and Synology, from what I've heard).
Thanks for the info... I'm sort of there... I think. What kind of performance (Mb/s) should I be seeing? (ballpark figure..) Just want to make sure I don't have to redo this again once I've copied a few hundred Gb to the drive. :)
Thanks,
Michel
I just have one question:
Shoudn't the /dev/sdb2 start address be 2088456 (meaning no loss of 523MB???)
I've checked my current setup and the swap is from 1060290 to 208849 (for stand alone drives), which in the case of RAID or so it seems is from 1060290 to 3164804.
Your guide suggest the re-alignment start address for RAID setup swap sizes, but that actually leave 523Megs un-partitioned (although completely well aligned).
So I think as the end of the Swap partition is 208849 and the first 8 dividable sector number is 2088456 (and not 3164808) meaning all the space could be utilized.
Unfortunately I don't have the drives yet for testing but in my opinion those numbers would mean complete alignment and space utilization.
Respects,
A.G.G.
So as far as I know jumper 7-8 puts the drive in a "compatibility" mode for single partition...I was wondering if that should be done also at the time of the initial partitioning or not (kernel is 2.4 in the DNS, so pretty close by age to XP), BUT we have 3 partitions so overall no idea.
Referring back to the previous post in my opinion for FW 1.08 b09 and ffp5.0 the partition set-up should be:
Device: Start End Blocks Id System
/dev/sdb1 64 1060289 530113 82 Linux swap
/dev/sdb2 2088456 3907029167 1951932180 83 Linux
/dev/sdb4 1060296 2088449 514080 83 Linux
now that I think about it the proposed start address for the sdb4 is kinda wrong (proposed as 1060290, while and 8 dividable address is 1060296 so that might also cause inconsistency and possibly wrong system ID in other systems outside of the DNS...
So 2 things possibly in my opinion: jumper 7-8 setting and also modified start addresses for sdb2 and sdb4...I hope this will clear it out a bit and might help with slow transfer rates if the drive is in another system...
Have you tried using the settings you are proposing?
For grins, I installed the WD20EARS(formated by the DNS-321) into my Windows machine and ran the WD Align Software against it. I had to destroy the existing file systems so WD Align would work - but I got the info I wanted.
The following is what WD software considers "aligned". Yup, WD software started the first partition at sector 2048!
Device Boot Start End Blocks Id System
/dev/sda1 2048 1058815 530116 82 Linux swap / Solaris
/dev/sda2 2088960 3907029167 1952470356 83 Linux
/dev/sda4 1058816 2088959 514080 83 Linux
future, but I'm an old timer, I guess :)
I'll post a link here.
partition table, there is a difference between the "Start" value in the
first run and the "Start" value in the second. If you run it on yours and
you see the value in the second, you were successful.
the fdisk utility suggest the defaults and I accepted them by hitting Enter
:)
You are most likely right, though, thank you for pointing that out.
As I was stating in the previous comment, I nonetheless noticed a strange
occurrence: when I connect a drive via USB using Thermaltake's BlacX, fdisk
reports the first partition at 66. When installed back in the unit, it's
reported correctly. In any event, the rsync went painfully slow..
drives, I have to report a massive failure. Somehow, the partition boundary
changed to 66 and the write performance, as expected, plummeted to arount 4
MBps. This may have happened when I mounted the drives under linux on my PC
- I have no idea how. You might still be fine if you don't mount the drives
on other systems. Good luck!
tried swapoff, smb off and umount -a?
If yes, try "swapoff /dev/sd?1" instead of sdb1. What the error
message is saying is that the drives are in use by some processes that
are messing around with them. Before finalizing your work, you need to
stop these processes so that you can "save" your work with "hd_verify
-w"
1) If no prompt appears after entering 'login root' and it just sits with the busybox message, type 5784468 and hit enter. It should bring up the prompt.
2) I did not have some libraries installed for the fdisk linked. I had to grab them from http://forum.dsmg600.info/attachment.php?item=574 and move the 2 *.so.0 files to /ffp/lib before fdisk would properly function.
Completely new to this - would it be possible to format the WD drive in an external hard drive case (using some program) and then putting it into the DNS?
Cheers,
Jonas
vielen, vielen Dank für die wirklich sehr gute Anleitung und die Veröffentlichung hier. Funktioniert perfekt!
I'm also a "Oldtimer"
Best regards
provided, no need to compile or anything of that sort...
compiled without said libraries, especially when it has a smaller filesize
and it works? (the link is in the text)
I "landed" here because I am yet another "victim" with the same problem.
I found a good price on the WD20EARS and bought two with the intention to use them in my DNS-323. I did check the D-Link firmware page, first, and found that I had to upgrade from 1.06 to 1.09 (or at least 1.08) in order for a 2T drive to be recognized. I now regret I did not "dig" deeper, however D-Link should have put a warning on the DNS-323 page, a lot of people like myself are suffering today and could have been "saved".
Anyway, there was a rumor in mid February 2011 that D-Link would come out with an updated firmware (1.10 maybe?) solving this 4K issue. However, it is now late March and no new firmware has been posted.
I do not want to bother you with my self-pity, $180 spend for practically two (very nice) paper weights seemed a bit extravagant, but if you can please try to help me out:
1. Does anyone truly know if D-Link is actually and actively working on a new updated firmware that will solve this problem? Is there -even- a BETA firmware out, guys I am just desperate!
2. If a new firmware is not in sight, at least not in the near future, what is my best option in order to be able to use these drives in my NAS-323 as RAID-1? I am not interested in RAID-0 at all, so if RAID-1 is not possible, I would certainly entertain workarounds using either two independent drives, or JBOD, provided that the solution incorporates some kind of data duplication, within the DNS-323. It just does not make sense to have a NAS without some -even basic- form of redundancy or backup.
I sincerely thank you in advance for your response.
--
Dim Pan
Chicago, IL - USA.
2. There is a guide at the end of the article showing exactly how to do RAID1. However, as explained in my DNS-323 hacking guide, it makes more sense to use individiual drives (not RAID) and the use a nightly cron script to duplicate only data that is important to you among them.
Good luck!