MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / test_LVM2

Function test_LVM2

src/lvm.c:131–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131static int test_LVM2(const disk_t *disk_car, const struct lvm2_label_header *lh, const partition_t *partition, const int verbose, const int dump_ind)
132{
133 if (memcmp((const char *)lh->type,LVM2_LABEL,sizeof(lh->type)) == 0)
134 {
135 if(verbose>0 || dump_ind!=0)
136 {
137 log_info("\nLVM2 magic value at %u/%u/%u\n", offset2cylinder(disk_car,partition->part_offset),offset2head(disk_car,partition->part_offset),offset2sector(disk_car,partition->part_offset));
138 }
139 if(le32(lh->offset_xl)>400)
140 return 1;
141 if(dump_ind!=0)
142 {
143 /* There is a little offset ... */
144 dump_log(lh,DEFAULT_SECTOR_SIZE);
145 }
146 return 0;
147 }
148 return 1;
149}
150
151int check_LVM2(disk_t *disk_car,partition_t *partition,const int verbose)
152{

Callers 2

check_LVM2Function · 0.85
recover_LVM2Function · 0.85

Calls 4

offset2cylinderFunction · 0.85
offset2headFunction · 0.85
offset2sectorFunction · 0.85
dump_logFunction · 0.85

Tested by

no test coverage detected