You are not logged in.

#1 2011-03-17 12:56:49

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

4K alignment - how to verify?

Hi!

I have HDD with 4K sector size. I have found reports partitions must be "4K-aligned". During AL installation I used, of course, whole (integer) numbers of MB during partitioning the hard drive. EXT4 fs-es are in use. Does it all guarantee 4K alignment? Hot to check/verify?

Last edited by student975 (2011-03-17 12:57:10)


"I exist" is the best myth I know..

Offline

#2 2011-03-17 13:09:51

lives2evil
Member
From: GMT+7
Registered: 2010-03-21
Posts: 244

Re: 4K alignment - how to verify?


tsujeruplive, tnarongisi... ... ... ... ɥsılƃuǝ sı sıɥʇ

Offline

#3 2011-03-17 13:43:34

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: 4K alignment - how to verify?

Sorry, have not found myself. Thanks!

So I have not-aligned /dev/sda2 (ind it is a /):

$ sudo fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      996029      497983+  83  Linux
/dev/sda2          996030  1836936359   917970165   83  Linux
/dev/sda3      1836936360  1944363014    53713327+  83  Linux
/dev/sda4      1944363015  1953520064     4578525   82  Linux swap / Solaris

996030 / 8 = 124503.75 - isn't an integer.

Does it mean I must reinstall the whole system to cure the problem?


"I exist" is the best myth I know..

Offline

#4 2011-03-17 14:33:49

lives2evil
Member
From: GMT+7
Registered: 2010-03-21
Posts: 244

Re: 4K alignment - how to verify?

Well, it's not a must be done thing. You don't have to reinstall your whole system.
I'm not very sure but I think you can use some partitioning tool to fix it.
Or just leave it be. It doesn't do you any harm anyway.
-------
It seems the best way to achieve this is using fdisk (MBR) but then you will have to reformat the entire disk.

# fdisk -c -u /dev/sda

As for GPT it's aligned by default

Last edited by lives2evil (2011-03-17 15:03:36)


tsujeruplive, tnarongisi... ... ... ... ɥsılƃuǝ sı sıɥʇ

Offline

#5 2011-03-17 18:42:21

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: 4K alignment - how to verify?

lives2evil wrote:

I'm not very sure but I think you can use some partitioning tool to fix it.

You see, it is rather difficult to decide to use this or that tool without at least few successful stories smile

lives2evil wrote:

Or just leave it be. It doesn't do you any harm anyway.

It seems to be the most probable variant now...


"I exist" is the best myth I know..

Offline

#6 2011-03-17 20:25:37

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: 4K alignment - how to verify?

Just leaving it won't do any great harm, but it will defeat the purpose of having an Advanced Format drive, leaving you with more inaccessible space and no performance boost.  It might also lead to increased rates of fragmentation, since the chance of breaking data up along sectors is greater, thus slowing your drive down with time.  There is software that can realign your partitions properly, but I haven't used any myself; try searching around for it.  When I set mine up, I just used Gparted from a LiveCD, which automatically aligns the partitions to sector 2048 for you.  You might just be able to use it to move partitions.  This would be time-consuming (mostly waiting), but solve the issue.

Offline

#7 2011-03-17 20:45:27

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: 4K alignment - how to verify?

ANOKNUSA wrote:

Just leaving it won't do any great harm, but it will defeat the purpose of having an Advanced Format drive, leaving you with more inaccessible space and no performance boost.  It might also lead to increased rates of fragmentation, since the chance of breaking data up along sectors is greater, thus slowing your drive down with time.  There is software that can realign your partitions properly, but I haven't used any myself; try searching around for it.  When I set mine up, I just used Gparted from a LiveCD, which automatically aligns the partitions to sector 2048 for you.  You might just be able to use it to move partitions.  This would be time-consuming (mostly waiting), but solve the issue.

Do you mean gparted has kept all your data intact during aligning?


"I exist" is the best myth I know..

Offline

#8 2011-03-18 12:40:24

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: 4K alignment - how to verify?

Yes, you can use gparted to move your partitions around without loss of data. At least I've done it with NTFS partitions... I don't think gparted would allow moving a partition if it wasn't safe. It's a good idea to backup your data anyway wink.

Offline

#9 2011-03-18 14:05:33

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: 4K alignment - how to verify?

Thanks to all!

I'm replying from AL on repartitioned HDD. gparted was used. All is OK. Moving (to align) and resizing (from 900GB to 200GB) a partition takes ~5 hours.

HDD speed is really higher now. On some operations and without any exaggeration almost 2 times.


"I exist" is the best myth I know..

Offline

#10 2011-03-18 15:05:43

bangkok_manouel
Member
From: indicates a starting point
Registered: 2005-02-07
Posts: 1,556

Re: 4K alignment - how to verify?

sorry for the hijack but is there any way to check if a disk does support this feature or not?

Offline

#11 2011-03-18 15:38:48

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: 4K alignment - how to verify?

bangkok_manouel wrote:

sorry for the hijack but is there any way to check if a disk does support this feature or not?

I understand it this way. Big sectors' size  isn't a feature. It is manufacturers attempt to make hdd cheap (less disk space is used for gaps between sectors). Even being aligned such hdd - say, WD EARS series - is less productive on some circumstances than real 512 bytes per sector one - say WD EADS series. And aligning is just a step to prevent making performance worse than it can be.

Look at (in Russian, so pictures at least) here: http://www.fcenter.ru/online.shtml?arti … /hdd/28121


"I exist" is the best myth I know..

Offline

#12 2011-03-18 15:41:09

bangkok_manouel
Member
From: indicates a starting point
Registered: 2005-02-07
Posts: 1,556

Re: 4K alignment - how to verify?

thanks a lot !

Offline

#13 2011-03-18 21:16:54

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: 4K alignment - how to verify?

Actually,  the purpose is to make formatting with current and upcoming filesystems more efficient while allowing for higher-capacity drives.  The amount of space left unavailable after formatting a disk is basically measured as a ratio: regardless of how large a drive is, one utilizing 512-byte sectors can only have (I believe) roughly 86% of its space available to the user after formatting.  With hard disk drives becoming larger and cheaper all the time, that left-over 14% can amount to dozens of gigabytes of unusable space.  Increasing sector size allows for more data to be stored in a readable area: 4k-sector drives can now use 90-odd per cent of their full capacity, and I think the larger sectors allow for greater i/o efficiency too.

Offline

#14 2011-03-19 05:58:23

skodabenz
Banned
From: Tamilnadu, India
Registered: 2010-04-11
Posts: 382

Re: 4K alignment - how to verify?

http://www.ibm.com/developerworks/linux … tor-disks/ written by GPT fdisk author.

Last edited by skodabenz (2011-03-19 06:37:40)


My new forum user/nick name is "the.ridikulus.rat" .

Offline

#15 2011-03-19 06:23:10

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: 4K alignment - how to verify?

skodabenz, thanks for the ref!


"I exist" is the best myth I know..

Offline

Board footer

Powered by FluxBB