Opened 13 years ago
Closed 13 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 |
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)
Change History (6)
by , 13 years ago
Attachment: | mondorestore.log added |
---|
comment:1 by , 13 years ago
Status: | new → assigned |
---|
comment:2 by , 13 years ago
Priority: | normal → highest |
---|---|
Severity: | normal → 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 by , 13 years ago
Thanks, Bruno.
I have downloaded the fixed RPMs and tested.
It is working properly now.
comment:4 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
The monsorestore log