How can I format unallocated space on mmclk0?

I couldn´t found in forum how to create an Ext partition on emmc. :slightly_frowning_face:
I could see the list bellow but didn’t get it formated. I tried Gparted but no way.

Could any one help me?. :flushed:


root@Khadas:~# lsblk
mmcblk0rpmb 179:96 0 4M 0 disk
mmcblk0boot0 179:32 0 4M 0 disk
mmcblk0boot1 179:64 0 4M 0 disk
mmcblk0 179:0 0 58.2G 0 disk

root@Khadas:~# fdisk -l
Disk /dev/mmcblk0: 58.2 GiB, 62537072640 bytes, 122142720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mmcblk0boot1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mmcblk0boot0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

You shouldn’t need to format yourself: when you flash an image it effectively partitions the emmc and formats each partition appropriately.

I run the Ubuntu server image: if you check the boot log you get an idea of the layout of emmc.

$ dmesg | grep “mmcblk”
[ 4.577597] mmcblk0: emmc:0001 CWBD3R 58.2 GiB
[ 4.577918] mmcblk0boot0: emmc:0001 CWBD3R partition 1 4.00 MiB
[ 4.578186] mmcblk0boot1: emmc:0001 CWBD3R partition 2 4.00 MiB
[ 4.578438] mmcblk0rpmb: emmc:0001 CWBD3R partition 3 4.00 MiB
[ 4.582034] [mmcblk0p01] bootloader offset 0x000000000000, size 0x000000400000
[ 4.582254] [mmcblk0p02] reserved offset 0x000002400000, size 0x000004000000
[ 4.582447] [mmcblk0p03] env offset 0x000006c00000, size 0x000000800000
[ 4.582631] [mmcblk0p04] logo offset 0x000007c00000, size 0x000002000000
[ 4.582841] [mmcblk0p05] ramdisk offset 0x00000a400000, size 0x000002000000
[ 4.583024] [mmcblk0p06] rootfs offset 0x00000cc00000, size 0x000e82c00000
[ 4.654187] mmcblk1: sd:0001 ED4QT 119 GiB
[ 4.655870] mmcblk1: p1
[ 17.539593] EXT4-fs (mmcblk0p6): mounted filesystem with writeback data mode. Opts: data=writeback

With the Ubuntu server image mmcblk0p6 also has an alias /dev/rootfs and is mounted as /

1 Like

Thanks by your reply.

Ok. Seems this more complicated than I expected.
I’m in Ubuntu 16.04 Desktop now. The Gparted was a solutio that always I used.
I unthertood by your e-mail that is not possible use that software in this case.

There is any software where I can see all partitions and format eMMC? Or it´s only possible by Command Line?
I’m a user on linux (Ubuntu and Debian) and I´m not expert on Linux. Until now I only used
Gparted to find and format partions.


Hold on a second, take a step back.

Most things are possible. BUT - the most important issues in my mind are:

  1. WHAT are you trying to achieve?
  2. WHY?

My point is your eMMC is most likely already formatted and partitioned in a reasonably optimum way. Unless you are an expert you are likely to make things worse or even stop your VIM2 working.

So - what do you have? Probably very similar to me (I have a VIM2 running the Khadas Ubuntu 16.04 image that I have upgraded to 17.10, running Openbox for a X window system). On my machine running the df command in a terminal window gives

$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.3G 0 1.3G 0% /dev
tmpfs 300M 17M 284M 6% /run
> /dev/rootfs 58G 25G 31G 45% /
tmpfs 1.5G 32M 1.5G 3% /dev/shm
tmpfs 5.0M 8.0K 5.0M 1% /run/lock
tmpfs 1.5G 0 1.5G 0% /sys/fs/cgroup
/dev/mmcblk1p1 118G 86G 26G 78% /home/sdcard
tmpfs 300M 16K 300M 1% /run/user/1000
The line I have made bold shows I have a partition called /dev/rootfs mounted as my root (/) partition. It is 58Gb big of which 25Gb is used. In fact this is the majority of my eMMC, and all the required partitioning and formatting was effectively done when I first flashed the image. (It also shows I have a 128Gb sdcard, effectively 118Gb, mounted as /home/sdcard).

Now you will struggle to format your root partition while you are running linux from it. If you really want to I would recommend you boot an operating system from an sdcard and then format the eMMC. But my second question is WHY? This is all done magically for you when you flash a Khadas or Balbes150 image and they know a lot better than me.

For your interest: as in my first reply if you open a terminal and type dmesg | grep “mmcblk” you will see how your eMMC is partitioned - in my case it is known as mmcblk0 and it has several partitions which are needed to get an Amlogic CPU to boot linux:
…boot0, boot1 & pmb are super special.
the rest are called mmcblk0p01/02/03/04/05/06 and their purpose is similar to their name. But I certainly do not have large amounts of unused eMMC that I can format and use.

And I doubt you do either.

1 Like

First of all, I want to thank you for the time you spend with this help.

---- What I am trying to achieve? and Why?
I intend to learn how to work with this electronic board. I want to be comfortable with the manipulation of burned out various ROMs, advantages and disadvantages of each, and so on.
Partitioning management is part of this learning.

My problem with the partitions, started because I read here in the forum that this was possible with Gparted and now I know that this is not possible

Now back to the subject I can see how partitions are.

root@Khadas:~df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.3G 0 1.3G 0% /dev
tmpfs 300M 32M 269M 11% /run
/dev/linux 58G 2.9G 55G 6% /
tmpfs 1.5G 51M 1.5G 4% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1.5G 0 1.5G 0% /sys/fs/cgroup
tmpfs 1.5G 20K 1.5G 1% /tmp
/dev/multiboot 32M 30M 2.8M 92% /boot
tmpfs 300M 20K 300M 1% /run/user/1000

This is different from your partitions but it’s okay. There is no memory loss.
Thanks for your help.
Have a nice day.