grow-sd: Script for Resizing SD Card Partitions Using sfdisk

The purpose of this example script, which we call grow-sd, is to demonstrate a use case for using sfdisk, or what I like to call ‘scripted fdisk’, to modify a partition on an SD card provided by Technologic Systems. This is useful when your production SD card image, originally copied from a 512 MB SD card, is being written to a much larger capacity SD card, and you want the additional storage space. Keep in mind, the script itself is specific to Technologic Systems’ embedded boards, and only applies to those images which are shipped with four partitions (ie. TS-7350). However, this script also generically demonstrates and example usage of sfdisk. We thought it’d be helpful to publish in hopes it would be useful. Feel free to modify it to fit your requirements.

Further notes: This script mentions support for JFS, which is a special beast in that partitions can only be grown and not shrunk and even then, JFS does some hackery to grow the partition. The TS-7800, for example, uses JFS, so make sure you test on a development board before applying to production processes.


Author: Derek Hildreth

eBusiness Manager for Technologic Systems