Adding slog from the UI (11.2-RC1) - shouldn't the partitions be at least 1M-aligned?

Status
Not open for further replies.

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
This is the partition table of a new SSD I added as an slog via the UI:
Code:
root@freenas-pmh:~ # gpart show ada4
=>	   40  537234688  ada4  GPT  (256G)
		 40		 88		- free -  (44K)
		128  537234600	 1  freebsd-zfs  (256G)


I did memorize that all partitions should be 1M aligned with SSDs? Correct?

Thanks,
Patrick
 

svtkobra7

Patron
Joined
Jan 12, 2017
Messages
202
Think so ... this is what I have if it helps.

Code:
gpart create -s gpt da1
gpart add -t freebsd-zfs -a 1m -l Opt2Log1 -s 16G da1

root@FreeNAS-01:~ # gpart show da1
=>	  40  33558448  da1  GPT  (16G)
		40	  2008	   - free -  (1.0M)
	  2048  33554432	1  freebsd-zfs  (16G)
  33556480	  2008	   - free -  (1.0M)
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Thanks - did that already, of course. I was just asking if this is intentional or an oversight in the UI.
 

svtkobra7

Patron
Joined
Jan 12, 2017
Messages
202
Sorry misunderstood your query. May I ask, why such a large SLOG?

Does the UI 1M align by default?

[a bit curious now myself]
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
No, the UI does not 1M align. That's my point. I have this SSD lying around, I added it as an slog via UI. My first post is the resulting partitioning. My feeling is that this may be less than optimal. Hence the question.

After that I removed the slog, partitioned manually, added it again.

Patrick
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
Just tested this out on another box (on 11.1-U6) and no, it doesn't appear to be 1M-aligning SLOG devices from the UI.

Code:
root@test:/ # gpart show ada1
=>	  40  16777136  ada1  GPT  (8.0G)
		40		88		- free -  (44K)
	   128  16777040	 1  freebsd-zfs  (8.0G)
  16777168		 8		- free -  (4.0K)


We're getting 4K alignment but not 1M.
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Which is precisely what I wrote in my initial posting ;)
 

HoneyBadger

actually does care
Administrator
Moderator
iXsystems
Joined
Feb 6, 2014
Messages
5,112
Which is precisely what I wrote in my initial posting ;)

Updated with my version number just to clarify that this isn't just an 11.2 "beta" issue. I also see it on a 9.10-U2 box.

I don't believe that anything will be harmed by it being 4K-aligned vs 1M-aligned at this point. The partition starts at 64K, so you'd need a hypothetical SSD that uses a sector/NAND page larger than that in order to be impacted, and so far I've only met a handful of 8K and I think one 16K. (Although 8K TLC might erase in 24K pages, but the flash translation layer should have that taken care of as the writes will be aligned and mapped through by the controller properly.)

For future-proofing though, this should become 1M aligned.
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
There is no point to align partition to 1MB if the file system inside it uses smaller alignment. At some point Windows started to use 1MB alignment for all partitions, and that may indeed be a fail-safe approach when working on top of random RAIDs and with random file systems, but I don't see any specific benefits from it for ZFS, which in FreeNAS uses 4KB alignment (ashift) by default (may support 8KB if device explicitly ask, but that is a maximum). Partition alignment to 1MB just makes no any sense other then cosmetic, while change of partitioning policy may be a POLA violation for people trying to replace disks in existing pools.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Thanks for the explanation.
 
Status
Not open for further replies.
Top