You are not logged in.

#1 2013-12-22 16:58:46

b0b2
Member
Registered: 2011-10-31
Posts: 51

SSD+iSSD partitioning + alignment advice needed

Hi,
i bought a Asus UX32A and replaced the HDD with a Samsung 840 Evo 120gb. -> the netbook has a 24GB iSSD cache + 120GB SSD now
I'm about to install linux atm, but i don't know what to do with the iSSD and how to align.
The 840 EVo specs:
cylinders: 16383
head: 16
sectors: 63
sector size: 512 bytes
sector0 offset: 0
erase block size: 1536kb


4GB RAM

regards b0b

Offline

#2 2013-12-22 17:17:10

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: SSD+iSSD partitioning + alignment advice needed

Does it iSSD show up as its own device?  So you have sda and sdb?

Last edited by graysky (2013-12-22 17:19:57)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2013-12-22 17:24:09

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: SSD+iSSD partitioning + alignment advice needed

Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2013-12-22 17:39:31

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: SSD+iSSD partitioning + alignment advice needed

Both fdisk and gdisk default the first partition to sector 2048, which provide a properly aligned partition.  Unless you specify the exact sector to start/end subsequent partitions, they both should round to the closest aligned point.  If you just stick with partitioning in MBs or larger, then all should be fine (make the end sector +5000M, +5G, etc.).

Offline

#5 2013-12-22 17:40:31

b0b2
Member
Registered: 2011-10-31
Posts: 51

Re: SSD+iSSD partitioning + alignment advice needed

graysky wrote:

Does it iSSD show up as its own device?  So you have sda and sdb?

yes it does! smile

it's sdb
ATA device
Model Number: SanDisk SSD i100 24GB
.
.
.
.
TRIM supported (8 blocks)

Last edited by b0b2 (2013-12-22 17:44:18)

Offline

#6 2013-12-22 17:59:17

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: SSD+iSSD partitioning + alignment advice needed

OK.. so you have two SSDs.  Figure out which one is faster and put the system on that.  Or just put it on the smaller one.  You have many options.  Alignment is automatic with a modern util like gdisk or fdisk.

Last edited by graysky (2013-12-22 17:59:58)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#7 2013-12-22 20:37:15

b0b2
Member
Registered: 2011-10-31
Posts: 51

Re: SSD+iSSD partitioning + alignment advice needed

graysky wrote:

OK.. so you have two SSDs.  Figure out which one is faster and put the system on that.  Or just put it on the smaller one.  You have many options.  Alignment is automatic with a modern util like gdisk or fdisk.

ok the samsung was the faster one:

#hdparm -Tt /dev/sda
cached reads: 7434.62 MB/s
buffered disk reads: 489.95 MB/s

#hdparm -Tt /dev7sdb
cached reads: 7403.36 MB/s
buffered disk reads: 430.56 MB/s

Are the values ok?

my plan:

/dev/sda1	(bootloader)	2M	        BIOS boot partition
/dev/sda2	ext2	                128M	Boot partition
/dev/sda3	(swap)	        1536M      Swap partition
/dev/sda4	ext4	                Rest	        Root partition

what i did:

#gdisk
:x
:L
:6144
:m
:n
:1
:
:+2M
:ef00
:n
:2
:
:+128M
:
:n
:3
:
:+1536M
:8200
:n
:4
:
:234441614
:

btw: what's going on with all the dog avatars?

Offline

#8 2013-12-22 20:52:48

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: SSD+iSSD partitioning + alignment advice needed

Looks fine.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#9 2014-01-04 23:14:20

SimFox3
Member
From: San Jose, Ca
Registered: 2014-01-04
Posts: 42
Website

Re: SSD+iSSD partitioning + alignment advice needed

@b0b2 and others: I also recently purchased a Samsung 840 EVO but get much slower buffered than you. Do you think this is because of alignment issues or something else?

# sudo gdisk -l /dev/sda

GPT fdisk (gdisk) version 0.8.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 488397168 sectors, 232.9 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 604C1FFC-FC73-4017-8B89-311E961675F1
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 488397134
Partitions will be aligned on 2048-sector boundaries
Total free space is 215234861 sectors (102.6 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          534527   260.0 MiB   EF00 
   2          534528       105392127   50.0 GiB    8300  Arch_Linux
   3       105392128       273164287   80.0 GiB    8300  Home

And speed:

[root@Vaio-Saad queue]# hdparm -Tt /dev/sda

/dev/sda:
Timing cached reads:   21724 MB in  2.00 seconds = 10874.42 MB/sec
Timing buffered disk reads: 810 MB in  3.01 seconds = 269.47 MB/se

My laptop: Sony Vaio S15 (SVS1512DCXB)

Offline

#10 2014-02-23 05:38:08

rickyzhang
Member
Registered: 2014-02-23
Posts: 6

Re: SSD+iSSD partitioning + alignment advice needed

I'm not an SSD expert. But base on SSD partition alignment article I ever read, assuming 840 EVO erase block size (EBS) is 1536KB, neither your partition or the guy above your thread is aligned properly.

In general, you want the beginning of partition is the multiples of EBS. I got a Kingston V300 120 GB yesterday. But sequential read/write benchmark test is not as good as my raid0 spinning hard drive.

I'm going to buy a 840 EVO 120 GB, instead. I happened to find you guys discussion thread. BTW, can you do a benchmark test on yours (https://wiki.archlinux.org/index.php/SSD_Benchmarking) and post result?

Thanks in advance.

SimFox3 wrote:

@b0b2 and others: I also recently purchased a Samsung 840 EVO but get much slower buffered than you. Do you think this is because of alignment issues or something else?

# sudo gdisk -l /dev/sda

GPT fdisk (gdisk) version 0.8.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 488397168 sectors, 232.9 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 604C1FFC-FC73-4017-8B89-311E961675F1
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 488397134
Partitions will be aligned on 2048-sector boundaries
Total free space is 215234861 sectors (102.6 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          534527   260.0 MiB   EF00 
   2          534528       105392127   50.0 GiB    8300  Arch_Linux
   3       105392128       273164287   80.0 GiB    8300  Home

And speed:

[root@Vaio-Saad queue]# hdparm -Tt /dev/sda

/dev/sda:
Timing cached reads:   21724 MB in  2.00 seconds = 10874.42 MB/sec
Timing buffered disk reads: 810 MB in  3.01 seconds = 269.47 MB/se

My laptop: Sony Vaio S15 (SVS1512DCXB)

Offline

#11 2014-02-23 12:09:49

frostschutz
Member
Registered: 2013-11-15
Posts: 1,421

Re: SSD+iSSD partitioning + alignment advice needed

rickyzhang wrote:

I'm not an SSD expert. But base on SSD partition alignment article I ever read, assuming 840 EVO erase block size (EBS) is 1536KB, neither your partition or the guy above your thread is aligned properly.

What matters is the page/sector size. If your partitions are off by 512 byte then every single read access will have to read 2 pages/sectors where otherwise one would have been sufficient. That's what cuts your performance, the erase block size on the other hand does not matter all that much.

As for the post above yours, my guess would be that it's a SATA II system, but I didn't look up the specs...

Last edited by frostschutz (2014-02-23 12:10:29)

Offline

#12 2014-02-23 21:58:16

SimFox3
Member
From: San Jose, Ca
Registered: 2014-01-04
Posts: 42
Website

Re: SSD+iSSD partitioning + alignment advice needed

You are correct--Sony Vaio S15 only supports Sata 2, not Sata 3.

Offline

#13 2014-02-24 01:43:11

rickyzhang
Member
Registered: 2014-02-23
Posts: 6

Re: SSD+iSSD partitioning + alignment advice needed

@frostschutz

SSD read and write operation is on the page level, while erase operation is on the block level. Note that page can't be overwritten.

So when overwrite the contents in the page, it will read the page, modify the contents, write back to other free page and mark the current page as stale.

Stale page will recycled at some point time when garbage collections process starts. So if partition is not aligned with erase block size, the process will read two blocks for erasing, instead of one.

@SimFox3

Could you do a simple benchmark test on your box? I'm not sure if I should replace Kingston v300 with Samsung EVO.

Offline

#14 2014-02-24 03:09:50

SimFox3
Member
From: San Jose, Ca
Registered: 2014-01-04
Posts: 42
Website

Re: SSD+iSSD partitioning + alignment advice needed

[root@Vaio-Saad ~]# hdparm -Tt /dev/sda

/dev/sda:
Timing cached reads:   21450 MB in  2.00 seconds = 10737.07 MB/sec
Timing buffered disk reads: 614 MB in  3.00 seconds = 204.38 MB/sec
[root@Vaio-Saad ~]# hdparm -Tt /dev/sda

/dev/sda:
Timing cached reads:   20484 MB in  2.00 seconds = 10253.41 MB/sec
Timing buffered disk reads: 640 MB in  3.00 seconds = 213.02 MB/sec
[root@Vaio-Saad ~]#
[root@Vaio-Saad ~]#
[root@Vaio-Saad ~]# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.721643 s, 1.5 GB/s
[root@Vaio-Saad ~]# echo 3 > /proc/sys/vm/drop_caches
[root@Vaio-Saad ~]# dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.437642 s, 2.5 GB/s
[root@Vaio-Saad ~]# dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.197456 s, 5.4 GB/s

Note that my system only supports SATA II.

Last edited by SimFox3 (2014-02-24 03:10:36)

Offline

#15 2014-02-25 10:06:16

gedgon
Member
From: Poland
Registered: 2011-01-27
Posts: 95

Re: SSD+iSSD partitioning + alignment advice needed

rickyzhang wrote:

I'm not an SSD expert. But base on SSD partition alignment article I ever read, assuming 840 EVO erase block size (EBS) is 1536KB

Are you sure? According to AnandTech EVO uses 19nm Samsung NAND, so, correct me if i'm wrong, it's 2048K block size.

rickyzhang wrote:

I'm going to buy a 840 EVO 120 GB, instead. I happened to find you guys discussion thread. BTW, can you do a benchmark test on yours (https://wiki.archlinux.org/index.php/SSD_Benchmarking) and post result?

btrfs with LZO:

hdparm -Tt /dev/sda

/dev/sda:
 Timing cached reads:   23808 MB in  2.00 seconds = 11917.44 MB/sec
 Timing buffered disk reads: 1538 MB in  3.00 seconds = 512.28 MB/sec


$dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc
1024+0 records in
1024+0 records out
1073741824 bytes (1,1 GB) copied, 0,402241 s, 2,7 GB/s

#echo 3 > /proc/sys/vm/drop_caches
$dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1,1 GB) copied, 0,419891 s, 2,6 GB/s

$dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1,1 GB) copied, 0,144284 s, 7,4 GB/s

But still, I have mixed feelings about this SSD.

Last edited by gedgon (2014-02-25 11:24:07)

Offline

#16 2014-02-26 04:55:10

rickyzhang
Member
Registered: 2014-02-23
Posts: 6

Re: SSD+iSSD partitioning + alignment advice needed

I got 120GB samsung evo tonight. I made a call to 1-800-samsung tech support and confirmed the following:

page size: 8KiB
erase block size: 1536KiB

I used parted to do partition and rsync to restore my Fedora from Kingston SSD to Samsung. Hers is my partition note.

Step 1: 
Partition aligned by 6144KiB. It is multiple of EBS and 2MiB
use lvm + ext 4,
Over provisioning :10%

/boot: start 6144KiB size:498MiB   ends: 516096 KiB

LVM  : start 516096 size: 105904128KiB 100GB, ends: 106420224KiB

Rest of unallocated is  reserved for over-provisioning


lvm:

pvcreate --dataalignment 6144KiB /dev/sda

I can't set PE size as 6144KiB because it has to be the power of 2.

After using rsync to restore my Fedora 20 from Kingston, I ran the ARCH SSD benchmark test. I got the following result:

hdparm -Tt /dev/sda
/dev/sda:
Timing cached reads:   4588 MB in  1.99 seconds = 2299.87 MB/sec
Timing buffered disk reads: 808 MB in  3.01 seconds = 268.80 MB/sec

dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 4.82364 s, 223 MB/s

echo 3 > /proc/sys/vm/drop_caches
dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 3.8185 s, 281 MB/s

dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.496013 s, 2.2 GB/s

My Kingston SSD read can only reach 150MB/s. I have use dd to read a 300MB video file, Samsung reach 250MB/s while Kingston only 150MB/s

I count the booting time of Fedora between. They are almost the same around 26 to 27 seconds.

Performance of SSD will degrade over time due to erase nature. I'm reading on F2FS and see if it can help.

Last edited by rickyzhang (2014-02-26 05:02:49)

Offline

#17 2014-02-26 10:03:26

gedgon
Member
From: Poland
Registered: 2011-01-27
Posts: 95

Re: SSD+iSSD partitioning + alignment advice needed

rickyzhang wrote:

I got 120GB samsung evo tonight. I made a call to 1-800-samsung tech support and confirmed the following:

page size: 8KiB
erase block size: 1536KiB

Thanks!

Offline

#18 2014-02-26 13:43:44

rickyzhang
Member
Registered: 2014-02-23
Posts: 6

Re: SSD+iSSD partitioning + alignment advice needed

One more thing I want to add is that my testing box is t61laptop which supports SATA II 3Gbps only. So the read/write speed is theoretically throttled up to 300MB/s.

Offline

#19 2014-05-21 04:23:04

karamaz0v
Member
From: Argentina
Registered: 2012-07-18
Posts: 10

Re: SSD+iSSD partitioning + alignment advice needed

rickyzhang wrote:

I got 120GB samsung evo tonight. I made a call to 1-800-samsung tech support and confirmed the following:

page size: 8KiB
erase block size: 1536KiB


Hey, thanks also for providing another source confirming this information. It's a pity that this quite relevant info does not come clearly stated in SSDs label.

I just formatted my 120GB EVO following the recommended procedure given those specs. Since it's hooked on a SATA III interface I'd like to share my bench results.


# dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 2.38095 s, 451 MB/s

# echo 3 > /proc/sys/vm/drop_caches

# dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 1.99437 s, 538 MB/s

# dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.185479 s, 5.8 GB/s

# dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.163231 s, 6.6 GB/s

# dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.160889 s, 6.7 GB/s

# dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.161415 s, 6.7 GB/s

# dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.142236 s, 7.5 GB/s

# dd if=tempfile of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 0.170322 s, 6.3 GB/s

I'm amazed with the speed of this little thing.
I did the partitioning on it to setup a dual boot with Windows 7 on a UEFI system. In Windows I get basically the same read/write speeds with the Samsung Magician benchs.

I spent some time researching in forums in order to get the correct partitioning and alignment for both systems, I think it's worth to write a detailed how-to somewhere. I'll do it soon and update the post with a link, right now I'm struggling to get properly configured the rEFInd bootloader.

For the ones interested on the Linux side, I basically followed the steps I converged back in October to format a 250GB EVO.
I left them here for future reference http://pastebin.com/0Jvn3PyQ

That one is hooked in an old laptop with a SATA II interface. I get basically the same results with dd benchs as ricky.

Offline

#20 2014-10-18 08:19:48

Polyatomic
Member
Registered: 2014-05-31
Posts: 7

Re: SSD+iSSD partitioning + alignment advice needed

Sat Mar 18 04:07:23 UTC 2017

Last edited by Polyatomic (2017-03-18 04:08:42)

Offline

#21 2014-10-26 10:50:54

eriks
Member
Registered: 2013-06-11
Posts: 37

Re: SSD+iSSD partitioning + alignment advice needed

I've got the Samsung SSD 850 Pro, are there any known values for erase block size and page size for this model?

Offline

#22 2014-10-27 10:03:40

eriks
Member
Registered: 2013-06-11
Posts: 37

Re: SSD+iSSD partitioning + alignment advice needed

I asked Samsung support about the erase block size and page size values for the SSD 850 Pro but got the response from (german) support, that Samsung would not release them. Strange, I asked again, pointing out that they were released for the predecessors.

Someone got the erase block size values for the 840 EVO vs. 840 PRO, and according to this only the 840 EVO has the uncommon erase block size of 1536 KB.

Offline

#23 2014-11-04 18:01:28

eriks
Member
Registered: 2013-06-11
Posts: 37

Re: SSD+iSSD partitioning + alignment advice needed

Samsung Germany (that is the dutch company to which the support for germany is outsourced) refuses to provide me with this values, as does the US support from Samsung because I didn't buy the device over there.

Maybe someone from the US could Samsung there.

Offline

Board footer

Powered by FluxBB