Opened 12 years ago

Closed 12 years ago

#577 closed defect (fixed)

Mondorestore miscalculates restore partition sizes

Reported by: wangtekkee Owned by: Bruno Cornec
Priority: highest Milestone: 3.0.1
Component: mondo Version: 3.0.0
Severity: critical Keywords: Mondorestore partitioning


Hi, I am testing Mondorescue on a HP Proliant DL380 server running RHEL 5.7 64-bit. Mondo version is 3.0.0. I have 1 disk on the SmartArray /dev/cciss/c0d0. There are 3 paritions p1 is /boot, p2 is swap and p3 is a LVM partition and all other system file systems are created in the LVM. On restore, Mondo calculates p3 as 0, p1 as 0 and allocates the rest of the disk to p2.

The mondorestore log and the mountlist are attached.

Attachments (2)

mondorestore.log (64.0 KB ) - added by wangtekkee 12 years ago.
The monsorestore log
mountlist.original (248 bytes ) - added by wangtekkee 12 years ago.
The mountlist

Download all attachments as: .zip

Change History (6)

by wangtekkee, 12 years ago

Attachment: mondorestore.log added

The monsorestore log

by wangtekkee, 12 years ago

Attachment: mountlist.original added

The mountlist

comment:1 by Bruno Cornec, 12 years ago

Status: newassigned

comment:2 by Bruno Cornec, 12 years ago

Priority: normalhighest
Severity: normalcritical

Using this test C code, I was able to solve the issue:

#include <sys/ioctl.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>

void log_msg(const char *fmt, ...)
	va_list args;

		va_start(args, fmt);
		vprintf(fmt, args);

main() {

	long long current_size_of_drive = 0LL;
	long long original_size_of_drive = 0LL;
	float factor;
	char *tmp;

	//current_size_of_drive = (long long)get_phys_size_of_drive(drive_name) * 1024LL;
	current_size_of_drive = (long long) 139979LL*1024LL;
	original_size_of_drive = (long long)130229520LL+526304LL+12582712LL;

	asprintf(&tmp, "current size: %lld KB", current_size_of_drive);

	asprintf(&tmp, "original size: %lld KB", original_size_of_drive);

	factor = ((float)current_size_of_drive/(float)original_size_of_drive);

	asprintf(&tmp, "factor: %.30f", factor);

	long long size = 312000000LL;
	asprintf(&tmp, "size: %lld - new size: %f - rounded size: %lld", size, size*factor, (long long)(size*factor));

I have now modified the code accordingly in rev [2932]. I have made a new delivery of packages for you to test under

Let me know if this fixes your issue.

comment:3 by wangtekkee, 12 years ago

Thanks, Bruno.

I have downloaded the fixed RPMs and tested.

It is working properly now.

comment:4 by Bruno Cornec, 12 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.