oVirt storage-domain recovery Topic is solved

How to use TestDisk to recover lost partition
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
darkside83
Posts: 4
Joined: 09 May 2024, 23:45

oVirt storage-domain recovery

#1 Post by darkside83 »

Hello,

I have a damaged storage-domain in oVirt.
It's usual block device provided by iSCSI. It hasn't any partition table. All the drive is just a LVM-volume. This LVM-volume has LVM-partitions. Each LVM-partition is a drive for VM. It could be in qcow2 or raw format.
I found some qcow2 disks using Photorec as files and will work with them later. But I want to recover one raw volume also. I tried to use Testdisk for it. Looks like I found it after Deep search but cannot create an image via Testdisk. I have an address in CHS format and I have a size but I haven't any idea in which way I can receive an offset in LBA for dd, for example.
Here is an information copied from Testdisk:

Code: Select all

P NTFS                 258379 148 10 271363  96 29  208584704
258379/148/10 - is beginning of partition, 2713663/96/29 - is the end in CHS format, 208584704 - is a size in sectors.

PS: LVM-metadata backup is outdated.
darkside83
Posts: 4
Joined: 09 May 2024, 23:45

Re: oVirt storage-domain recovery

#2 Post by darkside83 »

I forgot to specify a drive geometry:

Code: Select all

Disk /dev/mapper/3600000000000000000000410fd4fd9d3 - 4294 GB / 4000 GiB - CHS 522166 255 63 (RO), sector size=512
recuperation
Posts: 3026
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: oVirt storage-domain recovery

#3 Post by recuperation »

Thank you for telling an interesting story about this rare and complex configuration! If you by chance otherwise expect to receive a specific answer you have to post a specific question, too.

Providing the TestDisk logfile is always necessary.
Avoid abbreviations like VM so that I don't have to guess what this might mean - especially in this context.

As I don't LVM myself, I quickly read something about its structures. The term "partition" does not seem to exist within LVM.

Your "partition" has a size of 100 MB, assuming a sector size of 512 byte. Is that what you are looking for inside a disk with a size of 4 TB?

TestDisk is not a disk imaging program. Using ddrescue is recommended. TestDisk has a feature to image a single partition. If that does not work you have to document the erroneous behaviour. Stating
cannot create an image via Testdisk.
is not helpful at all and leaves me clueless.

TestDisk does not support LVM:
https://www.cgsecurity.org/wiki/TestDisk

When dealing with LVM structures, TestDisk can only be used if its low level layout corresponds to the common MBR or GPT partition table format.
darkside83
Posts: 4
Joined: 09 May 2024, 23:45

Re: oVirt storage-domain recovery

#4 Post by darkside83 »

Testdisk log is more than 16Mb. I can upload it on some external resource.

You are right about LVM. It hasn't partitions, it has volumes.
VM abbreviation is Virtual Machine. So, each logical volume is a drive for virtual machine and has own MBR/GPT partition table.
Partition I'm seeking is located in such volume. It's has size 100Gb.
I just want to know how I can convert address of it's beginning in CHS to LBA? Some formulas I found doesn't work because cylinder quantity in them must be less than 1024 but I have 522166.
recuperation
Posts: 3026
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: oVirt storage-domain recovery

#5 Post by recuperation »

darkside83 wrote: 10 May 2024, 15:16 Testdisk log is more than 16Mb. I can upload it on some external resource.
Look inside using Notepad++ or gun and eliminate repetitive lines that only count upwards but contain the same text and post that shortened version.

You are right about LVM. It hasn't partitions, it has volumes.
VM abbreviation is Virtual Machine. So, each logical volume is a drive for virtual machine and has own MBR/GPT partition table.
Partition I'm seeking is located in such volume. It's has size 100Gb.
I just want to know how I can convert address of it's beginning in CHS to LBA? Some formulas I found doesn't work because cylinder quantity in them must be less than 1024 but I have 522166.
In that case you should use other formulas. The 1024 cylinder barrier has been left behind for a long time.
If you use TestDisk in GPT mode you get LBA sector numbers instead.
darkside83
Posts: 4
Joined: 09 May 2024, 23:45

Re: oVirt storage-domain recovery

#6 Post by darkside83 »

Thanks. I scanned drive in GPT mode and find needed partition beginning in LBA. After that I can copy it with ddrescue. Something like that:

Code: Select all

ddrescue --input-position=2125244399616 --output-position=0 --size=106795368448 /dev/mapper/disk partition.raw
Locked