MrEprise Posted November 21, 2013 Posted November 21, 2013 I'm currently doing some maintenance/housekeeping to our Hyper-V servers and someone (I think it may have been a previous member of staff in our department) has mounted a VHD on one of the servers. However, because Windows doesn't seem to identify the VHD that was used, I am unable to verify that the drive is still in use somewhere before I go prodding/moving/deleting anything. Does anyone know how I can find this out please?
jonnykewell1 Posted November 21, 2013 Posted November 21, 2013 can you map a drive letter to the VHD so it appears in computer and see if you can identify any of the files on it? 1
MrEprise Posted November 21, 2013 Author Posted November 21, 2013 Thanks. I tried this earlier, but it seems I didn't delve deep enough and it turns out to contain the remnants of a Spiceworks install we don't use anymore.
jonnykewell1 Posted November 21, 2013 Posted November 21, 2013 so if that's all that's on it can you not detach the VHD. I'm sure it won't take long for someone to come to you and say something isn't working. Do you know where the VHD is mounted from so you can easily remount it?
AngryTechnician Posted November 21, 2013 Posted November 21, 2013 (edited) If you are on Server 2012 or 2012 R2, you can get it in PowerShell: PS C:\> Get-VHD -DiskNumber 5 Requires you to know the disk number according to the volume manager: you can see this in Disk Management, or by running Get-Partition with no parameters in PowerShell (need to run as Admin for that one). EDIT: Just realised there's an even easier way: when you right-click the mounted disk in Disk Management and click Detach VHD, it shows the path on the confirmation dialog, at least on Windows 8.1. Edited November 21, 2013 by AngryTechnician 1
MrEprise Posted November 21, 2013 Author Posted November 21, 2013 (edited) That didn't work, just comes back with "Get-VHD : The parameter is not valid. Windows cannot find a mounted virtual hard disk with the specified disk number." despite it clearly being Disk 2 and I'm 100% sure its a mounted VHD as not only does it gives the option to detach it but shows a blue disk icon instead of a grey one in Disk Management. EDIT: Another facepalm moment (maybe) - clicking "Detach VHD" not only gives me a confirmation to do it, but also tells me its filename and path. I avoided doing that in case the VHD was detrimental to another servers operation. EDIT 2:Just seen your edit. Seems like an odd place to put that to me but typical Microsoft I suppose. Edited November 21, 2013 by MrEprise
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now