How to tell if WD Advanced Format Technoloy is used?

Questions about SNMP, Power, System, Logs, disk, & RAID.
Post Reply
User avatar
beonas
New here
Posts: 2
Joined: Wed Apr 07, 2010 2:04 pm

How to tell if WD Advanced Format Technoloy is used?

Post by beonas »

Hello all,

Apparently quite some people were anticipating the FW 3.2.5 because of the support for WD's advanced format technology using 4k sectors. Same for me: I have two WD15EARS disks in a TS-219P.

Up to now I was using FW 3.2.4, but with a little knowledge in Linux and mdadm I had manually repartitioned the drives (using fdisk -H 224 -S 56 /dev/sda in my Linux machine and manually re-added them with mdadm) so the partitions should have been alingned to 4k sectors. 8)
Performance was around 20..25MB/s on SMB-write, IIRC. Not the world, but good enough for me.

This week I was upgrading to the FW 3.2.5 because of its native support for 4k alignment.
For a complete reinstall I have used the method of removing all disks on powering up, as described in the QNAP Wiki. It must have worked, since everything came up as expected. The new FW had also repartitioned the drives. Good.
:arrow: Writing with 12 MByte/s via SMB it seems way too slow.
On the NAS, top showd smbd to always consume <50% of the CPU.

What makes me worry:
Investigating the new partition layout, I was curious why it still uses the old 255 heads, 63 sectors/track geometry, which just calls for a misalignment of the partitions. Because 16065 sectors (255*63) is a quite inconvenient number of sectors per clinder, if we want to generate partitions with a beginning aligned to 4k (i.e. sector number divisible by 8 ).

Here's how FW 3.2.5 partitioned my WD drives, shown by sectors:

Code: Select all

[~] # fdisk -ul /dev/sda
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

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63     1060289      530113+  83  Linux
/dev/sda2         1060290     2120579      530145   82  Linux swap / Solaris
/dev/sda3         2120580  2929259969  1463569695   83  Linux
/dev/sda4      2929259970  2930255999      498015   83  Linux
If we take a look at the sector numbers in the Start column, we find that none of these is divisible by 8.
the partitions 3 (the actual data volume) seems to be 2k (4 sect) off the optimum alignment.
To my knowledge, adding the the md device (in RAID-1) does not shift the start of the actual filesystem, since the md-superblocks are stored at the end of each partition.

:!: This offset would lead to the performance degaration found by many.


Finally, here's the question(s):
:?: How did QNAP implement the support for 4k sectors?
:?: And how can I check if it is actually used correctly?

I'd appreciate If someone can enlighten me how to find this out...
Or support in testing where possible.

Thanks,
Flo
nitin_nm
New here
Posts: 8
Joined: Thu Feb 07, 2008 6:04 pm

Re: How to tell if WD Advanced Format Technoloy is used?

Post by nitin_nm »

*Bump*

I'm also interested in knowing the answer to this question, as my fdisk shows something similar to what beonas is seeing.

Can someone from qnap please respond?
pebu
First post
Posts: 1
Joined: Sat May 22, 2010 6:58 am

Re: How to tell if WD Advanced Format Technoloy is used?

Post by pebu »

*Bump*

Same questions. Same situation.
zerobyte
New here
Posts: 7
Joined: Sat May 22, 2010 8:55 pm

Re: How to tell if WD Advanced Format Technoloy is used?

Post by zerobyte »

*bump*
ink
Know my way around
Posts: 136
Joined: Mon Aug 03, 2009 7:08 pm
Location: London

Re: How to tell if WD Advanced Format Technoloy is used?

Post by ink »

QNAP implemented 4kb sector alignment by creating each partition on on a sector boundary divisible by 8.

You can check your partitions are thusly aligned using the following command :
Where n is the letter of the drive in question :

Code: Select all

# fdisk -ul /dev/sd{n}
Disk /dev/sdn: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot    Start       End          Blocks     Id   System
/dev/sdn1   *     8           1060289      530141     83   Linux
/dev/sdn2         1060296     2120579      530142     82   Linux swap / Solaris
/dev/sdn3         2120584     1952507969   975193693  83   Linux
/dev/sdn4         1952507976  1953503999   498012     83   Linux
If the 'Start' sector is divisible by 8 with no remainder, then your partitions are 4kb-sector-aligned.
As beonas correctly notes, his partitions are not aligned, after upgrading to f/w 3.2.5 or beyond (I believe), you will need to delete your RAID arrays and allow the NAS to recreate your partitions from scratch, or manually rebuild each disk in the array though this route is slightly more involved and not supported by QNAP.

NB (1): the C/H/S values shown by fdisk are used for presentation of only, you can't actually set these permanently.
NB (2): New versions of fdisk no longer align at sector 63 (dos compatability mode)by default.
TS-453S-Pro - 4* 2TB - RAID10(ish) [Devuan ZFS] 16GB RAM
ileader
New here
Posts: 3
Joined: Mon Nov 29, 2010 3:09 am

Re: How to tell if WD Advanced Format Technoloy is used?

Post by ileader »

Seems this is exactly the problem I have with performance. I'm in the process of doing a backup before recreating the partitions - but before I go down the recreation route, can anyone point me to instructions on how to "manually rebuild each disk in the array"? - I feel like trying that first.

Thanks,

Ian.
WalterJ
Starting out
Posts: 26
Joined: Wed Dec 29, 2010 3:52 am

Re: How to tell if WD Advanced Format Technoloy is used?

Post by WalterJ »

Hello.

I initialized six new HDDs on a TS-659 Pro running (at that time) firmware 3.3.4 and creating a unique RAID set.
I was well aware of the problem but, having read that QNAP statement about versions 3.2.x and above creating aligned partitions, I relieved myself.
I recently decided to double-check though, and discovered that the partitions inside the HDDs are far from being aligned at the 4kiB boundary (using identical 512 bytes/sector disks).
To be more precise /dev/sd?1 starts at sector #63 (which is 8^2, so begins well-aligned), but all the partitions have an odd number of blocks (thus not divisible by 8), which confirms that actually, just the first parition of each HDD is aligned.

How is that possible? Or am I doing the wrong math?
Is there a way to solve this?

Regards,
Walter
WalterJ
Starting out
Posts: 26
Joined: Wed Dec 29, 2010 3:52 am

Re: How to tell if WD Advanced Format Technoloy is used?

Post by WalterJ »

Ok, I read in fdisk manual that the start/end sectors shown in its output are 1-based, so none of the above partitions is aligned (partition sector #63 is actually the 63rd physical sector, not the 64th): they both start on a non-4kiB-aligned sector and their length is not divisible by 8 sectors (in fact, they all are odd-sectors large).
That partitioning, I insist, was at that time created with firmware 3.3.4.

This does not currently pose a real performance issue, since my Seagate HDDs actually have 512B physical sectors.
What happens when I will be migrating to 4K-sector HDDs ? How will their parititions be misaligned in order to match the old HDDs' alignment?
Post Reply

Return to “System & Disk Volume Management”