SSD Erase Block Size & Page Size alignment (Linux, ext4)

Yossarian22

[H]ard|Gawd
Joined
Apr 27, 2009
Messages
1,799
I recently purchased a Samsung 840 Pro 128GB for my Thinkpad X61s. This is the first time I've run a solid state drive and Linux at the same time.My Linux experience isn't as thorough as I would like it to be, but everyone has to learn and start somewhere, right?

Here is the relevant information about the Samsung 840 Pro 128GB drive:
Samsung 840 Pro 128GB
Controller: Samsung MDX (3x ARM Cortex R4s cores)
DRAM Cache: 256MB LPDDR2
NAND Type: 21nm 2bpc MLC NAND (4x 32GB Samsung NAND modules)
NAND Page Size: 8KB
NAND Erase Block Size: 1024KB
Pages per block: 128 (1024KB / 8 KB)
User Addressable Sectors: 250,069,680

Now, a NAND drive's most basic unit of data is called a page. Groups of pages belong in units which are known as blocks. Pages are for reading & writing and blocks are erased. So one example is if you overwrite data in a block, first that block is cached either on the SSD or in memory, the desired elements removed, and the entire block re-written (aka read-modify-write).

I'm having a problem correlating C-H-S style tools (fdisk, etc) with how I should partition.
I've read a lot of information about it (including blog posts from Ted Tso, maintainer of ext4).
From what I read, cylinder and head size doesn't matter as the kernel manages most of this stuff.

I've been reading this and also this, as well.

I'm just confused. Surely, the sectors (I believe this corresponds to LBA, which is good, since SSDs in particular are basically big old block devices) should be evenly divisible by the NAND Erase Block Size, but also shouldn't NAND Page Size (8KB in my case) be aligned with... something?

The problem is, from what I've been reading the past few days is that the C-H-S system doesn't actually work any longer, it is just there to placate older tools, however, I'm not sure if that is true.

Or what about changing inode size for the particular file system, ext4?
How will keeping journaling enabled affect alignment?
Or the default 5% reserved space for partitions?

I'm relatively new to Linux administration, I'm not an idiot, but I do have a lot of questions regarding this. :)

Thanks in advance.
 
Use

Code:
fdisk -c -u /dev/sdX

where /dev/sdX is the path to the device you want to partition.

The -c option tells fdisk to ditch DOS compatibility, this makes fdisk align partitions correctly by default (first partition will be on sector 2048)

The -u option tells fdisk to list sizes in sectors instead of by CHS geometry.

Then just partition the device as you want, makes sure to make the partition bootable if you want to boot from it.
 
Back
Top