Solid State Drive (SSD) – Info and Alignment

J

Jarret W. Buse

Guest
Solid State Drive (SSD) – Info and Alignment

Similar to thumb-drives, a Solid State Drive (SSD) uses electrons to store information. Everyone using computers has come across a thumb-drive or SD type card. The SSD device is really an extension of the same technology with better performance. The world is quickly evolving and so are hard drives. The days of slow magnetic disks are being replaced with faster drives which rely on electrons for storage.)

SSD drives work off the Serial Advanced Technology Attachment (SATA) bus. To date, there are five SATA standards with varying throughput bandwidth or functionality:

  1. SATA 1 - 1.5 Gb/s (150 MB)
  2. SATA 2 – 3 Gb/s (300 MB/s)
  3. SATA 3 – 6 Gb/s (600 MB/s) (NCQ)
  4. SATA 3.1 – 6 Gb/s (600 MB/s) (mSATA) (TRIM)
  5. SATA 3.2 – 16 Gb/s (1969 MB/s)

NOTE: Native Command Queuing (NCQ) allows the drives to optimize the read/write order for better performance. TRIM allows the Operating System (OS) to inform the drive which blocks of data that are no longer needed and can be erased. The mSata specification allows for a smaller connector for use in laptops and smaller devices.

For support of the extra functionality, Advanced Host Controller Interface (AHCI) must be enabled in the BIOS, if it is supported by the system. If AHCI is not enabled, SATA devices will operate in an IDE emulation mode. The emulation mode does not support NCQ, lower power consumption and hot swap ability. Hot swap ability allows for devices to be removed and added while the system is still operational.

An example of the speed difference between a standard Hard disk Drive (HDD) and an SSD is as follows:

  • Data Access (HDD) – 10-15 ms
  • Data Access (SSD) - <.1 ms
The speed difference is not the only comparison which can make you change your loyalty to SSD. The following comparisons show a big difference between HDD and SSD:

  • Seq. Read/Write speed (MB/s) (HDD) – 140 MB/s (read) / 70 MB/s (write)
  • Seq. Read/Write speed (MB/s) (SSD) – 540 MB/s (read) / 330 MB/s (write)
  • Random Read/Write speed (IOPS) (HDD) – 450 (read) / 400 (write)
  • Random Read/Write speed (IOPS) (SSD) – 98,000 (read) / 70,000 (write)
  • Operating Power Consumption (Watt) (HDD) – 1.75 Watt
  • Operating Power Consumption (Watt) (SSD) – .127 Watt
  • Idle Power Consumption (Watt) (HDD) - .8 Watt
  • Idle Power Consumption (Watt) (SSD) - .046 Watt
  • Mean Time Between Failures (MTBF) (HDD) – 700,000 hours
  • Mean Time Between Failures (MTBF) (SSD) – 1,500,000 hours

NOTE: These statistics came from Samsung which compares a 500GB SSD drive to a 500GB hard disk. The list can show that an SSD has better performance ratings than a standard hard drive of the same size.

As hard drives become full, their performance decreases. Performance degrades due to fragmentation. Fragmentation is when files are added and deleted and empty spaces are filled by files which are then written in non-contiguous sectors. The drive head must move to the next appropriate area and wait for the sector to spin under it. Once the sector is under the head, it can be read before waiting for the next sector. Waiting for the head and the disk to get to the correct area produces waste time, or latency. SSD devices are not impacted by fragmentation, so there is no latency produced as the drive fills to full capacity.

SSD devices store information as electrons in a floating-gate transistor. When the power is removed, the electrons remain and external power is not required to maintain the data.

Each Single Level Cell (SLC) stores one bit. Some SSD devices could also have a 2-bit or 3-bit Layer Cell which of course stores 2 or 3 bits each. By adding more bits to a cell allows for higher capacity devices to be made. The problem is that increasing the bits in a cell reduces performance and stability (which should hopefully be overcome in the next few years).

Storage is an array of cells which make a page. Pages are 4-16 KB in size. A block is made up of 128-512 pages.

Pages are written and read as a whole. For performance sake, the pages must be aligned to the physical pages when partitioned. If the partition is misaligned, the performance degrades by half.

What occurs is that with each partition created, an unused portion must be made before it. This unused space is for the use of a boot record. Typically, the size of the boot record is 63 sectors or 31.5 KB. As a result, this record only fills a portion of a page. Since pages are read and written as a whole, the remaining space is considered the beginning of the next page. The result is that a page is not a physical page, but portions of two physical pages. For every read and write performed, two pages are accessed and not just one. Since double pages are accessed, it takes twice as long to perform a single operation, thus, degrading the performance to half.

The trick is to leave a 2 MB space before each partition created. The 2 MB space allows for the division of the pages evenly whether the page size is 8 KB or 16 KB. In the future, if a page is 32 KB then a space should be left of 4 MB.

To check alignment, use Parted. After starting Parted as Root, enter the command 'unit mb' to specify that all units are in megabytes. Enter the command 'print all' to display the information for all devices. The heading of each device should show 'Sector Size (logical/physical) #B/#B'. For example, my system shows 'Sector size (logical/physical): 512B/512B' You also need to find the starting position for the partition. For example, mine shows partition 1 starting at 1.05 MB. So, I multiply the starting point by the sector size (105*512). The result is 53760 for the size of the boot record. Then, I divide the result by 4,096. If the result is not a whole number, then the drive is misaligned.

Now, let's try the 2 MB boot record. Again, the sector size is 512B, but the partition starts at 2.00 MB. I multiply 512 * 200 and get the result of 102400. I divide this result by 4096 and get a result of 25. The answer is a whole number and shows that the partition is aligned.

NOTE: It is necessary to perform the test for each partition on the drive to verify proper alignment.

To properly set up partitions on a used drive, you can use GParted Live. Backup the drive to ensure data integrity if a problem occurs. Boot from GParted Live. Select the SSD drive you want to partition. Click on the first partition you want to align and click 'resize/move'. Change the space before the partition to 2 MB. Uncheck the option to 'Round to Cylinders' or 'align to Mib' and then select 'Resize/Move'. Click Apply to start the alignment. Reboot when done and perform for all partitions. If a problem occurs when rebooting, use a program like Rescatux to fix the problem.

NOTE: Perform the tests using Parted to verify alignment.
 

Attachments

  • ssd-slide.jpg
    ssd-slide.jpg
    44.7 KB · Views: 88,618


Hey, is this mSATA.....? :)
 

Attachments

  • Chromebook SSD Picture.jpg
    Chromebook SSD Picture.jpg
    217 KB · Views: 1,758
Almost all SATA in a notebook/laptop are mSATA.
Ah..... :D I see.... I'm getting one that has 128GB, because, quite frankly, a 16GB SSD with ChromeOS and Ubuntu with the KDE Shell just isn't cutting it..... :p
 
Using, within parted,
Code:
align-check TYPE N
being type: min or opt; and being N, the number of the partition; can't you successfully check if you're partitions are well aligned?
 
Using, within parted,
Code:
align-check TYPE N
being type: min or opt; and being N, the number of the partition; can't you successfully check if you're partitions are well aligned?
I have looked around and found that some people do not trust the parted 'align-check' option. If the command is using the default block size for a normal HDD, then the alignment would be off. I have not tried this option, but would definitely trust the manual way described in my article. I tend to want to try the hands-on way and not rely on the command and options to do it for me. I guess I try to rely more on what I am doing than relying on defaults. The defaults do not always work, especially for hardware which need such specific requirements.
 
I have looked around and found that some people do not trust the parted 'align-check' option. If the command is using the default block size for a normal HDD, then the alignment would be off. I have not tried this option, but would definitely trust the manual way described in my article. I tend to want to try the hands-on way and not rely on the command and options to do it for me. I guess I try to rely more on what I am doing than relying on defaults. The defaults do not always work, especially for hardware which need such specific requirements.
I have no SSD, and I am using a standard HDD with the same block size as you said in your article. In this case, is this command reliable?
 
Thank you, Jarret W. Buse, for the informative and well-written thread on SSDs.

Regarding alignment, I learned most recently from you about leaving 2MB and also from a link in another post in another forum that gparted may be a culprit in mis-sized extended partitions (see link2.txt, attached).

All-in-all, it has been a productive day or two!
 

Attachments

  • link2.txt
    40 bytes · Views: 1,272
I have no SSD, and I am using a standard HDD with the same block size as you said in your article. In this case, is this command reliable?
The alignment check should work on a standard HDD. The SDD drives require such specifics it is hard to tell that parted uses those specifics.
 
has any one tried this ssd cf card readers

with... lets say 128gb 600x cf card
 

Members online


Latest posts

Top