header background

Installing armbian on Orange Pi

Some notes on getting started with Orange Pi PC Plus. I worked with slightly different model with 3 USB ports (See image).

Table of Contents

Installing Armbian on SD card

See also documentation on Armbian wiki for preparing SD card.

  1. Download appropriate system image from Armbian download page
  2. Unzip and write .raw file onto SD card. You could use Rufus tool if you’re on Windows
  3. Insert SD card into TF card slot, attach all devices
  4. Plug power and wait ~3 min (first boot only, depends on card speed)

Installing Armbian on EMMC storage

See also documentation on Armbian wiki for installing to eMMC.

  1. Boot from SD card
  2. AS a root execute nand-sata-install script provided with Armbian image
  3. Power off your Orange Pi
  4. Eject SD card from TF slot
  5. Plug power and wait for system to start

Resizing root partition on EMMC

By default nand-sata-install installs system to EMMC creating 8GB partition. In order to create secondary partition:

  1. Insert SD card to start Armbian from SD
  2. Shrink filesystem to the minimum size: sudo resize2fs -pM -d 30 /dev/mmcblk1p1
  3. Use sudo fdisk /dev/mmcblk1, delete the first partition
  4. Create new partition (start address same as for old partition, size: +2GB)
  5. Create additional partition(s)
  6. Expand filesystem: sudo resize2fs -p -d 30 /dev/mmcblk1p1
  7. Format additional partitions (if any): sudo mkfs.ext4 /dev/mmcblk1p2
  8. Reboot and start Armbian from EMMC (you may need to wait for a while)

EMMC and SD card devices

SD card and EMMC are visible as:

  • /dev/mmcblk0
  • /dev/mmcblk1

However, the names depend on how the system is started. If the Armbian is booted from SD card, then it is the first device (/dev/mmcblk0) and the second (/dev/mmcblk1) is for EMMC. But if the system boots from EMMC (after running nand-sata-install script and without SD card), then the EMMC is /dev/mmcblk0 and the other device is not present.

Using Armbian on EMMC with SD card

See also this forum thread.

Armbian will always boot from SD card if present. Let the SD card forward boot to EMMC:

  1. Boot from SD card
  2. Go to /boot directory
  3. Backup boot.cmd and boot.scr files
  4. Update boot.cmd file: replace root=/dev/mcblk0 with root=/dev/mmcblk1
  5. Run mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
  6. Boot Orange Pi from EMMC (with SD card inserted)
  7. I’m not sure which files on the inserted SD card are required to boot from EMMC. The setup works however with everything deleted except of /boot and /lib folders. It is also possible then to shrink this partition
  8. After all that the /etc/fstab file on EMMC filesystem may be updated to:
    ### partitions on EMMC on EMMC
    /dev/mmcblk1p1 / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1
    /dev/mmcblk1p2 /mnt/emmc2 ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1
    ### the sdcard --- which starts the system
    /dev/mmcblk0p1 /mnt/sdcard1 ext4 rw,suid,dev,exec,noauto,user,async,noatime,nodiratime,commit=600,errors=remount-ro 0 1
    /dev/mmcblk0p2 /mnt/sdcard2 ext4 rw,suid,dev,exec,noauto,user,async,noatime,nodiratime,commit=600,errors=remount-ro 0 1
    tmpfs /tmp tmpfs defaults,nosuid 0 0
    /var/swap none swap sw 0 0
    
Comments