Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7596

Advanced users • NVMe/SSD boot with advanced format (4k sectors)

$
0
0
Some recent NVMe, SSD and HDD can be switched from 512e (emulated 512 bit sectors) to native 4k sectors. That's called advanced format. I've discovered that the normal way of installing Raspberry Pi OS does not work on advanced format disks. That might be the reason some users are reporting no-boot and it is frustrating for them.

Normal user takes the Raspberry Pi Imager and that will do a dd copy of the official image on the disk. If the disk is in advanced format, dd is fine, but the MBR (and GPT as well, as a matter of fact) is wrong by factor of 8. That can be easily corrected. The easiest way I found is to use sfdisk. It can automatically recalculate the partitions from existing device_with_512 to a new device_with_4096:

Code:

sfdisk -d /dev/device_with_512 > part.txtcat part.txt | sfdisk /dev/device_with_4096 
Your tool can write the partitions at the end, this will ensure the user has the right partitions on both 512 and 4k sector disk. You can also choose to make GPT partitions instead of MBR. For example for devices larger than 2TB, or if user requests it.

Now partitions are aligned. EXT4 is fine, it has internally 4k sectors. Problem is with VFAT, which has 512 bit sectors. That's not working on 4k devices, it will not boot, it will not even mount. The solution is to reformat VFAT with 4k sectors and copy the files. The easiest way would be to have the VFAT in the official image already with 4k sectors. So instead of doing just mkfs.vfat do mkfs.vfat -S 4096 and that's it.

Source: https://wiki.archlinux.org/title/Advanced_Format

Statistics: Posted by fik — Wed Jul 16, 2025 2:20 pm



Viewing all articles
Browse latest Browse all 7596

Trending Articles