8000 DiskShrinkFailed · Issue #32 · FSLogix/Invoke-FslShrinkDisk · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

DiskShrinkFailed #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JungleJackNL opened this issue Jan 14, 2021 · 8 comments
Open

DiskShrinkFailed #32

JungleJackNL opened this issue Jan 14, 2021 · 8 comments

Comments

@JungleJackNL
Copy link

Hiya,

we have been using the script for a couple of months now and it really does it job well and fast. We do however sometimes get a DiskShrinkFailed in the logs. When this happens, the vhdx is still mounted on the server and even has a drive letter. When we unmount the disk everything works as normal and the next day the disc is picked up by the script again and the status is succesfull.

The strange part is, when it stays mounted, a drive letter is also assigned. Any idea how this happens? Or what might be the cause of the driveletter getting assinged, or maybe why the disc does not get unmounted if the diskshrink fails?

Thanks in advance.

@brillas81
Copy link

Hi,

Great script. I experienced "DiskShrinkFailed" in the logs as well. In my case, the most of VHDX. But, actually, the script is working well reducing these disks, even if the log is saying "DiskShrinkFailed".

Any idea?

Thanks!

@JimMoyle
Copy link
Contributor
JimMoyle commented Mar 4, 2021 via email

@mmueller-i
8000
tsure
Copy link

Hi Jim,

in my case the server is set to german language. I removed my reply and wanted to test the suggested fix from Issue #15 .

I have already worked around the issue. For now the following crude lines of code give me the correct string i guess:

$tmpfile = ((& pwd).path)+"\langtest.vhdx"
$dskpscript = ((& pwd).path)+"\langtest.txt"
Set-Content -Path $dskpscript -Value "CREATE VDISK FILE=""$tmpfile"" MAXIMUM=10"
Add-Content -Path $dskpscript -Value "SELECT VDISK FILE=""$tmpfile"""
Add-Content -Path $dskpscript -Value "COMPACT VDISK"
$result = DISKPART /s $dskpscript
($result -split "\n")[(($result -split "\n").Count)-1]
Remove-Item $tmpfile -Force

Greetings
Matthias

@brillas81
Copy link

Hi Jim,

In my case the server ISO is spanish.

Thanks!

@nairobi14
Copy link

our solution for german language

        if ($diskPartResult -like 'Die Datei f*r virtuelle Datentr*ger wurde von DiskPart erfolgreich komprimiert.') {
            $finalSize = Get-ChildItem $Disk.FullName | Select-Object -ExpandProperty Length
            $success = $true
            Remove-Item $tempFileName
        } 

for solutions in other language I would compact vdisk manualy
change output text of "compact disk" in script on line 1300

greetings
Jaro

@sbalay-ghtcge
Copy link
sbalay-ghtcge commented Dec 14, 2021

Hi,

I have same issue. Result is DiskShrinkFailed but diskpart make his work. The test disk shrank from 1.6Gb to around 500Mb.

In temp drive i have FslDiskPartProfile_"user".VHDX.txt and 30 FslDiskPartErrorProfile_"user".VHDX-"number".log.

I have also modified around line 1300 to match my locale (i have tested multiples things) ("DiskPart a correctement compact", "correctement compact", "DiskPart", "Correctement") .

But it looks like the program didnt read the log files and continue to try to shrink the file until reach the max loop number (and shrink 30 time the file).

I hope i m clear

Best regards

FslDiskPartProfile_user.VHDX.txt
FslDiskPartErrorProfile_user.VHDX-0.log
FslDiskPartErrorProfile_user.VHDX-1.log

@JimMoyle
Copy link
Contributor

Try changing it to:

DiskPart a correctement compacté le fichier de disque virtuel.

Jim

@sbalay-ghtcge
Copy link

Ok this solution is working well.

i was fearing that the "é" would cause problem so i didnt put the whole "DiskPart a correctement compacté le fichier de disque virtuel." in the program.

Thx a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
0