Date: Wed, 26 Mar 2014 15:59:26 -0600 (MDT) From: Warren Block <wblock@wonkity.com> To: Andrea Venturoli <ml@netfence.it> Cc: freebsd-questions@freebsd.org Subject: Re: Partition alignment Message-ID: <alpine.BSF.2.00.1403261551020.50857@wonkity.com> In-Reply-To: <53333669.7000802@netfence.it> References: <53333669.7000802@netfence.it>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 26 Mar 2014, Andrea Venturoli wrote: >> root@:~ # gpart show /dev/mfid0 >> => 63 1751949249 mfid0 MBR (835G) >> 63 1751936382 1 freebsd [active] (835G) >> 1751936445 12867 - free - (6.3M) > >> root@:~ # gpart show /dev/mfid0s1 >> => 0 1751936382 mfid0s1 BSD (835G) >> 0 16777216 4 freebsd-ufs (8.0G) >> 16777216 33554432 2 freebsd-swap (16G) >> 50331648 67108864 5 freebsd-ufs (32G) >> 117440512 33554432 6 freebsd-ufs (16G) >> 150994944 536870912 7 freebsd-ufs (256G) >> 687865856 536870912 8 freebsd-ufs (256G) >> 1224736768 33554432 1 freebsd-ufs (16G) >> 1258291200 493645182 - free - (235G) > > AFAICT the partition are correctly aligned within the slice, but I'm not sure > about the slice itself. No. The starting blocks of the slice and partition are added together to determine the actual start block of the partition: The first partition begins at 63+0, or 63. 63*512 = 32256, not evenly divisible by 4K. Or just divide the block number by 8, same thing. When creating the partitions, use gpart's -a option, and it will add an offset so the slice is aligned: gpart add -t freebsd-ufs -a4k -s8g mfid0s1 That will make the first partition start at the first aligned offset in the slice, probably block 1 or 9. Use GPT if you can, it simplifies this by not needing the partition with a partition scheme.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1403261551020.50857>