OSDeploy / OSD

OSD Shared Functions
MIT License
132 stars 54 forks source link

New-OSDCloudUSB error when starting with a drive previously formatted with GPT #58

Closed skyblaster closed 1 year ago

skyblaster commented 1 year ago

Describe the bug Unable to run the New-OSDCloudUSB command without first re-formatting the flash drive with an MBR partition layout.

To Reproduce Steps to reproduce the behavior:

  1. Start with a USB flash drive with GPT formatting
  2. Run New-OSDCloudUSB
  3. Select inserted USB drive

Screenshots image

OSDeploy commented 1 year ago

I'm aware of this issue. It also happens with Rufus formatted drives. I don't have an ETA on when I can look into this as it probably doesn't happen that frequently. I can probably Throw a Warning that the drive has to be cleaned manually

skyblaster commented 1 year ago

I can make things work by using Get-Disk instead of Get-Disk.osd

    $GetUSBDisk = Get-Disk -Number $SelectDisk.Number
    if ($GetUSBDisk.PartitionStyle -eq 'GPT') {
        Write-Verbose '$GetUSBDisk | Set-Disk -PartitionStyle MBR'
        $GetUSBDisk | Set-Disk -PartitionStyle MBR -ErrorAction Stop
OSDeploy commented 1 year ago

Thanks for sharing. I'll review, but I don't have an ETA when I can look into this at this time.

OSDeploy commented 1 year ago

This issue has been resolved in the latest OSD OSDCloud release