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-06-03 22:54:00

Opperpanter
Member
From: Eindhoven, Netherlands.
Registered: 2008-08-11
Posts: 89

HOWTO: Format your (WDxxEARS) hard drive with 4k clusters size

Hello,

Just like the the topic for the DNS-434 (http://dns323.kood.org/forum/viewtopic.php?id=5468),
I am trying to end up with a HOWTO on how to this for the DNS-323/CH3SNAS:

First I inserted the disk (secondary disk, left bay. Another primary disk is already running with funplug 0.5).

I let the firmware/web interface format it for me first:

The result is:

Code:

root@NAS:/ffp# fdisk2 -ul /dev/sdb

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

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63     1060289      530113+  82  Linux swap / Solaris
/dev/sda2         2088450  1953520064   975715807+  83  Linux
/dev/sda4         1060290     2088449      514080   83  Linux

Partition table entries are not in disk order

This should give me an idea of what (correctly aligned) partitions to create manually, and still have the firmware detect it as 'ok'.
(If you create the wrong partitions, the web interface will still tell you that you need to format your drive).

Secondly I used fdisk2 (see DNS-434 topic) to delete all partitions created by the firmware and recreate them manually.

Example for the first partition (the others are similar):

Code:

root@NAS:~# fdisk2 -u /dev/sdb

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): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First sector (63-2930277167, default 63): 64
Last sector, +sectors or +size{K,M,G} (64-1060295, default 1060295): 1060290

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Please note that the Id of the first partition is 82. You need to use the t option of fdisk2 to change it from the default 82. The other partitions just stay at 83.

Code:

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): 82

Now we have the following partition table, which matches the original one on partition names and sizes (start and end sectors differ because of the alignment).

I ended up with this (below is an example on how to create the partitions using fdisk2):

Code:

root@NAS:/ffp# fdisk2 -ul /dev/sdb

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

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              64     1060290      530113+  82  Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sdb2         2088456  2930277167  1464094356   83  Linux
/dev/sdb4         1060296     2088455      514080   83  Linux
Partition 4 does not end on cylinder boundary.

Now we have to create the filesystems on the partitions:

Code:

root@NAS:~# mkswap /dev/sdb1
Setting up swapspace version 1, size = 542832128 bytes

root@NAS:~# mke2fs /dev/sdb2
mke2fs 1.41.0 (10-Jul-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
91512832 inodes, 366023589 blocks
18301179 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
11171 block groups
32768 blocks per group, 32768 fragments per group
8192 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

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
root@NAS:~# mke2fs /dev/sdb4
mke2fs 1.41.0 (10-Jul-2008)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
128520 inodes, 514080 blocks
25704 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
63 block groups
8192 blocks per group, 8192 fragments per group
2040 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Now we mount the stuff

Code:

mkdir /mnt/HD_b2
mkdir /mnt/HD_b4
mount /dev/sdb2 /mnt/HD_b2
mount /dev/sdb4 /mnt/HD_b4

After this I was able to reboot the CH3SNAS and use the new disk.
The firmware/web interface reports status of the new disk correctly, and doesn't prompt to format the new disk.

Let me know how it works for you.

Last edited by Opperpanter (2010-06-03 23:02:16)


Attachments:
Attachment Icon fdisk2.bz2, Size: 87,790 bytes, Downloads: 355

Offline

 

#2 2010-06-03 23:03:26

Opperpanter
Member
From: Eindhoven, Netherlands.
Registered: 2008-08-11
Posts: 89

Re: HOWTO: Format your (WDxxEARS) hard drive with 4k clusters size

Just tried to use some different params for the main (sdb2) filesystem, and it still works:

Code:

mke2fs -m0 -T largefile4 /dev/sdb2

Offline

 

#3 2010-06-04 00:00:10

Opperpanter
Member
From: Eindhoven, Netherlands.
Registered: 2008-08-11
Posts: 89

Re: HOWTO: Format your (WDxxEARS) hard drive with 4k clusters size

BUT: Now how do I know whether the alignment is correct? The transfer rates will be limited by the CH3SNAS cpu/io controller.

I am getting 14.5MB/s for a 3GB iso file being copied (cp) from HD_a2 to HD_b2.

Best would be to setup a linux desktop box and attach the hard disk to that one to benchmark it?

Offline

 

#4 2010-06-04 07:36:33

congee
Member
Registered: 2010-06-02
Posts: 11

Re: HOWTO: Format your (WDxxEARS) hard drive with 4k clusters size

Whoa. I'm not very good at Linux so you'll have to slow down a bit.

1) You put one HD into the right slot, formatted it and installed fun_plug.
2) You copied FDISK2 to the drive in the right slot (does it matter where you save the file?)
3) You put a drive into the LEFT slot and then let the 323 format it as a second volume (non-RAID)
4) You then ran the commands listed above.

Is that right? Sorry, I'm not very good with Linux!!!!

Offline

 

#5 2010-06-04 09:01:42

oxygen
Member
Registered: 2008-03-01
Posts: 320
Website

Re: HOWTO: Format your (WDxxEARS) hard drive with 4k clusters size

Opperpanter wrote:

BUT: Now how do I know whether the alignment is correct? The transfer rates will be limited by the CH3SNAS cpu/io controller.

It is, you can tell from the fdisk output.

I am getting 14.5MB/s for a 3GB iso file being copied (cp) from HD_a2 to HD_b2.

Best would be to setup a linux desktop box and attach the hard disk to that one to benchmark it?

did you read my post? in the other thread

Offline

 

#6 2010-06-04 17:23:12

congee
Member
Registered: 2010-06-02
Posts: 11

Re: HOWTO: Format your (WDxxEARS) hard drive with 4k clusters size

I managed to get to the stage where I was starting to partition the disks using FDISK. However, FDISK came back with an error, saying that my drives use the GUID/GPT so that I have to use PARTED.

How do I copy PARTED to the Ramdisk?

According to the manual, I need a specific library to run PARTED. But what folder/directory do I put the library and the exe in?

http://www.gnu.org/software/parted/manual/parted.html

Offline

 

#7 2010-06-04 20:24:22

Opperpanter
Member
From: Eindhoven, Netherlands.
Registered: 2008-08-11
Posts: 89

Re: HOWTO: Format your (WDxxEARS) hard drive with 4k clusters size

congee wrote:

Whoa. I'm not very good at Linux so you'll have to slow down a bit.

1) You put one HD into the right slot, formatted it and installed fun_plug.
2) You copied FDISK2 to the drive in the right slot (does it matter where you save the file?)
3) You put a drive into the LEFT slot and then let the 323 format it as a second volume (non-RAID)
4) You then ran the commands listed above.

Is that right? Sorry, I'm not very good with Linux!!!!

That's about right. I did put the fdisk2 into /ffp/sbin so it was on the path rightaway.

Offline

 

#8 2010-06-04 20:26:14

Opperpanter
Member
From: Eindhoven, Netherlands.
Registered: 2008-08-11
Posts: 89

Re: HOWTO: Format your (WDxxEARS) hard drive with 4k clusters size

congee wrote:

I managed to get to the stage where I was starting to partition the disks using FDISK. However, FDISK came back with an error, saying that my drives use the GUID/GPT so that I have to use PARTED.

How do I copy PARTED to the Ramdisk?

According to the manual, I need a specific library to run PARTED. But what folder/directory do I put the library and the exe in?

http://www.gnu.org/software/parted/manual/parted.html

Hmm doesn't sound familiar. Did you use fdisk2 or fdisk? You could try to have fdisk2 create a new DOS partition table?

Code:

Command action
...
   o   create a new empty DOS partition table
....

Last edited by Opperpanter (2010-06-04 20:26:38)

Offline

 

#9 2010-06-04 20:28:58

Opperpanter
Member
From: Eindhoven, Netherlands.
Registered: 2008-08-11
Posts: 89

Re: HOWTO: Format your (WDxxEARS) hard drive with 4k clusters size

oxygen wrote:

did you read my post? in the other thread

what other thread/post? On transfers rates or on 4k clusters?

Offline

 

#10 2011-01-30 08:18:55

krackpot
Member
Registered: 2009-01-24
Posts: 44

Re: HOWTO: Format your (WDxxEARS) hard drive with 4k clusters size

Great guide. There is also a very similar guide over at the D-Link forums as well: http://forums.dlink.com/index.php?topic=14484.0


DNS-323 (B1) on Alt-F 0.1B7
2x2TB WD20EARS

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB