This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Unable to recreate 2nd partiton on eMMC running outoff space

Hi,

I am running out of eMMC space in BBB,  when I was trying to delete the old partitons & recreate new partitions in eMMC of beaglebone black from beginning

I tried giving option 4.02. o - this clears the existing partitions after giving fdisk /dev/mmcblk1, this didn't help I guess, does this deletes all the partitons permanently???

And I hope the option, which I give

Command (m for help): w

 this makes everything permanent am giving this option every time, whenever I recreate partitions in eMMC & I hope this might not be allowing to delete all my old partitions & recreate from beginning newly how to recreate the partitions freshly from beginning

Could you please help me out, as am stuck with this from long time how to get rid of this below running out of space

root@am335x-evm:/# fdisk /dev/mmcblk1
Welcome to fdisk (util-linux 2.21.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): o
Building a new DOS disklabel with disk identifier 0x684d2d6e.

Command (m for help): p

Disk /dev/mmcblk1: 1920 MB, 1920991232 bytes
4 heads, 16 sectors/track, 58624 cylinders, total 3751936 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 identifier: 0x684d2d6e

Device Boot Start End Blocks Id System

Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-3751935, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-3751935, default 3751935): +16M
Partition 1 of type Linux and of size 16 MiB is set

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): e
Changed system type of partition 1 to e (W95 FAT16 (LBA))

Command (m for help): a
Partition number (1-4): 1

Command (m for help): p

Disk /dev/mmcblk1: 1920 MB, 1920991232 bytes
4 heads, 16 sectors/track, 58624 cylinders, total 3751936 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 identifier: 0x684d2d6e

Device Boot Start End Blocks Id System
/dev/mmcblk1p1 * 2048 34815 16384 e W95 FAT16 (LBA)

Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (34816-3751935, default 34816):
Using default value 34816
Last sector, +sectors or +size{K,M,G} (34816-3751935, default 3751935):
Using default value 3751935
Partition 2 of type Linux and of size 1.8 GiB is set

Command (m for help): p

Disk /dev/mmcblk1: 1920 MB, 1920991232 bytes
4 heads, 16 sectors/track, 58624 cylinders, total 3751936 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 identifier: 0x684d2d6e

Device Boot Start End Blocks Id System
/dev/mmcblk1p1 * 2048 34815 16384 e W95 FAT16 (LBA)
/dev/mmcblk1p2 34816 3751935 1858560 83 Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
[ 1909.524693] mmcblk1: p1 p2

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
root@am335x-evm:/# [ 1909.878049] EXT4-fs (mmcblk1p1): bad geometry: block count 64512 exceeds size of device (16384 blocks)
[ 1910.022313] EXT4-fs (mmcblk1p2): VFS: Can't find ext4 filesystem
[ 1910.029943] EXT3-fs (mmcblk1p2): error: can't find ext3 filesystem on dev mmcblk1p2.
[ 1910.039223] EXT2-fs (mmcblk1p2): error: can't find an ext2 filesystem on dev mmcblk1p2.
[ 1910.048546] FAT-fs (mmcblk1p2): invalid media value (0x82)
[ 1910.054340] FAT-fs (mmcblk1p2): Can't find a valid FAT filesystem
[ 1910.076156] cramfs: wrong magic
[ 1910.080754] FAT-fs (mmcblk1p2): invalid media value (0x82)
[ 1910.086548] FAT-fs (mmcblk1p2): Can't find a valid FAT filesystem

root@am335x-evm:/#
root@am335x-evm:/#

Kindly do the needful as early possible,

  • Hi Srini,

    I would like to suggest to use "fdisk" command with your SD card/pendrive on Linux host machine to understand the fdisk command usage then try with AM335x's eMMC.

    What is your size of eMMC ?

    It is better to try with your pendrive /SD card as size of eMMC.

    http://unix.stackexchange.com/questions/115698/fix-ext4-fs-bad-geometry-block-count-exceeds-size-of-device

    As link says, try to re-format your eMMC with ext4 again.

  • Hi Titus,

    Thanks for your replies,

    I found out formating the boot partition using below command

    dd if=/dev/zero of=/dev/mmcblk1 bs=1024 count=1024 (http://www.twam.info/hardware/beaglebone-black/u-boot-on-beaglebone-black)

    The above link doesn't say properly about formatting ext4 partition of rootfs provided by you..

    Could you please provide similar commands for deleting rootfs & all other partitions & reformatting all the partitions?...

    Kindly do the needful as early as possible,

    Thanks in advance