I have a semi theoretical question regarding ntfs partitions.
Assume we create a ntfs partition inside a file
dd if=/dev/zero of=test.img count=40960
mkfs.ntfs -F test.img
for testing purposes i've added some files
sudo mount -o loop test.img mnt
mkdir -p mnt/test_dir/doc
echo "this is a test file" > mnt/test_dir/doc/README.txt
sudo umount mnt
so here comes my question. Assume i have just one part of my partition
dd if=test.img of=test_part.img count=40952
is it possible to repair this part, in order to mount it again.
In my understanding in the test_part.img one cluster is missing, since the count
parameter is 40952, which is 8 less than the original size. And with a sector size of 512, 8*512=4096 is one ntfs cluster.
I've tried the ntfsfix
utility which did not work.
I've also looked into the documentation of testdisk
and it seems you can change the partition geometry manually with this tool. However i had no success.
So please help me. Is there a way to repair test_part.img so that i can mount it again and get the README.txt file.