I'm hoping someone can tell me how to resize a disk image. Here's my problem:
I created a bootable USB by writing an image file using 'Etcher' on my Macbook. The source image (this one) requires a 2GB stick. I have a couple of sticks that are nominally 2GB, but in fact they are a fraction too small (1.99GB), so Etcher fails at the last moment. I have another nominally 2GB stick, which is in fact 2.1GB, so Etcher successfully writes the image. It creates a disk that has three partitions (boot=64.0MB, swap=255.9MB, linux=1.7GB)
I've then made some changes to that base image (by installing Jivelite on a Joggler), and I'd like to take an image of the result, so that it will fit on another '2GB' stick.
If I do a 'dd' on e.g. /dev/sdb, it makes an image of the entire disk, including all three partitions (boot, swap, linux), but the resulting image is now 2.1GB (even though the three partitions are exactly the same size as the original image). The disk image size seems to be fixed to the physical size of the USB hardware. So now, if I want to put that image on another stick, the stick will have to be at least 2.1GB.
So is it possible to reduce the disk image somehow, so that it's no bigger than the sum of the three partitions?
I created a bootable USB by writing an image file using 'Etcher' on my Macbook. The source image (this one) requires a 2GB stick. I have a couple of sticks that are nominally 2GB, but in fact they are a fraction too small (1.99GB), so Etcher fails at the last moment. I have another nominally 2GB stick, which is in fact 2.1GB, so Etcher successfully writes the image. It creates a disk that has three partitions (boot=64.0MB, swap=255.9MB, linux=1.7GB)
I've then made some changes to that base image (by installing Jivelite on a Joggler), and I'd like to take an image of the result, so that it will fit on another '2GB' stick.
If I do a 'dd' on e.g. /dev/sdb, it makes an image of the entire disk, including all three partitions (boot, swap, linux), but the resulting image is now 2.1GB (even though the three partitions are exactly the same size as the original image). The disk image size seems to be fixed to the physical size of the USB hardware. So now, if I want to put that image on another stick, the stick will have to be at least 2.1GB.
So is it possible to reduce the disk image somehow, so that it's no bigger than the sum of the three partitions?