PinePhone Installation Instructions
This section has generic installation instructions. Please see the PinePhone Software Releases section for specific installation instructions for each distribution.
- 1 Boot priority
- 2 Preparation of SD card
- 3 Installation to eMMC (Optional)
- 4 Resize partition to fit disk space
- 5 Reuse SD card for data storage on system booting from eMMC
The default PinePhone boot priority is first the SD card and then the eMMC so inserting your own SD card with your preferred release will result in the phone booting your image.
Preparation of SD card
- Download your chosen image from the options below
- Extract the compressed file
- Write the image to your SD card
- Plug SD card into phone
- Boot phone
If you need step-by-step instructions for writing an image to an SD card, check the NOOB guide, then return to this page.
Download the .img.xz and the .img.bmap files, then run
bmaptool copy --bmap image.bmap image.xz /dev/sdX. This takes 2.5mins to flash a 4Gb file.
Make sure to select the correct device using
lsblk. Then run dd with the correct device:
sudo dd if=pine.img of=/dev/[DEVICE] bs=1M status=progress conv=fsync
Installation to eMMC (Optional)
Method Using Factory Installed Tools
The initial OS you get with your phone has the option to flash an image on SD card to eMMC.
- Copy (not flash) the image file to a formatted SD card.
- Insert SD card into powered-off phone.
- Turn on phone and select option to install to eMMC.
Safe & Easy Method
- download and extract the Jumpdrive image
- flash the Jumpdrive image to a SD card
- boot from the SD card
- connect the PinePhone to your computer using USB-A -> USB-C cable.
- flash the exposed (mounted) PinePhone drive with a chosen OS image as you'd flash any SD card, and resize partitions (optional, see below)
- disconnect the PinePhone from your PC, power it down and remove the Jumpdrive SD card
- boot into your OS of choice on eMMC
The Jumpdrive image is smaller than 50MB. You can keep an SD card specifically for using Jumpdrive, and there are 64MB micro SD cards sold cheaply that will suffice.
Safe With No Extra Tools, But Slower
- Prepare a formatted SD card, flash desired OS to the SD card, and (optionally) resize the partition (see below)
- Insert SD card and boot the phone
- Open terminal and
git clone [url]your desired project OR: Open web browser and download the desired OS image file.
- Build the OS (Optional)
- Flash the resulting image file you got by downloading or by building, to eMMC, using
dd if=/dev/mmcblkX of=/dev/mmcblkY bs=1Mwhere X is the number label of the SD card, and Y is the number label of the eMMC. Use the command lsblk to check your devices: typically with the current kernel the SD card is /dev/mmcblk0 and the eMMC is /dev/mmcblk2 but as always with dd be extremely cautious to get the devices correct. Then, resize partition to fill up entire disk (see below).
- Turn off phone, remove SD card. Turn on phone.
Warning: This copies a mounted filesystem, which can lead to instability, erratic behavior, and data corruption. Do not use long term.
- Prepare a new SD card, flash desired OS to the SD card
- Boot the phone with your new SD card image
- Within the booted OS, flash/clone the running OS to eMMC, e.g. using dd. It will take about 15 minutes (depending on the speed of your card), and in the end it may show an error about not enough space - just ignore it.
- Turn off phone, take out SD card, and try booting the phone which should load up the new OS from eMMC.
- Open terminal and resize partition to fill up entire disk (see below).
Resize partition to fit disk space
Once you've flashed the OS to your SD card or eMMC storage, you may also need to expand the partition to fill all the available space.
Resize SD card's partition using computer
For SD cards, insert the SD card and resize the partitions through the computer. For eMMC, insert the phone cable and use Jumpdrive to access the eMMC directly, and resize the partition after flashing the image.
growpart /dev/sdX 1 resize2fs /dev/sdX 1
Locate growpart (
apt-cache search growpart and install the package in the search results) and run:
growpart /dev/mmcblkX Y resize2fs /dev/mmcblkXpY
where X is the storage device and Y is the partition number (viewable from lsblk).
If you get any errors about missing or unknown commands, use apt-cache search to find and install the needed software. Also don't forget to use sudo.
Parted's interactive mode and resize work well together. Do this before you put your SD card into the PinePhone for the first time for best results.
sudo parted /dev/<your_sd_card_device> (parted) resizepart 2 100% (parted) quit sudo resize /dev/<the_second_sd_card_PARTITION>
Resize from within PinePhone:
eMMC: you would need to resize the partition on eMMC (flashed with the operating system) by booting another image from the SD card: that way, the eMMC will be unmounted. It is not recommended to resize eMMC while booted from eMMC! Resizing a currently mounted partition can have weird results.
SD card: It is generally not possible to boot from eMMC to partition the unmounted SD card, because of the boot order -- you would have to write the image to the empty SD card first, then resize partition, all without rebooting. It is also not recommended to resize the SD card while booted from SD card! Resizing a currently mounted partition can have weird results.
Reuse SD card for data storage on system booting from eMMC
Once you have installed your release of choice to eMMC, you may wish to use an SD card for data storage. If you choose to re-use a card you have previously used to boot from, you will find your phone will not boot if you just reformat the card and insert it. This is because the Allwinner firmware in the PinePhone uses some (normally) unused space at the front of the SD card to store boot software, which you need to clear.
This can be done as follows on any linux system:
to check the device of your SD card – as an example lets assume it is /dev/mmcblk0 then
sudo dd if=/dev/zero of=/dev/mmcblk0 bs=8k seek=1 count=4
will clear the relevant sectors of your card.