[Bug 214356] Non-optimal partition alignment in RPI2 image
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Wed Nov 9 10:58:53 UTC 2016
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214356
Bug ID: 214356
Summary: Non-optimal partition alignment in RPI2 image
Product: Base System
Version: 11.0-RELEASE
Hardware: arm
OS: Any
Status: New
Severity: Affects Many People
Priority: ---
Component: arm
Assignee: freebsd-arm at FreeBSD.org
Reporter: jason.mann+freebsd at gmail.com
The prebuilt image file for FreeBSD 11.0-RELEASE for the Raspberry Pi 2
contains the following partition layout:
=> 63 2097089 md0 MBR (1.0G)
63 102375 1 !12 [active] (50M)
102438 1994714 2 freebsd (974M)
=> 0 1994714 md0s2 BSD (974M)
0 90 - free - (45K)
90 1994496 1 freebsd-ufs (974M)
1994586 128 - free - (64K)
The partitions are not aligned to any typical power-of-two flash page sizes,
which may lead to write amplification, decreasing write performance and
increasing the wear rate on the microSD card.
Slice 1, containing the firmware and bootloader, has an offset of 63 sectors.
This is probably in line with old MBR partitioning using CHS addressing, but
LBA has long since made this practice obsolete. Most mainstream OSs now use an
offset of 2048 sectors for the first MBR slice.
Slice 2 has an offset of 102438 sectors, and is further sub-partitioned using
the BSD scheme. BSD partition 1 has an offset of 90 sectors from the beginning
of slice 2, for a total device offset of 102528 sectors.
SD cards commonly have a flash erase block size of 4MiB, so it may be
beneficial for the partitions to be aligned to multiples of 4MiB. This may be
less important for slice 1 which is usually only read from at boot, but very
important for slice 2 partition 1 which contains the read/write root
filesystem.
I have tried recreating the RPI2 image with altered partitioning, as follows:
=> 63 2097089 md1 MBR (1.0G)
63 8129 - free - (4.0M)
8192 122880 1 !12 [active] (60M)
131072 1966080 2 freebsd (960M)
=> 0 1966080 md1s2 BSD (960M)
0 1966080 1 freebsd-ufs (960M)
After copying the partition contents from the official image, then writing the
new image to an SD card, my RPI2 was still able to successfully boot from it.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-arm
mailing list