I am trying to mount a disk image (consisting of MBR, fat, ext4 partitions) so I can modify the layout using `gparted`. (I am trying to move the partition to a 4M boundary.)

I have tried `sudo mount img mountpoint -o loop` without success.

How can I achieve this?
['https://unix.stackexchange.com/questions/240450', 'https://unix.stackexchange.com', 'https://unix.stackexchange.com/users/47111/']
You don't have to mount image to edit its partition table. Make `gparted` work directly with your image:

```
sudo gparted /path/to/img

```

EDIT: `mount` is a term related to file systems. You can mount an image of file system. Image of disk containing partition table is an image of block device, which is generally not a valid file system.
I don't know if you may resize or move your partition on an image, but there is a tool for mounting partitions within an image file, **kpartx**. I never used it, but you can take a look here: <http://robert.penz.name/73/kpartx-a-tool-for-mounting-partitions-within-an-image-file/>