So I'm starting this process by creating a new xen VHD.
Size: 1GB
I will format this with NTFS and place some files on it once I have done so.
At creation time:
Code: Select all
-rw-r--r-- 1 admin administ 5120 Apr 23 19:56 /share/XenSRtest/9e8a12e6-9fe4-9e56-7209-fe8d82f1d2ca/277b1393-b896-407d-adee-6c0e2495262b.vhd _before_format
When I boot windows, it sees this disk and asked me to initialize it with MBR of GPT. I chose MBR.
Code: Select all
-rw-r--r-- 1 admin administ 12288 Apr 23 20:00 /share/XenSRtest/9e8a12e6-9fe4-9e56-7209-fe8d82f1d2ca/277b1393-b896-407d-adee-6c0e2495262b.vhd
Then I made a new simple volume in Windows 2008R2 – the maximum size was 1021MB
I set the volume label to NewFiona and formatted with NTFS (quick format).
Code: Select all
-rw-r--r-- 1 admin administ 35979264 Apr 23 20:04 /share/XenSRtest/9e8a12e6-9fe4-9e56-7209-fe8d82f1d2ca/277b1393-b896-407d-adee-6c0e2495262b.vhd
Then I made a folder called Fiona’sFiles – no change in the file size noted.
Code: Select all
-rw-r--r-- 1 admin administ 35979264 Apr 23 20:04 /share/XenSRtest/9e8a12e6-9fe4-9e56-7209-fe8d82f1d2ca/277b1393-b896-407d-adee-6c0e2495262b.vhd
Then I created a txt file called Fiona.txt and put 150 bytes of txt content in the file – still no change in file size:
Code: Select all
-rw-r--r-- 1 admin administ 35979264 Apr 23 20:04 /share/XenSRtest/9e8a12e6-9fe4-9e56-7209-fe8d82f1d2ca/277b1393-b896-407d-adee-6c0e2495262b.vhd
Then I copied a few zip files to the folder to force the vhd to grow.
The folder now contains:
- 7z920-x64 (2).exe
7x920-x64.exe
portable-pn2342350 (2).zip
portable-pn2342350 (2).zip
testdisk-6.14-WIP.win (2).zip
testdisk-6.14-WIP.win.zip
Fiona.txt
Code: Select all
-rw-r--r-- 1 admin administ 51032064 Apr 23 20:11 /share/XenSRtest/9e8a12e6-9fe4-9e56-7209-fe8d82f1d2ca/277b1393-b896-407d-adee-6c0e2495262b.vhd
Then I shut down the vm:
Code: Select all
-rw-r--r-- 1 admin administ 52535808 Apr 23 20:15 /share/XenSRtest/9e8a12e6-9fe4-9e56-7209-fe8d82f1d2ca/277b1393-b896-407d-adee-6c0e2495262b.vhd
Then I ran testdisk :
/root/testdisk-6.14-WIP/testdisk_static /log 277b1393-b896-407d-adee-6c0e2495262b_with_data.vhd
Testdisk incorrectly reports the “size” of the media:
Select a media (use Arrow keys, then press Enter):
>Disk 277b1393-b896-407d-adee-6c0e2495262b_with_data.vhd - 52 MB / 50 MiB
I select Intel – it shows:
Code: Select all
Disk 277b1393-b896-407d-adee-6c0e2495262b_with_data.vhd - 52 MB / 50 MiB
CHS 7 255 63 - sector size=512
Analyze tells me:
Code: Select all
Partition sector doesn't have the endmark 0xAA55
I did a quick search. If found nothing.
I did a deeper search. It found nothing.
So I quit. Then I went to Geometry.
I changed the cylinders. I guessed at what to set. If 50Mb = 7 cylinders, and my drive should be around 1024, then the cylinders should be around 140. From previous experience I know testdisk thinks the drive is invalid if the partition table exceeds set geometry so I’ll set it to 150 cylinders.
Code: Select all
Disk 277b1393-b896-407d-adee-6c0e2495262b_with_data.vhd - 1233 MB / 1176 MiB - CHS 150 255 63, sector size=512
Back to analyze – quick search showed nothing.
Deep seach showed nothing.
So I quit, and then changed the partition type to none.
Initially it displays:
Code: Select all
P Unknown 0 0 1 149 254 63 2409750
A quick search updates this to:
However pressing P returns:
Code: Select all
P NTFS 0 2 19 130 42 56 2091008
Can't open filesystem. Filesystem seems damaged.
A deeper search returns:
Code: Select all
>P NTFS 0 2 19 130 42 56 2091008
P NTFS 2 45 59 132 86 33 2091008
Can't open filesystem. Filesystem seems damaged.
For both of these as well.
Now here’s my problem. I should NOT have to FIX this image. It’s a new image. It works.
I don’t think testdisk understands xen.
Then I went to file system.
Code: Select all
> P Unknown 0 0 1 149 254 63 2409750
I tried setting type to NTFS.
Still can’t open the file system – but this makes sense – the file system will not start here.
I put both the “empty” and “used” vhd files into an archive called fiona_test.tar.gz
I’ll try to attach or failing that will send you a PM with a download link.
Hopefully this helps as I’m sure I won’t be the only one trying to open xen VHD’s
Thanks!
Mitch.