-
Notifications
You must be signed in to change notification settings - Fork 53
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
Disks not shrinking #43
Comments
How did you run the script and from where? |
I ran the script on the local server as administrator via powershell using the following command: |
I'd advise running it from a remote machine, you'll pin the CPU on the server if you run it from there. Could you try running it remotely from a Win10 machine? |
I just checked with a remote system, the results are the same. |
Can you send me a direct mail at the email associated with my GitHub
account and I'll take this offline with you.
…On Wed, 21 Jul 2021 at 11:01, RickItum ***@***.***> wrote:
I just checked with a remote system, the results are the same.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#43 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE365OZ3NEGK27SVVCNFF2TTY2LHRANCNFSM5APWSC4A>
.
|
Hi @JimMoyle, we are having a similar issue with this script, running locally on a Server 2016 server. What's interesting is that when I run the From what I can tell the disk does not appear to be mounted after the script exits. I also verified that this isn't a permissions issue on the VHDX file or containing folder. Happy to help if you need additional info. Thanks EDIT: Not sure if this helps but I also notice that I get "cannot get partition information" in my log file.
|
So I think what is happening in my case is that the script is failing silently because PS C:\Scripts> $path = "D:\userprofile\fslogixcontainers\test\username_S-1-5-21-000000000-0000000000-0000000000-0000\Profile_username.vhdx"
PS C:\scripts> $mountedDisk = Mount-DiskImage -ImagePath $Path -PassThru
PS C:\scripts> $mounteddisk
Attached : False
BlockSize : 33554432
DevicePath :
FileSize : 7084179456
ImagePath : D:\userprofile\fslogixcontainers\test\username_S-1-5-21-000000000-0000000000-0000000000-0000\Profile_username.vhdx
LogicalSectorSize : 512
Number :
Size : 32212254720
StorageType : 3
PSComputerName : |
@4oo4 I did some trouble shooting with @RickItum and on the servers where the problem was occurring. The powershell integration with the windows disk subsystem wasn't working. Outside of the script on an elevated command prompt none of the following commands worked: Get-Disk Can you check if this is the same symptom you are seeing? If so let me know here. Also please let me know if you fix it. Jim |
from @RickItum This turned out to be the “Microsoft Storage Spaces SMP” (smphost) service that was disabled. After changing this to manual all the PowerShell commands work fine again, as well as the script! We cross referenced this with the other environment, this service was disabled as well. |
From what I can tell all those cmdlets appear to be working: PS C:\Windows\system32> get-disk
Number Friendly Name Serial Number HealthStatus OperationalStatus Total Size Partition
Style
------ ------------- ------------- ------------ ----------------- ---------- ----------
2 Msft Virtu... Healthy Online 30 GB MBR
0 VMware Vir... Healthy Online 50 GB MBR
1 VMware Vir... Healthy Online 1.95 TB GPT
PS C:\Windows\system32> get-physicaldisk
FriendlyName SerialNumber CanPool OperationalStatus HealthStatus Usage Size
------------ ------------ ------- ----------------- ------------ ----- ----
VMware Virtual disk False OK Healthy Auto-Select 50 GB
VMware Virtual disk False OK Healthy Auto-Select 1.95 TB
Msft Virtual Disk False OK Healthy Auto-Select 30 GB
PS C:\Windows\system32> get-volume
DriveLetter FileSystemLabel FileSystem DriveType HealthStatus OperationalStatus SizeRemaining Size
----------- --------------- ---------- --------- ------------ ----------------- ------------- ----
D Data NTFS Fixed Healthy OK 474.1 GB 1.95 TB
Z CD-ROM Healthy Unknown 0 B 0 B
A Removable Healthy Unknown 0 B 0 B
System Reserved NTFS Fixed Healthy OK 162.89 MB 500 MB
C NTFS Fixed Healthy OK 24.43 GB 49.51 GB
E Profile-abennett NTFS Fixed Healthy OK 24.88 GB 30 GB
PS C:\Windows\system32> get-partition
DiskPath: \\?\scsi#disk&ven_msft&prod_virtual_disk#2&1f4adffe&0&000002#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
1 E 1048576 30 GB IFS
DiskPath: \\?\scsi#disk&ven_vmware&prod_virtual_disk#5&1982005&0&000000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
1 1048576 500 MB IFS
2 C 525336576 49.51 GB IFS
DiskPath: \\?\scsi#disk&ven_vmware&prod_virtual_disk#5&1982005&0&000100#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
1 17408 128 MB Reserved
2 D 135266304 1.95 TB Basic
PS C:\Windows\system32> |
Looks like a different issue then. Can you email me some times you are available to the email acct. associated with this github account and I'll have a look. I'm on UK time btw. Jim |
Thanks @JimMoyle, I will do some more investigating and shoot you an email. This may be something to do with Server 2016, when I run the same |
The script is not shrinking out disks.
When running the script 1 time there is no output bit the disk is mounted.
After running the script again we get output like:
Attached : False
BlockSize : 33554432
DevicePath :
FileSize : 15573450752
ImagePath : U:\Containers\diskname.VHDX
LogicalSectorSize : 512
Number :
Size : 15728640000
StorageType : 3
PSComputerName :
after this the disk is still mounted and the disk did not shrunk.
The text was updated successfully, but these errors were encountered: