I am trying to extract a .img file (hard disk image with with Chromium OS on it). I have not been able to find any way to do this other than mounting it but that is not usable because it shows up as multiple drives so I cannot repack it.
I am trying to extract a .img file (hard disk image with with Chromium OS on it). I have not been able to find any way to do this other than mounting it but that is not usable because it shows up as multiple drives so I cannot repack it.
You do not extract an
.img
; you mount it. Example:and this will list the contents:
Mind that
.img
can also be zipped. If that is the case (unlikely though) you also need togunzip
it.You can use
kpartx
- create device maps from partition tablesInstall the package
kpartx
and runFrom
man kpartx
:You can clone from the image file to a drive
You can clone from the
.img
[image] file to a drive, for example a USB pendrive, that is big enough. This is the basic intention of the file.You can use mkusb for that purpose. It works with compressed image files too (when compressed with
gzip
andxz
),.img.gz
and.img.xz
files.After the cloning you will see the partitions for example with
After cloning you can mount and unmount the partition(s) on the drive 'as usual'.
The easiest way I found to extract .img files on Ubuntu is using PEAZIP FREE ARCHIVER, through its windows(ish) GUI.
First you have to install a bunch of i386 dependencies and so you'll have to enable i386 packages too:
Then download PeaZip Package and install it or simply run:
Finally launch
peazip
and go through the GUI to extract .img files. (I can confirm it works on chromium os .img files for me.)Note: You can always rely on gdebi for handling dependencies.
I use the MATE desktop, so I mount ISO or IMG disk images using the MATE Disk Image Mounter. MATE Disk Image Mounter is a file tree dialog that you run to select an image file to mount.
Maybe you can use Etcher.io to write the image on a USB drive or SD card and work with the files and finally repack using disk-utility.