The 'advanced format' feature reduces overhead by using 4 kilobyte sectors instead of the traditional 512 byte sectors. The old format gave a format efficiency of 87%. Advanced Format results in a format efficiency of 96% which increases space by up to 11%. The 4k sector is slated to become the next standard for HDDs by 2014.

The 'advanced format' feature reduces overhead by using 4 kilobyte sectors instead of the traditional 512 byte sectors. The old format gave a format efficiency of 87%. Advanced Format results in a format efficiency of 96% which increases space by up to 11%. The 4k sector is slated to become the next standard for HDDs by 2014.

===More Detailed Explanation===

===More Detailed Explanation===

−

512-byte sector size standard is here for over 30 years and therefore lots of the code written for a Linux OS has 512 number hard coded in its source. The main idea in regards to the 4096 B size sectors is to increase the bit density on each track by reducing the number of gaps which hold Sync/DAM and ECC ( Error Correction Code ) information between each data sectors. Therefore, for 8 x 512 B sectors the track also holds 8 sector gaps.

+

The main idea behind using 4096-byte sectors is to increase the bit density on each track by reducing the number of gaps which hold Sync/DAM and ECC (Error Correction Code) information between data sectors. For eight 512-byte sectors, the track also holds eight sector gaps.

−

By having one single sector of size 4096 B (8 x 512 B) the track holds only 1 sector gap for each data sector thus reducing an overhead for a need to support multiple Sync/DAM and ECC blocks and at the same time increasing bit density.

+

By having one single sector of size 4096-byte (8 x 512-byte), the track holds only 1 sector gap for each data sector thus reducing an overhead for a need to support multiple Sync/DAM and ECC blocks and at the same time increasing bit density.

−

Linux partitioning tools by default start each partition on sector 63 which leads to a bad performance in HDDs that use this 4k sector size due to misalignment to 4K sector from the beginning of the track.

+

Linux partitioning tools by default start each partition on sector 63 which leads to a bad performance in HDDs that use this 4K sector size due to misalignment to 4K sector from the beginning of the track.

===External Links===

===External Links===

Line 16:

Line 16:

==Current HDD Models that Employ a 4k Sectors==

==Current HDD Models that Employ a 4k Sectors==

−

As of July/2010, there are a limited number of HDDs that support "Advanced Format" or 4k sectors as shown below:

+

As of June 2011, there are a limited number of HDDs that support "Advanced Format" or 4k sectors as shown below.

−

{| border="1" cellpadding="5"

+

All drives in this list have a physical sector size of 4096 bytes, but not all drives correctly report this to the OS. The actual value reported (via new fields in the ATA-8 spec) is shown in the table as the physical reported sector size. As this is the value partitioning tools use for alignment, it is important that it should be 4096 to avoid misalignment issues.

−

! Manufacturer !! Model !! Capacity

+

+

The logical sector size is the sector size used for data transfer. This value multiplied by the number of LBA sectors on the disk gives the disk capacity. Thus a disk with 4096 byte logical sectors will have a lower maximum LBA for the same capacity compared to a drive with 512 byte sectors. Drives with 512 byte logical sectors offer better compatibility with legacy operating systems (roughly those released before 2009) however drives with 4096 byte logical sectors may offer marginally better performance (e.g. more read/write requests may fit into the NCQ buffer.)

Note that both works even for USB-attached discs (if the USB bridge supports SAT aka SCSI/ATA Translation, ANSI INCITS 431-2007).

==Aligning Partitions==

==Aligning Partitions==

−

===Check your partitions alignement===

+

+

{{Note|This should no longer require manual intervention. Any tools using recent libblkid versions are capable of handling Advanced Format automatically.}}

+

+

Versions with this support include:

+

+

* fdisk, since util-linux >= 2.15. You should start with ‘-c -u’ to disable DOS compatibility and use sectors instead of cylinders.

+

* parted, since parted >= 2.1.

+

* mdadm, since util-linux >= 2.15

+

* lvm2, since util-linux >= 2.15

+

* mkfs.{ext,xfs,gfs2,ocfs2} all support libblkid directly.

+

+

Refer to [https://www.tolaris.com/2011/07/21/libblkid-or-why-you-dont-need-to-worry-about-4k-disk-format/ this page] for further information.

+

+

===Check your partitions alignment===

+

{{Note|This only works with [[MBR]], not [[GPT]].}}

# fdisk -lu /dev/sda

# fdisk -lu /dev/sda

...

...

Line 105:

Line 124:

===MBR (Not Recommended)===

===MBR (Not Recommended)===

−

One can employ fdisk to align partitions to sector 2048 which will ensure that the partitions are aligned to the 4k sector. Interestingly, in sector mode, the default starting point is not 63 or 64 but 2048 in the current version of fdisk (2.17.2) so it's automatically taking care of the 4k sector size!

+

One can employ fdisk to align partitions to sector 2048 which will ensure that the partitions are aligned to the 4k sector. Interestingly, in sector mode, the default starting point is not 63 or 64 but 2048 in the current version of fdisk (2.17.2) so it is automatically taking care of the 4k sector size!

# fdisk -c -u /dev/sda

# fdisk -c -u /dev/sda

Line 111:

Line 130:

==Special Consideration for WD Green HDDs==

==Special Consideration for WD Green HDDs==

−

FYI - this section has nothing to do with Advanced Format technology, but this is an appropriate location to share it with users. The WD20EARS (and other sizes include 1.0 and 1.5 TB driver in the series) will attempt to park the read heads once every 8 seconds FOR THE LIFE OF THE HDD which is just horrible! Use hdparm in {{Filename|/etc/rc.local}} to disable this 'feature' and likely add life to your hdd:

+

FYI - this section has nothing to do with Advanced Format technology, but this is an appropriate location to share it with users. The WD20EARS (and other sizes include 1.0 and 1.5 TB driver in the series) will attempt to park the read heads once every 8 seconds FOR THE LIFE OF THE HDD which is just horrible! To see if you are affected use the smartctl command (part of smartmontools). If the last column changes rapidly, this section applies to your drive.

+

# smartctl /dev/sdb -a | grep '^193'

+

193 Load_Cycle_Count 0x0032 001 001 000 Old_age Always - 597115

+

+

=== Disable via hdparm ===

+

Use hdparm in {{ic|/etc/systemd/system/lcc_fix.service}} to disable this 'feature' and likely add life to your hdd:

+

+

{{hc|/etc/systemd/system/lcc_fix.service |<nowiki>

+

[Unit]

+

Description=WDIDLE3

+

+

[Service]

+

Type=oneshot

+

ExecStart=/sbin/hdparm -J 300 --please-destroy-my-drive /dev/sdX

+

TimeoutSec=0

+

StandardInput=tty

+

RemainAfterExit=yes

+

+

[Install]

+

WantedBy=multi-user.target

+

</nowiki>}}

+

+

Start the service

+

# systemctl start lcc_fix.service

+

+

Enable the service to autorun at boot.

+

# systemctl enable lcc_fix.service

+

+

==== Is this safe? ====

+

Why do we need to pass the "--please-destroy-my-drive" flag? Here is an email from hdparm author, Mark Lord:

+

+

> I have a Western DIgital \"Green\" drive (wd20ears). I noticed you added a -J switch and that

+

> it is said to adjust the idle3 timeout. What frightens me is the output you gave it:

+

>

+

> How safe or not is this to use?

+

+

I use it on my own drives. It works for me.

+

+

If you can run the WDIDLE3.EXE MS-Dos program,

+

then use it instead -- it was written by WD,

+

and only they know how things really work there.

+

+

If you cannot use the WDIDLE3.EXE, then you

+

could consider "hdparm -J". It works for me,

+

but it may or may not void some kind of warranty.

+

+

Cheers

+

--

+

Mark Lord

+

Real-Time Remedies Inc.

+

mlord@pobox.com

+

+

=== Disable atime ===

+

+

Be sure to disable atime by adding the "noatime" or "relatime" (default since kernel 2.6.30) option to each mount in [[fstab]]. Without this flag every file access will force a write to disk waking it up.

+

+

=== Disable via changing firmware value (persistent) ===

+

+

{{Warning|The tool used in this process is experimental, use at your own risk!}}

+

+

{{Note|This method is persistant, you only need to do this once for every drive.}}

+

+

This method will use a utility called idle3ctl to alter the firmware value for the idle3 timer on WD hard drives (similar to wdidle3.exe from WD). The advantage compared to the official utility is you do not need to create a DOS bootdisk first to change the idle3 timer value. Additionally idle3ctl might also work over USB-to-S-ATA bridges (in some cases).

or set it to a different value (''0''-''255'') with (e.g. 10 seconds):

+

+

$ sudo ./idle3ctl -s 100 /dev/your_wd_hd

+

+

The range ''0''-''128'' is in 0.1s and ''129-255'' in 30s. For the chages to take effect, the drive needs to go through one powercycle, meaning powering it off and on again (on internal drives, a reboot is not sufficient).

+

+

If your WD hard drive is not recognized, you can use the ''--force'' option. For more options see:

−

# echo "hdparm -S 242 /dev/sdX" > /etc/rc.local

+

$ ./idle3ctl -h

−

Alternatively, the following bash script can accomplish this automatically:

Introduction

The 'advanced format' feature reduces overhead by using 4 kilobyte sectors instead of the traditional 512 byte sectors. The old format gave a format efficiency of 87%. Advanced Format results in a format efficiency of 96% which increases space by up to 11%. The 4k sector is slated to become the next standard for HDDs by 2014.

More Detailed Explanation

The main idea behind using 4096-byte sectors is to increase the bit density on each track by reducing the number of gaps which hold Sync/DAM and ECC (Error Correction Code) information between data sectors. For eight 512-byte sectors, the track also holds eight sector gaps.

By having one single sector of size 4096-byte (8 x 512-byte), the track holds only 1 sector gap for each data sector thus reducing an overhead for a need to support multiple Sync/DAM and ECC blocks and at the same time increasing bit density.

Linux partitioning tools by default start each partition on sector 63 which leads to a bad performance in HDDs that use this 4K sector size due to misalignment to 4K sector from the beginning of the track.

External Links

Failure to align one's HDD results in poor read/write performance. See this article for specific examples.

Current HDD Models that Employ a 4k Sectors

As of June 2011, there are a limited number of HDDs that support "Advanced Format" or 4k sectors as shown below.

All drives in this list have a physical sector size of 4096 bytes, but not all drives correctly report this to the OS. The actual value reported (via new fields in the ATA-8 spec) is shown in the table as the physical reported sector size. As this is the value partitioning tools use for alignment, it is important that it should be 4096 to avoid misalignment issues.

The logical sector size is the sector size used for data transfer. This value multiplied by the number of LBA sectors on the disk gives the disk capacity. Thus a disk with 4096 byte logical sectors will have a lower maximum LBA for the same capacity compared to a drive with 512 byte sectors. Drives with 512 byte logical sectors offer better compatibility with legacy operating systems (roughly those released before 2009) however drives with 4096 byte logical sectors may offer marginally better performance (e.g. more read/write requests may fit into the NCQ buffer.)

Check your partitions alignment

2048 (default since fdisk 2.17.2) means that your HDD is aligned correctly.
Any other value divisible by 8 is good as well.

GPT (Recommended)

When using GPT partition tables, one need only use gdisk to create partitions which are aligned by default. For an example, see SSD#Detailed_Usage_Example.

MBR (Not Recommended)

One can employ fdisk to align partitions to sector 2048 which will ensure that the partitions are aligned to the 4k sector. Interestingly, in sector mode, the default starting point is not 63 or 64 but 2048 in the current version of fdisk (2.17.2) so it is automatically taking care of the 4k sector size!

# fdisk -c -u /dev/sda

Special Consideration for WD Green HDDs

FYI - this section has nothing to do with Advanced Format technology, but this is an appropriate location to share it with users. The WD20EARS (and other sizes include 1.0 and 1.5 TB driver in the series) will attempt to park the read heads once every 8 seconds FOR THE LIFE OF THE HDD which is just horrible! To see if you are affected use the smartctl command (part of smartmontools). If the last column changes rapidly, this section applies to your drive.

Is this safe?

Why do we need to pass the "--please-destroy-my-drive" flag? Here is an email from hdparm author, Mark Lord:

> I have a Western DIgital \"Green\" drive (wd20ears). I noticed you added a -J switch and that
> it is said to adjust the idle3 timeout. What frightens me is the output you gave it:
>
> How safe or not is this to use?
I use it on my own drives. It works for me.
If you can run the WDIDLE3.EXE MS-Dos program,
then use it instead -- it was written by WD,
and only they know how things really work there.
If you cannot use the WDIDLE3.EXE, then you
could consider "hdparm -J". It works for me,
but it may or may not void some kind of warranty.
Cheers
--
Mark Lord
Real-Time Remedies Inc.
mlord@pobox.com

Disable atime

Be sure to disable atime by adding the "noatime" or "relatime" (default since kernel 2.6.30) option to each mount in fstab. Without this flag every file access will force a write to disk waking it up.

Disable via changing firmware value (persistent)

Warning: The tool used in this process is experimental, use at your own risk!

Note: This method is persistant, you only need to do this once for every drive.

This method will use a utility called idle3ctl to alter the firmware value for the idle3 timer on WD hard drives (similar to wdidle3.exe from WD). The advantage compared to the official utility is you do not need to create a DOS bootdisk first to change the idle3 timer value. Additionally idle3ctl might also work over USB-to-S-ATA bridges (in some cases).
Download idle3ctl, extract and compile it.
Within the folder that contains the newly compiled binary, execute

$ sudo ./idle3ctl -g /dev/your_wd_hdd

to get the raw idle3 timer value.
You can disable the Intellipark feature completely, with:

$ sudo ./idle3ctl -d /dev/your_wd_hdd

or set it to a different value (0-255) with (e.g. 10 seconds):

$ sudo ./idle3ctl -s 100 /dev/your_wd_hd

The range 0-128 is in 0.1s and 129-255 in 30s. For the chages to take effect, the drive needs to go through one powercycle, meaning powering it off and on again (on internal drives, a reboot is not sufficient).

If your WD hard drive is not recognized, you can use the --force option. For more options see: