# Maix2 Dock Image Burning On OSX

All the forum posts I could find assumed access to either Windows or Linux machines to burn the firmware onto an SD card. I needed a couple of goes at this when trying from my Mac.

The main issue I had was how to remove and recreate one partition from the initial image.

i.e. how to grow that partition to use the remaining space on the SD Card. I found a way of using Virtualbox to do this as outlined below.

## Burning the initial image 1

MAKE SURE YOU ARE WRITING TO THE SD CARD

For me the SD Card showed up as /dev/rdisk2, be very careful to ensure you are writing to the SD Card and not a system disk.

sudo dd if=tina_v831-sipeed_uart0.img of=/dev/rdisk2 bs=1m


## Expanding partitions on the image 1

In Virtualbox - mount the SD card in linux2

Pass the raw disk image over to Virtualbox :

sudo VBoxManage internalcommands createrawvmdk -filename /Users/goul/VirtualBox\ VMs/sdcard.vmdk -rawdisk /dev/disk2

sudo chown *<yourid> /dev/disk2


In virtuabox - add the raw disk to the ubuntu image using the storage manager.

Then extend the 5th partition using fdisk.

sudo fdisk /dev/sdb


(Delete any existing 5th partition - then add a new partition that is the remaining size of the disk.

Write changes to disk and then add file system via :

mkfs -t ext4 /dev/sdb5


The space added to this fifth partition will be later mounted as the /home partition on the device.