• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Wrong Partition is mounted during deployment. (FOG 1.5.7.56)

    Scheduled Pinned Locked Moved
    FOG Problems
    2
    11
    644
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • george1421G
      george1421 Moderator
      last edited by

      I’m currently building a 2004 reference image in my MDT environment. I’ve kind of held off because of the issues around 2004. But lets see if I can duplicate what you see. With MDT I have it setup to not create the recovery partition (partition 4) by default. Lets see if everything works out of the box with 2004 and deploying using a complex post download script that I have.

      I do see a number of folks reporting issues with FOG and cloning a 2004 based image so there may be some changes MS did to the disk structure.

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

      Greg PlamondonG 1 Reply Last reply Reply Quote 0
      • Greg PlamondonG
        Greg Plamondon Testers
        last edited by Greg Plamondon

        well, I thought I had it licked but here is the issue with Windows 10 version 2004 MBR image.
        It creates 3 partitions but they are in the wrong order.

        Fog mounts /dev/sda3 which, in this case, is partition 3 the Recovery partition.

        alt text

        Here is the lsblk for the VM golden image.

        alt text

        george1421G 1 Reply Last reply Reply Quote 0
        • Greg PlamondonG
          Greg Plamondon Testers @george1421
          last edited by

          @george1421 do you mind sharing your complex post download script with me 🙂

          george1421G 1 Reply Last reply Reply Quote 0
          • george1421G
            george1421 Moderator @Greg Plamondon
            last edited by

            @Greg-Plamondon said in Wrong Partition is mounted during deployment. (FOG 1.5.7.56):

            Fog mounts /dev/sda3 which, in this case, is partition 3 the Recovery partition.

            Why is this the case. What makes FOG pick /dev/sda3. I think that may be the question here.

            The recovery partition being the last parition on the disk may be the issue with expanding or contracting the disk using “single disk resizable” within FOG in regards to 2004.

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

            Greg PlamondonG 1 Reply Last reply Reply Quote 0
            • george1421G
              george1421 Moderator @Greg Plamondon
              last edited by

              @Greg-Plamondon said in Wrong Partition is mounted during deployment. (FOG 1.5.7.56):

              do you mind sharing your complex post download script with me

              Sorry I will not do that because that is our secret sauce. But I can tell you I’ve documented it in the tutorials.

              https://forums.fogproject.org/topic/11126/using-fog-postinstall-scripts-for-windows-driver-injection-2017-ed

              And in parts 3, 4 and 5 here:
              https://forums.fogproject.org/topic/7740/the-magical-mystical-fog-post-download-script

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

              1 Reply Last reply Reply Quote 0
              • george1421G
                george1421 Moderator
                last edited by

                I was able to capture Windows 10 2004 UEFI from a source system with a 70GB disk and deploy it to a target system (VM) with 50GB disk. It deployed/booted and resized the disk without issue. Again my base image doesn’t have the recovery partition. Next week I schedule a new build task in MDT and leave the recovery partition in place at the end of the partition chain to see what happens on a deploy and resize. But for my use case 2004 works correctly deploying to a VM.

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                1 Reply Last reply Reply Quote 0
                • Greg PlamondonG
                  Greg Plamondon Testers @george1421
                  last edited by Greg Plamondon

                  @george1421
                  Here is my fog.postdownload

                  #!/bin/bash
                  . /usr/share/fog/lib/funcs.sh
                  curl -A "" -Lkso /tmp/hinfo.sh "${web}/service/hostinfo.php?mac=$mac"
                  . /tmp/hinfo.sh
                  [[ -z $postdownpath ]] && postdownpath="/images/postdownloadscripts/"
                  case $osid in
                      5|6|7|9)
                          clear
                          [[ ! -d /ntfs ]] && mkdir -p /ntfs
                          getHardDisk
                          if [[ -z $hd ]]; then
                              handleError "Could not find hdd to use"
                  
                          fi
                          getPartitions $hd
                          for part in $parts; do
                              true
                          done
                          dots "Mounting partition $part"
                          ntfs-3g -o force,rw $part /ntfs >/dev/null 2>&1
                          if [[ ! $? -eq 0 ]]; then
                              echo "Failed"
                              debugPause
                              handleError "Failed to mount $part ($0)\n    Args: $*"
                          fi
                          echo "Done"
                          case $othertag in
                             [Bb][Aa][Yy])
                                  . ${postdownpath}fog.log
                                  . ${postdownpath}fog.replace-files_bay
                                  . ${postdownpath}fog.drivers
                                  . ${postdownpath}fog.ad_bay
                                  . ${postdownpath}fog.DesktopInfo
                                  ;;
                             [Mm][Pp][Mm][Ii])
                                  . ${postdownpath}fog.log
                                  . ${postdownpath}fog.replace-files_mpmi
                                  . ${postdownpath}fog.drivers
                                  . ${postdownpath}fog.ad_mpmi
                                  . ${postdownpath}fog.DesktopInfo
                                  ;;
                             [Hh][Oo][Mm][Ee])
                                  . ${postdownpath}fog.log
                                  . ${postdownpath}fog.replace-files_home
                                  . ${postdownpath}fog.drivers
                                  ;;
                             [Mm][Tt][Ss])
                                  . ${postdownpath}fog.log
                                  . ${postdownpath}fog.replace-files_fog
                                  . ${postdownpath}fog.drivers
                                  . ${postdownpath}fog.ad_bay
                                  . ${postdownpath}fog.DesktopInfo
                                  ;;
                               *)
                  

                  we use the $othertag to do different things for our sister companies.

                  How is $part determined?

                  george1421G 2 Replies Last reply Reply Quote 0
                  • george1421G
                    george1421 Moderator @Greg Plamondon
                    last edited by

                    @Greg-Plamondon You might want to update your partition detection script to the one used here:

                    #!/bin/bash
                    . /usr/share/fog/lib/funcs.sh
                    [[ -z $postdownpath ]] && postdownpath="/images/postdownloadscripts/"
                    case $osid in
                        5|6|7|9)
                            clear
                            [[ ! -d /ntfs ]] && mkdir -p /ntfs
                            getHardDisk
                            if [[ -z $hd ]]; then
                                handleError "Could not find hdd to use"
                            fi
                            getPartitions $hd
                            for part in $parts; do
                                umount /ntfs >/dev/null 2>&1
                                fsTypeSetting "$part"
                                case $fstype in
                                    ntfs)
                                        dots "Testing partition $part"
                                        ntfs-3g -o force,rw $part /ntfs
                                        ntfsstatus="$?"
                                        if [[ ! $ntfsstatus -eq 0 ]]; then
                                            echo "Skipped"
                                            continue
                                        fi
                                        if [[ ! -d /ntfs/windows && ! -d /ntfs/Windows && ! -d /ntfs/WINDOWS ]]; then
                                            echo "Not found"
                                            umount /ntfs >/dev/null 2>&1
                                            continue
                                        fi
                                        echo "Success"
                                        break
                                        ;;
                                    *)
                                        echo " * Partition $part not NTFS filesystem"
                                        ;;
                                esac
                            done
                            if [[ ! $ntfsstatus -eq 0 ]]; then
                                echo "Failed"
                                debugPause
                                handleError "Failed to mount $part ($0)\n    Args: $*"
                            fi
                            echo "Done"
                            debugPause
                            . ${postdownpath}fog.copydrivers
                            # . ${postdownpath}fog.updateunattend
                            umount /ntfs
                            ;;
                        *)
                            echo "Non-Windows Deployment"
                            debugPause
                            return
                            ;;
                    esac
                    

                    This one uses a bit more intelligence to find which partition actually has windows on it. I think your script is just picking the last partition and calling it good enough.

                    ref: https://forums.fogproject.org/topic/11126/using-fog-postinstall-scripts-for-windows-driver-injection-2017-ed

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                    Greg PlamondonG 1 Reply Last reply Reply Quote 0
                    • george1421G
                      george1421 Moderator @Greg Plamondon
                      last edited by

                      @Greg-Plamondon said in Wrong Partition is mounted during deployment. (FOG 1.5.7.56):

                               for part in $parts; do
                                   true
                               done
                      

                      This is the section that needs tweaking on your script. This bit really doesn’t do anything, It loops through the partitions and says true.

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                      1 Reply Last reply Reply Quote 0
                      • Greg PlamondonG
                        Greg Plamondon Testers @george1421
                        last edited by

                        @george1421 said in Wrong Partition is mounted during deployment. (FOG 1.5.7.56):

                        @Greg-Plamondon You might want to update your partition detection script to the one used here:

                        #!/bin/bash
                        . /usr/share/fog/lib/funcs.sh
                        [[ -z $postdownpath ]] && postdownpath="/images/postdownloadscripts/"
                        case $osid in
                            5|6|7|9)
                                clear
                                [[ ! -d /ntfs ]] && mkdir -p /ntfs
                                getHardDisk
                                if [[ -z $hd ]]; then
                                    handleError "Could not find hdd to use"
                                fi
                                getPartitions $hd
                                for part in $parts; do
                                    umount /ntfs >/dev/null 2>&1
                                    fsTypeSetting "$part"
                                    case $fstype in
                                        ntfs)
                                            dots "Testing partition $part"
                                            ntfs-3g -o force,rw $part /ntfs
                                            ntfsstatus="$?"
                                            if [[ ! $ntfsstatus -eq 0 ]]; then
                                                echo "Skipped"
                                                continue
                                            fi
                                            if [[ ! -d /ntfs/windows && ! -d /ntfs/Windows && ! -d /ntfs/WINDOWS ]]; then
                                                echo "Not found"
                                                umount /ntfs >/dev/null 2>&1
                                                continue
                                            fi
                                            echo "Success"
                                            break
                                            ;;
                                        *)
                                            echo " * Partition $part not NTFS filesystem"
                                            ;;
                                    esac
                                done
                                if [[ ! $ntfsstatus -eq 0 ]]; then
                                    echo "Failed"
                                    debugPause
                                    handleError "Failed to mount $part ($0)\n    Args: $*"
                                fi
                                echo "Done"
                                debugPause
                                . ${postdownpath}fog.copydrivers
                                # . ${postdownpath}fog.updateunattend
                                umount /ntfs
                                ;;
                            *)
                                echo "Non-Windows Deployment"
                                debugPause
                                return
                                ;;
                        esac
                        

                        This one uses a bit more intelligence to find which partition actually has windows on it. I think your script is just picking the last partition and calling it good enough.

                        ref: https://forums.fogproject.org/topic/11126/using-fog-postinstall-scripts-for-windows-driver-injection-2017-ed

                        Thanks, That fixed it!

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post

                        215

                        Online

                        12.0k

                        Users

                        17.3k

                        Topics

                        155.2k

                        Posts
                        Copyright © 2012-2024 FOG Project