Mounting mmcblk0p2 for persistent storage


(Joshua Klein) #1

Hi all,

I just received my HiFive Unleashed SoC and am following the Getting Started guide. I would like to write and save files on the board but I am stuck on this:

SD cards formatted by the freedom-u-sdk contains a second partition which can be used for persistent storage. You can access this storage by executing mount /dev/mmcblk0p2 /mnt.

When I run the mentioned command, I am met with the following:

mount: mounting /dev/mmcblk0p2 on /mnt/ failed: Invalid argument

I wanted to ask if anyone else has encountered this issue and if/how they managed to solve it. In case it helps, here’s my fdisk output:

# fdisk -l
Found valid GPT with protective MBR; using GPT
Disk /dev/mmcblk0: 15523840 sectors, 3484M
Logical sector size: 512
Disk identifier (GUID): 3570cf94-ced4-8941-a89b-c8fba48f9338
Partition table holds up to 128 entries
First usable sector is 2048, last usable sector is 15523806
Number Start (sector) End (sector) Size Code Name
1 2048 67583 32.0M 0700 bootloader
2 264192 15523806 7450M 0700


(Jim Wilson) #2

Is there a filesystem on the mmcblk0p2 partition? You might need to run mke2fs to create the file system before you can mount it.


(Joshua Klein) #3

Yup, missing partition appeared to be the issue. For anyone who encounters similar, simply run:

mke2fs /dev/mmcblk0p2

Thanks Jim!