Skip to content

Instantly share code, notes, and snippets.

@cpuuntery
Last active May 28, 2023 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cpuuntery/b8aff7fb190d3a871e54bcc826f65044 to your computer and use it in GitHub Desktop.
Save cpuuntery/b8aff7fb190d3a871e54bcc826f65044 to your computer and use it in GitHub Desktop.
gnome-disk-image-mounter --writable file.img
OR
1- sudo fdisk -l disk.img
2- value of the offset is (disk start number) * 512
3- sudo mount -v -o offset=VALUE -t ext4 /path/to/image /mount/dir
sudo kpartx -a -v file.img
It is a decent alternative if gnome-disk-image-mounter does not exist for whatever reason.
But the only thing it can do is to write to the disk image.
It can not be used to shrink the disk image
only gnome-disk-image-mounter can be used to shrink disk images and modify it at the same time.
remember to unmount the partition after you finished your changes. If you don't do that, the disk image will be corrupted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment