Code Sample |
# make new 25MB image dd if=/dev/zero of=/path/to/new/image bs=1024k count=25 # Format image with ext2 mkfs.ext2 /path/to/new/image # Mount old image mount -o loop /path/to/old/image /old/image/mountpoint # Mount new image mount -o loop /path/to/new/image /new/image/mountpoint # Copy files from old image to new image cp -a /old/image/mountpoint/* /new/image/mountpoint # Unmount umount /old/image/mountpoint umount /new/image/mountpoint |