Ticket #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
Change History
Changed 18 months ago by wangtekkee
-
attachment
mondorestore.log
added
comment:2 Changed 17 months 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.

The monsorestore log