[RndTbl] resizing an SD card image?

Gilbert E. Detillieux gedetil at cs.umanitoba.ca
Tue Nov 20 14:46:07 CST 2012

On 2012-11-20 14:27, Trevor Cordes wrote:
> On 2012-11-20 Grigory Shamov wrote:
>> Hi,
>> Any easy way to resize a bootable image for SD card? There are ready
>> Linux images for booting on Android devices, like MK802. The problem
>> is, 1) sometimes you don't have a card for that size (say 4Gb image,
> Hmm, couldn't you use gparted?  I think almost for sure this would work
> for ext2/3/4, not sure about FAT32?

I think gparted can resize FAT16 and FAT32 file systems too.  However, 
since that's the default format for most USB sticks and SD cards, it may 
be simpler to just copy the files from the mounted image file to the 
mounted device, rather than doing an image copy.

> If gparted can't do an image (probably can't) then you could dd the
> image to a block device (like a USB stick), run gparted and resize,
> then dd it back in to an image file.
> I'm assuming this won't mess up the boot pointers into the fs.  Should
> be fine for grows.  Shrinks should work if the bootable bits are at the
> beginning.
> Or am I out to lunch here?

Most boot loaders these days aren't sensitive to actual block positions, 
the way Lilo was.  So, that shouldn't be an issue anymore.

Of course, it all depends on the actual boot image format in this 
particular case...

Gilbert E. Detillieux		E-mail: <gedetil at muug.mb.ca>
Manitoba UNIX User Group	Web:	http://www.muug.mb.ca/
PO Box 130 St-Boniface		Phone:  (204)474-8161
Winnipeg MB CANADA  R2H 3B4	Fax:    (204)474-7609

More information about the Roundtable mailing list