3

I started a new Debian install on my BeagleBone Black Version C using a 16gb MicroSD card. The image I used via win32DiskImager created only one boot linux partition for the root file system and everything else, at a 3.3gb size. The rest of the MicroSD card is unused. I want to resize this partition to take advantage of the rest of the space that is unused.

All of the resize tutorials I have read relate to a system that has two partitions, but again, my install has only one. Why I do not know. I didn't delete any partitions at all, which is why I didn't notice until I decided to check the room I had left.

Is it possible to resize mmcblk0p1 to make use of the entire microSD, or should I break it up like a traditional install?

Here is my lsblk

root@beaglebone:~# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk1boot0 179:16   0    1M  1 disk
mmcblk1boot1 179:24   0    1M  1 disk
mmcblk0      179:0    0 14.7G  0 disk
`-mmcblk0p1  179:1    0  3.3G  0 part /
mmcblk1      179:8    0  3.7G  0 disk
|-mmcblk1p1  179:9    0   96M  0 part
`-mmcblk1p2  179:10   0  3.6G  0 part

Here is my fdisk -l

root@beaglebone:~# fdisk -l

Disk /dev/mmcblk0: 14.7 GiB, 15811477504 bytes, 30881792 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
Disklabel type: dos
Disk identifier: 0xa2911fde

Device         Boot Start     End Sectors  Size Id Type
/dev/mmcblk0p1 *     2048 6963199 6961152  3.3G 83 Linux

Disk /dev/mmcblk1: 3.7 GiB, 3925868544 bytes, 7667712 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
Disklabel type: dos
Disk identifier: 0x00000000

Device         Boot  Start     End Sectors  Size Id Type
/dev/mmcblk1p1 *      2048  198655  196608   96M  e W95 FAT16 (LBA)
/dev/mmcblk1p2      198656 7667711 7469056  3.6G 83 Linux

Disk /dev/mmcblk1boot1: 1 MiB, 1048576 bytes, 2048 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/mmcblk1boot0: 1 MiB, 1048576 bytes, 2048 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
HopWorks
  • 468
  • 1
  • 5
  • 13
  • 1
    This question should probably be moved to serverfault.com. – Kurt Stutsman Feb 22 '16 at 18:46
  • 3
    Resizing is very simple. Fire up `fdisk`, remove old partition and create new one. One thing you should take care of is the starting block, which **have to be exactly the same as on the old partition**. Then, optionally, you'll have to reboot if kernel complains about old partition table being still in use. Then do `resize2fs` to resize filesystem to fill up the new partition. It can be done on 'live' filesystem. Voila. – nsilent22 Feb 22 '16 at 19:27
  • I worried about losing the data on that partition when removing and creating a new one. I backed it up just in case. How is the data still available if that partition is removed? Thank you for the reply! – HopWorks Feb 22 '16 at 19:32
  • That did it nsilent22. Took a leap of faith. I made a note of it in my onenote for next time. Thank you sir!! – HopWorks Feb 22 '16 at 20:06
  • 1
    I wrote this tutorial for exactly this situation http://dev.iachieved.it/iachievedit/expanding-your-beaglebone-microsd-filesystem/. You can indeed resize your live partition and then the filesystem itself, without a reboot. – Joe Jun 04 '16 at 13:42
  • 1
    That guide was great, @Joe! I think the link you sent is out-of-date though, here's what worked for me: https://dev.iachieved.it/iachievedit/expanding-your-beaglebone-microsd-filesystem/ – Jordan Mann Sep 01 '21 at 05:13

1 Answers1

1

nsilent22's suggestion did the trick. I did not need to worry about losing data when I deleted the partition and then created a new one using fdisk. Thank you nsilent22!!

HopWorks
  • 468
  • 1
  • 5
  • 13