Similar to the way Mac OS X users can create and mount blank .dmg files, add and remove files as much as they wish, and move that image wherever they want… as if it were a virtual USB drive.
Is there an equivalent for Ubuntu? I know that the "Disk Image Mounter" allows us to mount and edit existing .img files, but is there an equally easy way to create/format empty .img files? Every solution I have found so far implements copying/cloning an already existing drive, but I don't want that.
EDIT: I created a scripted GUI application based on the answer accepted below. It's just a dialog based on YAD and .sh files, it's meant to make the dd command/mount/format process easier to handle for not-so-command-line-savvy people.
Best Answer
Yes.
This is a step-by-step guide to create a custom image starting from scratch;
I'll assume the following:
Creating the blank image
Create the blank image:
Mounting the blank image
List the already busy loopback devices:
Mount the image on the first available loopback device:
Partitioning / formatting the blank image
Run
gparted
passing the loopback device as an argument:Click on "Device" -> "Create Partition Table...":
Click "Apply":
Click on "Partition" -> "New":
Select "fat32" from the drop-down menu:
Click "Add":
Click the green tick:
Click "Apply":
Click "Close":
And close Gparted.
Unmounting the image
Finally, unmount the image from the loopback device:
You can use the created image for whatever purpose you want; for example, you can use it as a virtual USB drive:
Opening Files: