Opened 6 years ago

Closed 6 years ago

#577 closed defect (fixed)

Mondorestore miscalculates restore partition sizes

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

Description

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 6 years ago.
The monsorestore log
mountlist.original (248 bytes) - added by wangtekkee 6 years ago.
The mountlist

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by wangtekkee

The monsorestore log

Changed 6 years ago by wangtekkee

The mountlist

comment:1 Changed 6 years ago by bruno

  • Status changed from new to assigned

comment:2 Changed 6 years ago by bruno

  • Priority changed from normal to highest
  • Severity changed from normal to critical

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);
		va_end(args);
		printf("\n");
}


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);
	log_msg(tmp);
	free(tmp);

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

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

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

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

I have now modified the code accordingly in rev [2932]. I have made a new delivery of packages for you to test under ftp://ftp.mondorescue.org/test/rhel/5/x86_64/

Let me know if this fixes your issue.

comment:3 Changed 6 years ago by wangtekkee

Thanks, Bruno.

I have downloaded the fixed RPMs and tested.

It is working properly now.

comment:4 Changed 6 years ago by bruno

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.