Re: dd a live image and create a second partition
On 03/01/2011 09:57 AM, Charles Russell wrote:
> Ben Armstrong wrote:
> you might just want to leave any existing partition on your stick intact,
> copy the necessary files over to it from the live image, and then
> syslinux the stick to make it bootable. Saves you the hassle with gparted.
> I don't know how to get the files out of binary.img without first dd'ing
> to a stick or burning a dvd, and it is just as easy to dd and then
> repartition. I couldn't get a loopback mount to work since the .img file
> was not recognized as a valid filesystem. I can easily extract files
> from the .iso, but then "isolinux" has to be edited to "syslinux" in all
> the configuration files and directories.
Mounting the .img loopback is easy. You just need to mount with an
offset to skip the boot sector.
/sbin/fdisk -ul binary.img
Observe the sector size, e.g.
Sector size (logical/physical): 512 bytes / 512 bytes
Observe the "Start" for the first partition.
Multiply start x sector size. This is your offset.
mount -o loop,offset=512 binary.img binary