Jump to content











Photo
* * * * * 1 votes

vMount

vhd

  • Please log in to reply
164 replies to this topic

#126 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 26 May 2019 - 05:56 PM

To illustrate post above about "hidden" volumes or rather "not mountable" partitions.

 

Disk 2 is a GPT disks with 2 partitions.

Still, the first partition does not appear under partitions nor under volumes.

This first Partition (i.e harddisk2\partition1) is of type "SYSTEM" (C12A7328-F81F-11D2-BA4B-00A0C93EC93B) which "by the book" means it is not mountable.

 

Still, I could do vmount-win64 assign x: \device\harddisk2\partition1 (as a dos device) and use x: while in my dos "session".

By the way, I believe winntsetup uses that trick to map EFI FAT32 partitions.

But I could not do vmount-win64 assign x:\ \\?\Volume{GUID}\ (as a volume) as this partition does not have a volume guid.

The only way to use this partition as a volume would be to change its part type with vmount-win64 changeparttypegpt (touched here).

>vmount-win64 disks
DiskNr;SN;ProductId;Size;Type;Removable
0;[01020304];WDC_WDS120G2G0A-00JH30;114480MB;SATA;NON-REMOVABLE
1;[56B682DC];Hitachi_HDP725016GLA380;152627MB;SATA;NON-REMOVABLE
2;[56B682DC];Virtual_Disk;256MB;UNKNOWN;NON-REMOVABLE

>vmount-win64 partitions
Drive;VolName;FS;Device;Size
C:;[SYSTEME];NTFS;\device\harddisk0\partition2;114126MB
E:;[DATA];NTFS;\device\harddisk1\partition1;152624MB
F:;[];NTFS;\device\harddisk2\partition2;126MB
R:;[RAMDRIVE];NTFS;\device\imdisk0;1023MB

>vmount-win64 volumes
VolumeGuid;Drive
\\?\Volume{e26e7b15-122a-11e7-82bf-806e6f6e6963}\;
\\?\Volume{876ebd81-ce10-11e8-8334-94de80c2a41e}\;E:\
\\?\Volume{6c53b84d-7eee-11e9-8347-94de80c2a41e}\;F:\
\\?\Volume{e26e7b16-122a-11e7-82bf-806e6f6e6963}\;C:\
\\?\Volume{1b04c823-6f36-11e9-8347-94de80c2a41e}\;
\\?\Volume{1b04cb1f-6f36-11e9-8347-94de80c2a41e}\;
\\?\Volume{05852cdd-6f3f-11e9-8347-94de80c2a41e}\;
\\?\Volume{25a1075f-6f54-11e9-8347-94de80c2a41e}\;
\\?\Volume{c3ccf19b-9cbc-11e8-8325-806e6f6e6963}\;D:\

>vmount-win64 devices
Device;Drive
\device\harddisk2\partition1;
\device\harddisk2\partition2;F:
\device\harddisk0\partition1;
\device\harddisk0\partition2;C:
\device\harddisk1\partition1;E:

>vmount-win64 disklayout 2
PartNr;StartingOffset;PartLength;PartId;PartType;PartAttributes
1;65536;134217728;{6C53B84B-7EEE-11E9-8347-94DE80C2A41E}        {C12A7328-F81F-11D2-BA4B-00A0C93EC93B}  0x00000000000000
00
2;134283264;133169152;{6C53B84D-7EEE-11E9-8347-94DE80C2A41E}    {EBD0A0A2-B9E5-4433-87C0-68B6B72699C7}  0x00000000000000
00

  • ReTokener likes this

#127 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 181 posts

Posted 26 May 2019 - 06:05 PM

Thank you Erwan

this was what I was looking for.

Great tool vMount

 

T.

 

 

 

 


  • erwan.l likes this

#128 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 26 May 2019 - 06:14 PM

Re reading my previous post, just noticed there a minor "miss" in the csv display of disklayout.

This is fixed, and zip was reuploaded (no version change).



#129 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 181 posts

Posted 27 May 2019 - 09:10 AM

Dear Erwan

 

Using the diskpart command "list vol" it returns a list of volumes numbered from zero to n.

Is there a way to retrieve these (unique?) numberes by vMount?

 

if vMount lists "devices" is there a way to display disk-size? (or offset)

it was a great advantage to have disk-size to determin hidden volumes.

 

 

Regards   T.

 

 

 



#130 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 27 May 2019 - 11:40 AM

 

Dear Erwan

 

Using the diskpart command "list vol" it returns a list of volumes numbered from zero to n.

Is there a way to retrieve these (unique?) numberes by vMount?

 

if vMount lists "devices" is there a way to display disk-size? (or offset)

it was a great advantage to have disk-size to determin hidden volumes.

 

 

Regards   T.

 

 

 

 

 

Hi Retokener,

 

Numbering the volumes and providing the disk size is no pb :expect it soon.

Beware that number will start with 0 and that it should not be confused with partition number with starts with 1.

 

I should also be able to provide the disk size when calling devices.

Although I suspect that some devices (ramdisk, imdisk) could be challenging.

 

About the offset, I had initially added it when calling partitions but finally felt this information was really useful only in disklayout.

 

Regards,

Erwan


  • ReTokener likes this

#131 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 181 posts

Posted 27 May 2019 - 11:58 AM

 

Hi Erwan

 

Numbering the volumes and providing the disk size is no pb :expect it soon.

(...)

I should also be able to provide the disk size when calling devices.

I'm looking forward to this.

 

T.



#132 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 181 posts

Posted 27 May 2019 - 07:06 PM

 

 

 

One thing I noticed:

assigning a letter [F:\] to a hidden volume makes drive [F:] visible.

if you list partitions / devices: drive [F:] is present.

 

removing mountpoint [F:] hides it from partitions / devices but drive [F:\] still present in volumes list.

you can even assgn letter [F:\] to another volume.

 

removing mountpoint [F:\] removes drive [F:] completely from partitions / devices / volumes.

 

is this intended?

 

Regards   T.

 

 



#133 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 27 May 2019 - 07:18 PM

Version 1.0.0.11 out.

 

More informations provided when calling volumes (volname, fs, and size) or devices (size).

 

I am not yet fully certain with the numbering in volumes.

This is a simple incremental numbering, not particular order, as opposed (may be?) to diskpart list vol.

>vmount-win64 devices
Device;Drive;size
\device\harddisk2\partition1;;128MB;
\device\harddisk2\partition2;F:;127MB;
\device\harddisk0\partition1;;350MB;
\device\harddisk0\partition2;C:;114126MB;
\device\harddisk1\partition1;E:;152625MB;

>vmount-win64 volumes
VolumeGuid;Drive;VolName;FS;Size
0;\\?\Volume{e26e7b15-122a-11e7-82bf-806e6f6e6963}\;;[reserved];NTFS;349MB;
1;\\?\Volume{876ebd81-ce10-11e8-8334-94de80c2a41e}\;E:\;[DATA];NTFS;152624MB;
2;\\?\Volume{6c53b84d-7eee-11e9-8347-94de80c2a41e}\;F:\;[TEST];NTFS;126MB;
3;\\?\Volume{e26e7b16-122a-11e7-82bf-806e6f6e6963}\;C:\;[SYSTEME];NTFS;114126MB;


  • ReTokener likes this

#134 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 27 May 2019 - 07:21 PM

 

 

 

 

One thing I noticed:

assigning a letter [F:\] to a hidden volume makes drive [F:] visible.

if you list partitions / devices: drive [F:] is present.

 

removing mountpoint [F:] hides it from partitions / devices but drive [F:\] still present in volumes list.

you can even assgn letter [F:\] to another volume.

 

removing mountpoint [F:\] removes drive [F:] completely from partitions / devices / volumes.

 

is this intended?

 

Regards   T.

 

 

Assign and remove accepts either a dos device or a mount point (i.e a volume).

You indeed noticed the difference between x: and x:\ as a parameter for these 2 functions.

In the first case, we are dealing with a dos device (whether using assign or remove).

In the second case, we are dealing with a volume (whether using assign or remove).

Removing a dos device - "drive letter" is not removing a mount point - "drive letter".

 

Also, the api (DefineDosDevice) to remove a dos device does not sent back any error code / always reports OK.

I did not yet work around that.

vmount assign x: \device\harddiskX\partitionY
vmount assign x:\ \\?\Volume{GUID}\
vmount remove x:
vmount remove mount_point(e.g x:\ or c:\mount\)

As a whole, working with volumes (when there is one) is better.

I would only recommend to work with dos devices as a last resort.

Thus there are times where a partition will only be reachable thru devices and not thru volumes - like \device\harddisk2\partition1 below .

 

2 options then : 

-mount it as dos device (with x:)

or

-change the partition type to make it seen as a volume (and mount is a volume with x:\)

C:\Users\erwan\Documents\-= SOURCES =-\delphi\system\clone_disk>vmount-win64 devices
Device;Drive;size
\device\harddisk2\partition1;;128MB;
\device\harddisk2\partition2;F:;127MB;
\device\harddisk0\partition1;;350MB;
\device\harddisk0\partition2;C:;114126MB;
\device\harddisk1\partition1;E:;152625MB;

C:\Users\erwan\Documents\-= SOURCES =-\delphi\system\clone_disk>vmount-win64 volumes
VolumeGuid;Drive;VolName;FS;Size
0;\\?\Volume{e26e7b15-122a-11e7-82bf-806e6f6e6963}\;;[reserved];NTFS;349MB;
1;\\?\Volume{876ebd81-ce10-11e8-8334-94de80c2a41e}\;E:\;[DATA];NTFS;152624MB;
2;\\?\Volume{6c53b84d-7eee-11e9-8347-94de80c2a41e}\;F:\;[TEST];NTFS;126MB;
3;\\?\Volume{e26e7b16-122a-11e7-82bf-806e6f6e6963}\;C:\;[SYSTEME];NTFS;114126MB;


#135 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 181 posts

Posted 27 May 2019 - 08:28 PM

 

Dear Erwan

thanks a lot for great support and explanations.

 

Version 1.0.0.11 has developed very well.

There will be a solution for volume numbering.

 

Keep up the good work! [Thumbs Up]

 

Regards   T.

 

 

 



#136 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 181 posts

Posted 27 May 2019 - 08:56 PM

 
 

Just tested

Adding VolName and size to the ouput makes it easy to determine the desired volume. :thumbsup:

 

Regards T.

 

 

 

 

 

 



#137 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 181 posts

Posted 14 June 2019 - 05:26 PM

 

 

 

Dear Erwan

Assuming you had used vMount to expand a virtual disk containing a volume.
The physical size would increase. There would be an unused space at the end of the disk.
What would be the easiest way to undo this extension?
Shrinking the volume would not be neccessary.
Is there a chance to do this by vMount?

 

Regards   T.



#138 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 14 June 2019 - 05:32 PM

Dear Erwan
Assuming you had used vMount to expand a virtual disk containing a volume.
The physical size would increase. There would be an unused space at the end of the disk.
What would be the easiest way to undo this extension?
Shrinking the volume would not be neccessary.
Is there a chance to do this by vMount?
 
Regards   T.

Hi Retokener,
Have you tried the compact option?
I am afk so cannot try right now but that may be what you are looking for.
Regards,
Erwan

#139 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 181 posts

Posted 14 June 2019 - 07:27 PM

 

 

 

Thank you Erwan

for the fast reply.

 

COMPACT does not shrink the physical edit: VIRTUAL size of the vDisk.

a picture might show you more:

Zwischenablage012.jpg
Disk 8 is ~200gb and I want to trim it to fit the Volume [F:\]. ~20gb

 

Details by DISKPART:

select vdisk file="B:\ADasd.vhd"
detail vdisk

 

Geträtetyp-ID: 2 (Virtuelle Festplatte)
Hersteller-ID: {EC984AEC-A0F9-47E9-901F-71415A66345B} (Microsoft Corporation)
Status: Hinzugefügt
Virtuelle Größe:  195 GB
Physikalische Größe:   76 MB
Dateiname: B:\ADasd.vhd
Ist untergeordnet: Nein
Übergeordneter Dateiname:
Zugeordnete Datenträgernummer: Nicht gefunden.

 

actually there is just a Powershell console command

Resize-VHD -Path $vDisk -ToMinimumSize

to shrink the physical edit: VIRTUAL size. But it requires Hyper-V enabled.

 

If vMount is able to expand a vDisk it might be able to undo / shrink it.

 

Regards   T.

 

 

 

Attached Thumbnails

  • Zwischenablage01.jpg


#140 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 181 posts

Posted 15 June 2019 - 09:15 AM

 

 

 

sorry, I exchanged the terms.

now the previous post is corrected.

 

T.



#141 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 15 June 2019 - 09:24 AM

sorry, I exchanged the terms.
now the previous post is corrected.
 
T.


Try resizevhd.
If not compactvhd nor resizevhd then I will be looking for another virtdisk function I may have overlooked.

#142 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 181 posts

Posted 15 June 2019 - 10:17 AM

 

2019-06-15 12:02:25 : Command: B:\Temp\vMount.exe resizevhd B:\ADasd.vhd
2019-06-15 12:02:25 : Return: OpenVirtualDisk OK
2019-06-15 12:03:55 : Command: select vdisk file="B:\ADasd.vhd"
detail vdisk
2019-06-15 12:03:55 : Return:
Microsoft DiskPart-Version 6.1.7601
Copyright © 1999-2008 Microsoft Corporation.
Auf Computer: PC64
2019-06-15 12:03:55 : Return:
Die Datei für virtuelle Datenträger wurde von DiskPart erfolgreich ausgewählt.

Geträtetyp-ID: 2 (Virtuelle Festplatte)
Hersteller-ID: {EC984AEC-A0F9-47E9-901F-71415A66345B} (Microsoft Corporation)
Status: Hinzugefügt
Virtuelle Größe:  195 GB
Physikalische Größe:   76 MB
Dateiname: B:\ADasd.vhd
Ist untergeordnet: Nein
Übergeordneter Dateiname:
Zugeordnete Datenträgernummer: Nicht gefunden.
 

 

 

 

 

 vMount returns one line only: OpenVirtualDisk OK

but the virtual size is unchanged.

I guess (from other command returns) a line should follow like:  resizeVHD OK

 

Regards   T.

 

 

 

 

 

 



#143 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 181 posts

Posted 15 June 2019 - 10:29 AM

 

 

 

Dear Erwan

 

Trying to resize a VHD by CloneDisk.

CloneDisk crashes when a vhd is selected.

CloneDisk error.jpg

 

Maybe there is a context, so I post this here instead of the CloneDisk thread.

 

Regards   T.



#144 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 15 June 2019 - 03:37 PM

 vMount returns one line only: OpenVirtualDisk OK

but the virtual size is unchanged.

I guess (from other command returns) a line should follow like:  resizeVHD OK

 

Regards   T.

 

 

Strange behavior as indeed you should get ResizeVHD OK : looking into this.

 

expandvhd  function - will resize the backing store file and virtual disk - opposite of resizevhd - offline operation

resizevhd function - will resize the backing store file and virtual disk - opposite of expand - offline operation
compactvhd - will resize the backing store file - will work on dynamic vhd only - offline operation
 
At first look, I would say that reducing the backing store file is not possible with a fixed disk.
But I will confirm that.
 
Although nothing is never impossible and I know that modifying the header of the disk to a smaller size and reducing the file to a small size as well is possible thus it is a risky operation if you dont take extra care (you should reduce the file to a size slightly above your volume/virtual disk).
 
EDIT : i was able to resize a 1024MB vhdX file with a 512MB partition to 512MB using resizevhd.
Thus, redownload latest CloneDisk 32bits and vmount as I have fixed what I believe some possible issues (or lack of error checking) here and there.

  • ReTokener likes this

#145 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 181 posts

Posted 15 June 2019 - 08:59 PM

 

 

 

Dear Erwan

just tried latest build of vMount.

 

vMount can resize virtual disk: 

- if vDisk has VHDX-format

- if Operating System supports VHDX-files.

- Hyper-V is not required.

 

I could not resize VHD-files with vMount.

The tests above were only made with VHD-files on Win7 and Win10, so fail was to be expected.

 

Sorry for taking your precious time and thank you for great support.

 

Sincerely   T.



#146 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 16 June 2019 - 09:22 AM

Dear Erwan
 
Trying to resize a VHD by CloneDisk.
CloneDisk crashes when a vhd is selected.
attachicon.gifCloneDisk error.jpg
 
Maybe there is a context, so I post this here instead of the CloneDisk thread.
 
Regards   T.


That should be fixed in latest clonedisk 32 bits version.
You should now getting a message saying "operation not supported".

#147 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 16 June 2019 - 09:26 AM

Dear Erwan
just tried latest build of vMount.
 
vMount can resize virtual disk: 
- if vDisk has VHDX-format
- if Operating System supports VHDX-files.
- Hyper-V is not required.
 
I could not resize VHD-files with vMount.
The tests above were only made with VHD-files on Win7 and Win10, so fail was to be expected.
 
Sorry for taking your precious time and thank you for great support.
 
Sincerely   T.


I will probably deliver soon a new version working around that OS limitation.
For now only vhdX are supported with resizevhd.

No neew to be sorry : we are making a great team and vmount gets improved thanks to you.

#148 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 16 June 2019 - 01:06 PM

Released version 1.0.0.12 to handle resizing of fixed VHD's.

 

Idea is pretty simple :

-figure out how much you can truncate your backend file (a number above the size of your partition+starting offset)

-truncate your vhd which at this point will lose its vhd footer and therefore become invalid

-add a footer back

 

Risky but that's the only way I could think of for now to avoid having to clone your source vhd to a smaller vhd.

>vmount-win64 createfixedvhd e:\test.vhd 1024
createvhd ok

>vmount-win64 getvirtualdiskinfo e:\test.vhd
Identifier:{00000000-0000-0000-0000-000000000000}
BlockSize:0
PhysicalSize:1073742336
SectorSize:512
VirtualSize:1073741824
VendorId:{00000000-0000-0000-0000-000000000000}
DeviceId:0

>vmount-win64 truncate e:\test.vhd 576
truncate OK

>vmount-win64 getvirtualdiskinfo e:\test.vhd
OpenVHD SRC failed 1392

>vmount-win64 addfooter e:\test.vhd
addfooter OK

>vmount-win64 getvirtualdiskinfo e:\test.vhd
Identifier:{00000000-0000-0000-0000-000000000000}
BlockSize:0
PhysicalSize:603980288
SectorSize:512
VirtualSize:603979776
VendorId:{00000000-0000-0000-0000-000000000000}
DeviceId:0

  • ReTokener and misty like this

#149 ReTokener

ReTokener

    Frequent Member

  • Developer
  • 181 posts

Posted 16 June 2019 - 03:21 PM

 

 

 

Dear Erwan

vMount  v1.0.0.12: Function truncate worked well on Win7. :thumbsup:

 

 

Thanks a lot   T.



#150 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2735 posts
  • Location:Nantes - France
  •  
    France

Posted 16 June 2019 - 04:21 PM

 

Dear Erwan

vMount  v1.0.0.12: Function truncate worked well on Win7. :thumbsup:

 

 

Thanks a lot   T.

 

Great !

 

Later on, this can be improved eventually :

-one function call rather than two currently (truncate+addfooter)

-preserve the original footer

-implement a safety check to ensure that the partition is not truncated

 

But at least for now, we have a way to resize a fixed vhd starting with vista and up.


  • ReTokener likes this





Also tagged with one or more of these keywords: vhd

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users