Even on small SD cards (8Gb for instance) there’s a lot of leftover space you can use. These instructions show how to create and access that space.
-
Log into the Endpoint shell :
ssh root@192.168.82.2
-
do :
fdisk -l
and you should see output that ends with a table like this:Disk /dev/mmcblk1: 7.4 GiB, 7948206080 bytes, 15523840 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: gpt Disk identifier: B27368D9-649F-47CD-80E2-C6B0A4C16DC0 Device Start End Sectors Size Type /dev/mmcblk1p1 34 1057 1024 512K Linux filesystem /dev/mmcblk1p2 1058 2081 1024 512K Linux filesystem /dev/mmcblk1p3 2082 10273 8192 4M Linux filesystem /dev/mmcblk1p4 10274 1058849 1048576 512M Linux filesystem /dev/mmcblk1p5 1058850 2107425 1048576 512M Linux filesystem /dev/mmcblk1p6 2107426 4204577 2097152 1G Linux filesystem /dev/mmcblk1p7 4204578 6252577 2048000 1000M Linux filesystem
We’re interested in the name
/dev/mmcblk1
from that first line, which is the mass-storage device’s name. -
Do:
fdisk /dev/mmcblk1
and ignore the scary warning. What we’re going to do won’t upset the apple cart. -
Enter:
n
-
Enter:
p
-
Hit return three times to accept the defaults which will create a new partition encompassing all of the remaining space on your SD card. You can, of course, create multiple smaller partitions by overriding the defaults and entering specific sizes or block counts.
-
Enter
p
for a list of partitions and you should see your new partition at the end of the list:Command (m for help): p Disk /dev/mmcblk1: 7.4 GiB, 7948206080 bytes, 15523840 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: gpt Disk identifier: B27368D9-649F-47CD-80E2-C6B0A4C16DC0 Device Start End Sectors Size Type /dev/mmcblk1p1 34 1057 1024 512K Linux filesystem /dev/mmcblk1p2 1058 2081 1024 512K Linux filesystem /dev/mmcblk1p3 2082 10273 8192 4M Linux filesystem /dev/mmcblk1p4 10274 1058849 1048576 512M Linux filesystem /dev/mmcblk1p5 1058850 2107425 1048576 512M Linux filesystem /dev/mmcblk1p6 2107426 4204577 2097152 1G Linux filesystem /dev/mmcblk1p7 4204578 6252577 2048000 1000M Linux filesystem /dev/mmcblk1p8 6254592 15523806 9269215 4.4G Linux filesystem
-
Enter
w
-
At this point, I chose to enter the command
reboot
and then reconnect with ssh, but that may not strictly be necessary. -
Now we need to create a filesystem on our partition. You should be at the ‘#’ prompt now, so enter
mkfs.ext4 /dev/mmcblk1p8
. This can take a bit of time to execute, from a few seconds on an 8Gb drive to much longer on larger SD cards. Be patient. -
Mount the new drive: (You can choose a different mount point. /mnt is just a default place to hang mounted drives)
# mkdir /mnt/data # mount /dev/mmcblk1p8 /mnt/data
-
Enjoy the new space: You dotnet programs can now read/write files at /mnt/data/…
# ls -al /mnt/data total 21 drwxr-xr-x 3 root root 4096 Jan 1 00:33 . drwxr-xr-x 3 root root 1024 Jan 1 00:34 .. drwx------ 2 root root 16384 Jan 1 00:33 lost+found # df /mnt/data Filesystem 1K-blocks Used Available Use% Mounted on /dev/mmcblk1p8 4478204 24 4230068 0% /mnt/data