Bug deploying image in multidisk system


  • Developer

    Hi support,

    Finally I can upload images multidisk to the server. I have one question. If you have a multidisk computer, and in the first disk you have installed W7 with recovery partition, system partition and another one for data and the other disk Ubuntu, What type of image do you must setup in the image definition?

    -rwxrwxrwx  1 root root 1,0M feb 26 16:02 d1.mbr
    -rwxrwxrwx  1 root root 8,6M feb 26 16:02 d1p1.img
    -rwxrwxrwx  1 root root 5,0G feb 26 16:11 d1p2.img
    -rwxrwxrwx  1 root root  190 feb 26 16:02 d1.partitions
    -rwxrwxrwx  1 root root    0 feb 26 16:11 d2.has_grub
    -rwxrwxrwx  1 root root 1,0M feb 26 16:11 d2.mbr
    -rwxrwxrwx  1 root root   47 feb 26 16:13 d2.original.swapuuids
    -rwxrwxrwx  1 root root 1,4G feb 26 16:13 d2p1.img
    -rwxrwxrwx  1 root root  512 feb 26 16:13 d2p2.ebr
    -rwxrwxrwx  1 root root  512 feb 26 16:11 d2p5.ebr
    -rwxrwxrwx  1 root root  250 feb 26 16:11 d2.partitions
    
    

    When I try to download this image to the computer, I get different errors.

    If I setup the image type like “Other(99)”, the error that appears is

    0_1456504577235_Error_Other99_setup.png

    Ig I setup image like “Windows 7” or “Windows Other”, I can download the first disk image but when partclone try to download the first partition of the second disk fails because FOG tries to copy the d2p1.img file in /dev/sda1.

    Partclone error

    0_1456504907085_Error_Partclone_Windows_setup.png

    And the error log

    0_1456504927880_Error_Windows_setup.png

    Edite: I could dowload image multidisk before December versions


  • Developer

    @Fernando-Gietz Thanks for testing and reporting! Marking this solved now but please keep on testing an let us know if you find another issue with this - as we usually don’t have the setup to test multidisk stuff all the time!


  • Senior Developer

    @Fernando-Gietz Setup for Windows 7, I imagine. THough I’m still not certain resizable will work on a multidisk setup. At that point, it’d be good as is anyway.


  • Developer

    I have update the version and it seems that it works fine. The second disk is recovering the image. I need to do more test but windows 7 and windows 7 disks works fine.

    If I have in the first disk Windows7 and in the second disk Ubuntu, How do I setup the image type?


  • Senior Developer

    @Fernando-Gietz Push has been sent, just need to know if it is working now.


  • Senior Developer

    @Sebastian-Roth I went the route of the first patch. This should be all there now too.


  • Developer

    @Tom-Elliott Which way should we go with this you think?


  • Developer

    Thanks, Sebastian, for your quick answer ;)

    I will wait then for the definitive patch and test it.


  • Developer

    @Fernando-Gietz You definitely found a bug there. I could fix it but I am not absolutely sure why the script was written the way it is - there might be something I am not aware of. I’ll post two fixes here and we see what @Tom-Elliott thinks is the better solution.

    First possible patch would be to simply remove that check at the end of the function. The variable $restoreparts is just not empty when we get to the second disk. Do you remember why you used this check?

    diff --git a/src/buildroot/package/fog/scripts/usr/share/fog/lib/funcs.sh b/src/buildroot/package/fog/scripts/usr/share/fog/lib/funcs.sh
    index b3b0e9f..7b4acfa 100644
    --- a/src/buildroot/package/fog/scripts/usr/share/fog/lib/funcs.sh
    +++ b/src/buildroot/package/fog/scripts/usr/share/fog/lib/funcs.sh
    @@ -715,7 +715,7 @@ getValidRestorePartitions() {
             ls $imgpart >/dev/null 2>&1
             [[ $? -eq 0 ]] && valid_parts="$valid_parts $part"
         done
    -    [[ -z $restoreparts ]] && restoreparts=$(echo $valid_parts | uniq | sort -V)
    +    restoreparts=$(echo $valid_parts | uniq | sort -V)
     }
     # Makes all swap partitions and sets uuid's in linux setups
     #
    

    Second possible patch if you want to keep the check at the end of the function. Just empty $restoreparts every time this function is called:

    diff --git a/src/buildroot/package/fog/scripts/usr/share/fog/lib/funcs.sh b/src/buildroot/package/fog/scripts/usr/share/fog/lib/funcs.sh
    index b3b0e9f..05ec710 100644
    --- a/src/buildroot/package/fog/scripts/usr/share/fog/lib/funcs.sh
    +++ b/src/buildroot/package/fog/scripts/usr/share/fog/lib/funcs.sh
    @@ -677,6 +677,7 @@ getValidRestorePartitions() {
         [[ -z $disk ]] && handleError "No disk passed (${FUNCNAME[0]})\n   Args Passed: $*"
         [[ -z $disk_number ]] && handleError "No disk number passed (${FUNCNAME[0]})\n   Args Passed: $*"
         [[ -z $imagePath ]] && handleError "No image path passed (${FUNCNAME[0]})\n   Args Passed: $*"
    +    [[ ! -z $restoreparts ]] && restoreparts=""
         local valid_parts=""
         local parts=""
         local part=""
    
    

  • Developer

    @Fernando-Gietz Please don’t use OS type “Other (99)”. Unfortunately there are a lot of checks that don’t consider osid=99. @Tom-Elliott Should we get rid of 99 altogether? So many switch/case statements that miss on setting variables correctly when osid=99…

    Please try using Windows 7 for example! FOG should be able to detect the GRUB bootloader on the second disk even if OSID is not set to Linux.


Log in to reply
 

374
Online

38976
Users

10712
Topics

101675
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.