Jump to content

Manual flashing

From Nura Wiki
Note If you only need to slightly adjust the way pmbootstrap runs a flasher, you can grab the exact command it uses from the pmbootstrap log and modify it when running manually.

Sometimes you just need to flash the completed system image externally. Export the images that pmbootstrap generated with pmbootstrap export and read on about how to call the flashing application from your host OS.

Fastboot

Manually flash using Fastboot. See fastboot --help, and expand this section if you find out something that would have helped you.

LineageOS Recovery can be flashed with Odin. From LOS Recovery you can enter userspace fastbootd to flash .img files via fastboot. This was implemented in Android 10, provided the recovery supports entering into fastbootd. Yes, fastboot on a Samsung device. Tested and working on Tab S5e, but should work on all Samsung from A10 + with a supported recovery.

Note Recent (circa Sep-Nov2023) versions of fastboot (as available in the android-tools package on common linux distributions) may be broken. fastboot will coredump when flashing known good pmos.img files. The error message is
terminate called after throwing an instance of 'std::out_of_range'
  what(): basic_string::compare: __pos (which is 464) > this->size() (which is 0)

Known problematic packages are (archlinux): android-tools-34.0.4-[2,3].

Known working package is android-tools-34.0.1-2.

Odin

Odin is an official flasher for many Samsung devices and runs only on Windows. Make sure you have the latest Samsung USB drivers installed before plugging in the smartphone in Odin mode. As of right now, it is available for Linux. See https://xdaforums.com/t/official-samsung-odin-v4-1-2-1-dc05e3ea-for-linux.4453423/ for details

Flashing with Odin requires a PIT file (Partition Information Table) that contains the map of the device's partitions. Its file extension is .pit and can be obtained with Heimdall.

Heimdall

See also: Heimdall

Galaxy Flasher

Flash tab in Galaxy Flasher v0.5.1

Galaxy Flasher is a GTK4 application for Linux developed by Ethical Haquer that can be used instead of Odin and Heimdall to flash on Samsung devices. It is also available as a Flatpak.

Note As of mid 2026, Heimdall commands are unavailable on the Flatpak version. Galaxy Flasher is still under active development and hasn't been tested with Nura, so proceed with caution.

Flashing with existing subpartitions

Generate your image file with pmbootstrap:

$ pmbootstrap init
$ pmbootstrap install
$ pmbootstrap export

Inspect the exported .img file with fdisk and run losetup to check what it will be mapped to in /dev/loop: the last part of the file will be the loop number.

# fdisk -l [path to .img file]
# losetup --find --show --partscan --read-only [path to .img file]

Before you progress, make sure the partitions are properly set up on the drive with boot starting at 2048. From here, mount the image file to /dev/loop: typically, 1 is boot and 2 is root. Then dd to the drive and use losetup -d to unmount.

# losetup -fP [path to .img file]
# dd if=/dev/loop0p1 of=/dev/sdb1 bs=4M status=progress
# dd if=/dev/loop0p2 of=/dev/sdb2 bs=4M status=progress
# losetup -d /dev/loop0

External links