(I already posted it on 2 other forums, I'm desparate at this point) "Failed to read last sector (209399806): Invalid argument" when mounting loop device

So here’s the context: I did sudo cat /run/media/vadym/T7/Backups/2023-07-09-11-img/nvme0n1p3.ntfs-ptcl-img.gz.* | sudo gzip -d -c | sudo partclone.restore -C -s - -O nvme0n1p3_C_Drive.img to create an image from my Clonezilla backup, I wanted to do this because I wanted to extract some files from the backup, so I tried to mount the image as a loop device: sudo mount -r -o loop nvme0n1p3_C_drive.img /mnt/C. Here’s the output:

Failed to read last sector (209399806): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
   or it was not setup correctly (e.g. by not using mdadm --build ...),
   or a wrong device is tried to be mounted,
   or the partition table is corrupt (partition is smaller than NTFS),
   or the NTFS boot sector is corrupt (NTFS size is not valid).
Failed to mount '/dev/loop0': Invalid argument
The device '/dev/loop0' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

How do I solve this issue?

1 Like

Is it ntfs?

1 Like

When I use partclone to backup, I also record the partition sizes. It looks like the image restored is smaller than the original partition. You could try finding a tool that tells you how big the image should be, or use the error message , and add zero blocks until you get that big, and then try mounting again.

I’m not sure what ntfs considers a block to be, 512, 1024 or 4096 bytes, but it says sector which usually means 512. You can add a block to the end of file.img using this command below, adjusting file, blocksize and count as appropriate:

dd if=/dev/zero bs=512b count=1 >> file.img
6 Likes

Thank you! I used this exact command except I changed the file.img to my file name! It worked!!!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.