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

Function recover_LVM2

src/lvm.c:169–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169int recover_LVM2(const disk_t *disk_car, const unsigned char *buf,partition_t *partition,const int verbose, const int dump_ind)
170{
171 const struct lvm2_label_header *lh=(const struct lvm2_label_header *)buf;
172 if(test_LVM2(disk_car,lh,partition,verbose,dump_ind)!=0)
173 return 1;
174 set_LVM2_info(partition);
175 partition->part_type_i386=P_LVM;
176 partition->part_type_sun=PSUN_LVM;
177 partition->part_type_gpt=GPT_ENT_TYPE_LINUX_LVM;
178 {
179 const struct lvm2_pv_header *pvhdr;
180 pvhdr=(const struct lvm2_pv_header *) (buf + le32(lh->offset_xl));
181 partition->part_size=le64(pvhdr->device_size_xl);
182 }
183 if(verbose>0)
184 {
185 log_info("part_size %lu\n",(long unsigned)(partition->part_size/disk_car->sector_size));
186 }
187 return 0;
188}

Callers 1

search_type_1Function · 0.85

Calls 2

test_LVM2Function · 0.85
set_LVM2_infoFunction · 0.85

Tested by

no test coverage detected