Other SSD not automatically aligned?

I let FreeBSD 10.2 Release's installer use the whole SSD.

Now I read about the tool gpart, so I typed gpart show, and this is what is displayed:

Code:
=>  63  250069617  ada0  MBR  (119G)
  63  63  - free -  (32K)
  126  249561018  1  freebsd  [active]  (119G)
  249561144  508536  - free -  (248M)

=>  0  249561018  ada0s1  BSD  (119G)
  0  241172480  1  freebsd-ufs  (115G)
  241172480  8388537  2  freebsd-swap  (4.0G)
  249561017  1  - free -  (512B)

Does this mean the SSD is not properly aligned? "126" does not seem to be dividable by 4, which as far as I know indicates that the partition is not aligned to match the hardware layout.

Edit: Seems I confused sectors with bytes. This is what diskinfo -v /dev/ada0 shows:

Code:
ada0
   512     # sectorsize
   128035676160   # mediasize in bytes (119G)
   250069680     # mediasize in sectors
   4096     # stripesize
   0     # stripeoffset
   248085     # Cylinders according to firmware.
   16     # Heads according to firmware.
   63     # Sectors according to firmware.

ada0s1
   512     # sectorsize
   127775241216   # mediasize in bytes (119G)
   249561018     # mediasize in sectors
   4096     # stripesize
   3072     # stripeoffset
   247580     # Cylinders according to firmware.
   16     # Heads according to firmware.
   63     # Sectors according to firmware.

Still not sure if the alignment is good. I spent 2 hours reading about this but it is very confusing. I just want to make sure that the partitions are set up perfectly before I spend days and weeks of customizing my FreeBSD installation.
I also wonder why 32K at the start and 248M at the end of the disk are not used.
 
You should reinstall using the GPT partitioning and choose manual partitioning with the partitions aligned at 1MB boundaries. This would waste some space at the beginning of the disk but at least you'll have all the partitions at boundaries that match the largest known block sizes for SSDs. The reason why there are now some wasted space at the end of the disk is the ancient CHS (https://en.wikipedia.org/wiki/Cylinder-head-sector) alignment requirement on MBR disks. The requirement makes absolutely no sense anymore with LBA being used everywhere but there are still BIOSes that insist on it and refuse to boot from MBR disks with improperly aligned partitions.
 
Does this mean the SSD is not properly aligned?
Yes.

When using the awful MBR/BSDlabel combined partitioning, alignment must be done by adjusting the start of the BSD partition inside the slice. The slice starts at block 126, which is not an even multiple of 4K:
(126 * 512) / 4096 = 15.75

When creating the BSD partitions, it is possible to specify an additional offset. The gpart output shows that is zero, though, instead of the 2 which would align it.

kpa is correct, use GPT. But still check that the installer actually aligned things.
 
Thank you for your help.
I have now reinstalled FreeBSD and tried to fix the alignment. I hope it is fixed now:
Code:
$ gpart show ada0
=>  34  250069613  ada0  GPT  (119G)
  34  6  - free -  (3.0K)
  40  1024  1  freebsd-boot  (512K)
  1064  984  - free -  (492K)
  2048  250067592  2  freebsd-ufs  (119G)
  250069640  7  - free -  (3.5K)

BTW: Can you somehow format your code so that whitespace is not omitted?
 
Yes, it is aligned.

Whitespace is preserved inside code tags. Not sure why it is not in your post, though. Could be a browser thing when pasting, looking at the source shows there are only two spaces at the beginning of the last lines.
 
Back
Top