Skip to content

SD card: resizing the linux partion

adampasz edited this page Oct 7, 2014 · 5 revisions

How to get the size of your partitions on the Galileo.... and yes, the IOTDK is only a 1GB partition.

root@quark0171ae:~# ls /dev | grep mmc
mmcblk0
mmcblk0p1
mmcblk0p2
root@quark0171ae:~# blockdev --getsz /dev/mmcblk0
15564800
root@quark0171ae:~# blockdev --getsz /dev/mmcblk0p1
104446
root@quark0171ae:~# blockdev --getsz /dev/mmcblk0p2
2048000

So you want to resize? As far as I can tell, there are two options. If you have a linux VM or Ubuntu you can use 'gparted' which has a gui that makes it fairly painless. The other option is to use 'fdisk' on the card itself. So far I have been using gparted - but I may try modifying this script in case it makes it simpler.

I used Virtualbox - a free VM developed by oracle which has a standard Ubuntu build that I keep around to test things in linux or to cross compile with embedded linux platforms. Open the terminal in Ubuntu. To download 'gparted': apt-get install gparted then type gparted. The application will open.

You will need to select the device in Virtualbox using the Devices menu and select it again inside of gparted. If you have trouble with the internal SD card reader on OSX, try a USB card reader. A lot more people online seemed to have success with external USB devices: gparted step 1 If you need to download Linux, you could try using the dedicated gparted image available here: http://gparted.org/livecd.php

You will know you have the correct drive when the file system looks like this: gparted step 2

Expand it by clicking on the drive and right clicking properties. It will show you a preview of the new partition scheme. Click on the green check to confirm and apply the changes to the SD card. gparted step 3

When you are done you will get a confirmation that the partitioning was successful. Mine took about 2 minutes. gparted step 4