7 Replies Latest reply on Apr 17, 2018 7:47 AM by Peteski

    How to make provisioning select Drive 1 instead of drive 0

    fifo Apprentice

      I got some new HP Pro-books with 2 drives (SSD+HDD). For some reason system detects the HDD (Data) is as disk 0 and SSD (system) as disk 1.

      I need to provision those devices, but can't figure out how to make landesk provisioning install OS on SSD (disk 1)

      It always select the HDD marked as disk 0 as a system disk and install OS there.

       

      Of course I could remove the HDD from the notebook, but it's not the way I want to solve it.

      Thank you for help.

        • 1. Re: How to make provisioning select Drive 1 instead of drive 0
          Aaron_Day SupportEmployee

          Hello,

           

          The option to select the Disk is under the Pre-OS Installation section of the template. If the system is identifying the SSD as Disk 1, then you would want to enter 1 into this field here:

           

          Select Drive.png

          The template would then create the partitions on that disk.

           

          Aaron

          1 of 1 people found this helpful
          • 2. Re: How to make provisioning select Drive 1 instead of drive 0
            fifo Apprentice

            Hello Aaron,

             

            thank you for answer.

            Actually it's just half of solution, since from my testing came out that it's also necessary to reflect disk1 in command-line parameters on deploy stage.

            1 of 1 people found this helpful
            • 3. Re: How to make provisioning select Drive 1 instead of drive 0
              Peteski Apprentice

              You could add IF (or IF/ELSE) conditions at the start of the OS installation and run a file like diskpart or execute a script as part of the IF.

               

              This would use whatever logic you want, e.g. look at the number of installed disks or available drive letters to determine that you have a second local drive available etc and thus install to drive 1 instead of drive 0.

               

              Diskpart can do this or maybe WMIC. I believe WMIC works natively in WinPE. Something like "wmic logicaldisk get caption" would list the available drive letters.

               

              After the various IF interations you'd run the deploy image action based on the return results.

              • 4. Re: How to make provisioning select Drive 1 instead of drive 0
                fifo Apprentice

                That sound interesting, I am using if/esle for some other steps, and it would be very interesting to use the way you metionet.

                Do you maybe have any existing example you could provide please?

                • 5. Re: How to make provisioning select Drive 1 instead of drive 0
                  Peteski Apprentice

                  In my case, I like to provision the OS boot drive at 150GB. But some systems only have 125GB SSDs. So I need to handle both. The way I handle it is during the Pro-OS, I have the following logic:

                   

                  Map drive P: to preferred server scripts dir

                  IF ([Execute File action] diskpart.exe /s P:\diskpart_150.txt ) = 0

                       Do nothing (this is ok)

                  Else

                       (Execute File action2 diskpart.exe /s P:\diskpart_FULL.txt  )

                   

                  So the first IF condition is to execute a file (diskpart.exe) with parameter to run a diskpart script. The script is standard diskpart stuff and the important part is it tries to set the primary partition size to 153600MB (150GB). The diskpart script will return a 0 if everything works ok. If the physical disk size is less than 150GB, the diskpart script will exit non-zero and thus run the ELSE condition. That second diskpart_Full.txt script has a single difference which leaves out the 150GB partition size, thus using all of the disk.

                   

                  In your case, assuming the computers you want to provision as such are the only units with more than one hard drive, you could put similar logic in place in the OS installation section:

                   

                  Map drive P: to preferred server scripts dir

                  IF ([Execute File action] diskpart.exe /s P:\check_drive1.txt ) = 0

                       Run OS Installation with /d:1 parameter.

                  Else

                       Run OS Installation with /d:0 parameter.

                   

                  The entire diskpart script for check_drive1.txt could literally just be "select disk 1". That should throw an error and drop you to the ELSE condition if there is only a single drive (drive 0). Just make sure you set the expected return value = 0 in the first IF condition and probably stop process the template if it fails.

                   

                  Does that make sense?

                  1 of 1 people found this helpful
                  • 6. Re: How to make provisioning select Drive 1 instead of drive 0
                    fifo Apprentice

                    That makes perfect sense. Thank you very much Sir!

                    • 7. Re: How to make provisioning select Drive 1 instead of drive 0
                      Peteski Apprentice

                      Awesome! glad to be of assistance.

                       

                      Don't forget to mark as answer if this answered your question so that others searching for the same issue can see the solution at the top.

                       

                      Best regards