4-KB partitions, why they're important, and how to make them

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
nicabod
Level 1
Level 1
Posts: 14
Joined: Sat Oct 29, 2011 1:44 am

4-KB partitions, why they're important, and how to make them

Post by nicabod » Mon Oct 31, 2011 3:25 am

4 KB partitions and where to find partitioners to make them

Postby nicabod on Sat Oct 29, 2011 6:44 am
Newbies and minimally-technical folk can probably ignore this, although it's not a bad idea to know about it. It was written more to make people aware, not as official procedure. On such important topics as partitioning, it's possible to do massive software destruction, but don't let that discourage you!

For quite a while, sectors on hard disks have been 512 bytes, but those are really too small, these days. 4 kB sectors are here; fairly sure no drive manufactured in 2011 has 512 B sectors. This topic isn't exactly new; Google refs. go back to 2009. IBM has quite a good reference:
<http://www.ibm.com/developerworks/linux ... tor-disks/>
As well, Google on [4KB sectors]. (I use [ and ] instead of saying "without quotes")

[Perhaps not strictly accurate; corrections welcome]: If you have a new HD, it's quite likely to have 4 KB sectors, and if you want it to work efficiently, your partitions must be set up so they start (and finish?) on boundaries that are multiples of 4 KB. If you don't do that, it's likely that two separate accesses (one revolution apart, afaik) might well be needed to write (and later, read) data that crosses ("straddles") a 4K boundary. This can degrade disk performance significantly.

Katya apparently runs GNU parted (partition editor); it's been installed in my Katya, iirc by default. That partition editor does create partitions on the proper boundaries. Its package is simply called "parted", although the description says it's GNU parted.

Apparently, many FOSS partitioners are not yet updated, but GNU parted (different from GParted) does respect and set up proper 4K boundaries, but, it seems to have a "gotcha" (ESOL: annoyance; problem). Apparently, it will not set up small partitions (such as 20 MB for /boot) on proper boundaries. It does, however, set up proper boundaries for big ones, such as 200 GB. Just what the minimum size it will set up properly is not told in the docs, afaik.

I do see that Synaptic lists "GNU parted" in the Mint repository simply as "parted"; you'll note the description. It's installed in my Katya.

However, if you want to partition a HD independently of Katya, GNU parted is also "buried" inside the excellent Parted Magic (v. 6.6) live CD (fits onto an 8 cm blank). (This is rather like a mini-Knoppix; has lots of little gems in it. It contains a usable, quite-decent Linux distro.) To find GNU parted,
start at the extreme lower left, where there's a "sectored" disk icon. Click, and select [System Tools] to start the path: --> Ghost 4 Linux --> [disclaimer/warning screen] (mouse works OK here) --> Utilities --> Parted. (You'll note an "Expert only" warning along the way. Partition editors can effectively wipe out your whole disk in a real hurry, and recovery can be difficult (and maybe costly)). Yrs trly, every few years, wipes out his OS; instead of a T-shirt that says "I void warranties", mine should say "I disable operating systems", with a footnote saying "Only my own".

HTH,
[n/b]
ESOL: English for Speakers of Other Languages
"Gotcha": Quickly-spoken slang -- "Got you!"
Temporary triumphal expression said when one has
the advantage in conflict; usually in fun.

steev
Level 1
Level 1
Posts: 26
Joined: Wed Mar 16, 2011 11:50 pm

Re: 4-KB partitions, why they're important, and how to make

Post by steev » Mon Oct 31, 2011 6:29 pm

gparted version 0.6+ automatically aligns partitions to MiB boundaries by default.
This should be fine for 4K sector disks, since 1 MiB is an even multiple of 4 KiB.

It's also good for SSDs and flash drives I think.

nicabod
Level 1
Level 1
Posts: 14
Joined: Sat Oct 29, 2011 1:44 am

Re: 4-KB partitions, why they're important, and how to make

Post by nicabod » Wed Nov 02, 2011 9:20 pm

Re: 4-KB partitions, why they're important, and how to make

New post by steev on Mon Oct 31, 2011 6:29 pm
gparted version 0.6+ automatically aligns partitions to MiB boundaries by default.
This should be fine for 4K sector disks, since 1 MiB is an even multiple of 4 KiB.

It's also good for SSDs and flash drives I think.
Steev, thanks! Good to know.

Any idea why I couldn't seem to create a 20-MB /boot partition? I don't recall well just what the warning (or error) message was, but it said that the partition I was trying to create wasn't aligned properly, and recommended start and end locations that were identical! IIrc, those locations were given in bytes, and were exactly 1 MiB. I really should try to reproduce, and file a bug report with GNU, but I don't have a lot of energy.

Best,
[n/b]

Post Reply

Return to “Tutorials”