Hello, On Jan 15 18:42 Arvin Schnell wrote:
On Mon, Jan 15, 2018 at 12:35:17PM -0500, Felix Miata wrote:
Ancor Gonzalez Sosa composed on 2018-01-15 17:37 (UTC+0100): ...
For example, in the case of a typical GPT partition table in a typical disk, the REQUIRED grain would be 1B (so we can create a partition of any size), but the OPTIMAL grain is 1MiB (so we try to only distribute the space in virtual "disk slices" of 1MiB)....
1MiB at the front is a convention. How did optimal *grain* get to be so big?
We do the same as parted does here. The target are SSD where the internals are unfortunately hidden (see https://en.wikipedia.org/wiki/Solid-state_drive#Partition_alignment, also linked from libstorage-ng documentation):
"A typical practice for personal computers is to have each partition aligned to start at a 1 MB (= 1,048,576 bytes) mark, which covers all common SSD page and block size scenarios, as it is divisible by all commonly used sizes - 1 MB, 512 KB, 128 KB, 4 KB, and 512 bytes. Modern operating system installation software and disk tools handle this automatically."
As far as I know 1MiB would be too small for best performance on modern flash storage, cf. https://github.com/rear/rear/issues/1201#issuecomment-281274259 and subsequent comments and links therein. In particular see the parted manual https://www.gnu.org/software/parted/manual/parted.html that reads (excerpts): ----------------------------------------------------------- how to partition a low-end flash device ("low-end", as of 2011/2012). For such devices, you should use 4MiB-aligned partitions (2) ... (2) Cheap flash drives will be with us for a long time to come, and, for them, 1MiB alignment is not enough. Use at least 4MiB-aligned partitions. For details, see Arnd Bergman's article, http://lwn.net/Articles/428584/ and its many comments. ----------------------------------------------------------- To make DASD same (DASD has a factor 3 in 48 KiB = 3 * 4 * 4 KiB) a least common multiple could be 3 * 4 MiB = 12 MiB but flash storage may have a physical block size of 8 MiB which would make the least common multiple 3 * 8 MiB = 24 MiB that could be used as one same default grain value for best performance on traditional rotating disks, on flash storage (from cheap USB sticks up to high-end SSDs), and even on DASD. Out ouf curiosity: Does someone know the reason behind why IBM introduced the unexpected factor 3 via 48 KiB required grain on DASD? Not that I am actually surprised what IBM introduces, cf. https://en.wikipedia.org/wiki/31-bit Kind Regards Johannes Meixner -- SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard, Graham Norton - HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org