[Mondo-devel] RHEL 7.2 mondorestore partitioning - patch

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Mondo-devel] RHEL 7.2 mondorestore partitioning - patch

William Montgomery
There is a problem on RHEL 7.2 with mondo-3.2.2-1.rhel7 during the
restore process if you have an MBR type disk and the mountlist
contains extended partitions.  I have identified the problems and have
attached two patch files that correct this issue.

The first problem is the "last_line_of_file(FDISK_LOG)"  results fail
during partitioning since the wrapper script "mr-parted2fdisk" does
not provide for flushing the output buffer of the fdisk program.  The
attached mindi patch fixes this.

The second problem is in mondo-prep.c function partition_drive() a
strcmp function is used to look for "MBR" in the string
part_table_fmt.  This always fails since the string contains
additional text.  The correct way is to use strstr to find a substring
within a string.  The attached mondo patch fixes this.

Regards,
Wm

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Mondo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mondo-devel

mondo-3.2.2-2mr_ep.patch (1K) Download Attachment
mindi-3.0.2-2mr_ep.patch (800 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Mondo-devel] RHEL 7.2 mondorestore partitioning - patch

Bruno Cornec-4
Hello William,

William Montgomery said on Mon, Jun 27, 2016 at 06:13:35PM -0400:
>The first problem is the "last_line_of_file(FDISK_LOG)"  results fail
>during partitioning since the wrapper script "mr-parted2fdisk" does
>not provide for flushing the output buffer of the fdisk program.  The
>attached mindi patch fixes this.

Thanks ! Applied. Rev 3591

>The second problem is in mondo-prep.c function partition_drive() a
>strcmp function is used to look for "MBR" in the string
>part_table_fmt.  This always fails since the string contains
>additional text.  The correct way is to use strstr to find a substring
>within a string.  The attached mondo patch fixes this.

Hummm. In fact I think the error is elswhere.

> part_table_fmt = which_partition_format(drivename);

This should return either MBR or GPT, which is now not the case anymore as I replaced it with a perl function but made a compatibility error :-(

So I did this instead to fix the issue:

Index: MondoRescue/bin/mr-disk-type
===================================================================
--- MondoRescue/bin/mr-disk-type        (rĂ©vision 3591)                                                                                    
+++ MondoRescue/bin/mr-disk-type        (copie de travail)                                                                                  
@@ -67,7 +67,8 @@                                                                                                                          
 if (defined $ARGV[0]) {                                                                                                                    
        foreach my $i (@ARGV) {                                                                                                            
                $ans = mr_disk_type($i);                                                                                                    
-               pb_log(0, "Device $i has a $ans partition type\n");                                                                        
+               pb_log(2, "Device $i has a $ans partition type\n");                                                                        
+               pb_log(0, "$ans\n");                                                                                                        
        }                                                                                                                                  
 }

This is rev 3592.

Thanks a lot for reporting this William, and provinding patches which makes solving the issue a breeze !
Greetings,
Bruno.
--
Open Source Profession, WW Linux Community Lead     http://www.hpintelco.net
HPE EMEA EG FLOSS Technology Strategist http://www.hpe.com/engage/opensource
FLOSS projects:    http://mondorescue.org         http://project-builder.org
Musique ancienne?   http://www.musique-ancienne.org  http://www.medieval.org

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Mondo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mondo-devel
Loading...