SOLVED 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


    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


    And the error log


    Edite: I could dowload image multidisk before December versions

  • Moderator

    @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!

  • @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?

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

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

  • Moderator

    @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.

  • Moderator

    @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/ b/src/buildroot/package/fog/scripts/usr/share/fog/lib/
    index b3b0e9f..7b4acfa 100644
    --- a/src/buildroot/package/fog/scripts/usr/share/fog/lib/
    +++ b/src/buildroot/package/fog/scripts/usr/share/fog/lib/
    @@ -715,7 +715,7 @@ getValidRestorePartitions() {
             ls $imgpart >/dev/null 2>&1
             [[ $? -eq 0 ]] && valid_parts="$valid_parts $part"
    -    [[ -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/ b/src/buildroot/package/fog/scripts/usr/share/fog/lib/
    index b3b0e9f..05ec710 100644
    --- a/src/buildroot/package/fog/scripts/usr/share/fog/lib/
    +++ b/src/buildroot/package/fog/scripts/usr/share/fog/lib/
    @@ -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=""
  • Moderator

    @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.