Mounting a Proxmox .raw file

December 17, 2023 - Reading time: ~1 minute

Proxmox will create an image on a hard disk when you add an extra hard drive to a guest VM.

the file has the .raw extension.

From https://unix.stackexchange.com/questions/316401/how-to-mount-a-disk-image-from-the-command-line

To mount this file on a Linux filesystem you need to discover what kind of filesystem it is. Do this by doing below:

 fdisk -lu /path/disk.img

This will give you an output such as below:

Then you can mount the raw image using the correct offset by multiplying the start by sector size.

mount -o loop,offset=xxxx /path/disk.img /mnt/disk.img.partition

In the example above, the mount command would be:

mount -o loop,offset=1048576 /media/server-storage/images/100/vm-100-disk-0.raw /mnt

You may need to use sudo if you aren't in the root account (you absolutely should NOT be logging/sudoing in as root!)

LazyCoderOZ

I am a Linux guy, been around for 20+ years using Linux as my daily driver.
This is my blog on my discoveries and notes so I don't forget how I have done things :)