Recently, I bought a Samsung 850 Evo 500 GB SSD drive, as an upgrade to my Thinkpad X220. This post is yet another post of installing and aligning SSD partitions in ext4 filesystems. I have followed kargig's post on installing and aligning his SSD. This is simply a bunch of notes I kept during the procedure and not an explanatory post.
Before you start,
you must find the Erase Block Size and Page size of the SSD. With a couple of
searches in Google, I discovered that Samsung 850 EVO has the following
values:
Erase Block Size: 1536kb
Page size: 8kb
I followed the same formula that kargig used to align the partitions. In my case, I used heads=96 and sectors=32
The next step is to align the LVM accordingly.
Create a physical volume aligned to the Erase Block Size using the command
Then check the alignment of the physical volume:
The output of this command should be something like this
Note that the 1st PE starts from 1536k(1,50m), which is our goal here. Then proceed to create the VG and LVs you need:
To align the ext4 partition, you have to set the proper values on stripe-width and stride options. I followed this recipe. In a nutshell:
stride = Page size / Filesystem block
stripe-width = Erase Block / Filesystem block
Filesystem block is 4kB (or 4096 bytes), so stride = 8 kB/4 kB = 2 kB and stripe-width=1536 kB /4 kB = 384 kB.
We create the ext4 partition using this command:
The last step is to copy data from the HDD to the SSD and change /etc/fstab on the SSD