How TO persistantly MOUNT VHD at BOOT TIME

spydaz

Banned
Local time
5:22 PM
Messages
34
Location
UK, LONDON, BRIXTON,
QUESTION:
Scenario
I have multiple VHD data Drives.. After attatching them in win7 every time i reboot they are gone and i have to Re-Attach them again.....

Comment
It seems a bit silly Why would microsoft do this... Hmmm..

Question
HOW CAN I HAVE THESE DRIVE AUTOMATICALLY Attached AT LOGON!
 

My Computer My Computer

At a glance

Windows 7 64-bit 7600 OEMAMD Phenom Quad CORE 2.5 ghzOCZ Vista Series 8GB (2x4GB) DDR2 PC2-6400C5 ...RADION 3200 HDMI & DVI
Computer Manufacturer/Model Number
MySelF -
OS
Windows 7 64-bit 7600 OEM
CPU
AMD Phenom Quad CORE 2.5 ghz
Motherboard
Gigabyte GA-MA78GM-S2H AMD 780G Micro-ATX (Socket AM2) PCI-E
Memory
OCZ Vista Series 8GB (2x4GB) DDR2 PC2-6400C5 Dual Channel
Graphics Card(s)
RADION 3200 HDMI & DVI
Sound Card
EMU 1812 - Optical ADAT
Monitor(s) Displays
42LG LCD & 2 19inch ELO TOUCH SCREENS
Screen Resolution
1360x768
Hard Drives
2 1TB samsung 39mbCACHE - SATA
1 500GB Western Digital - SATA
PSU
500W
Case
silverstone -
Cooling
Standard CPU FAN <<<<< ALWAYS BEST >>>>> Coolermaster
Keyboard
Microsoft Wireless optical
Mouse
Microsoft Wireless optical
Internet Speed
2mbits
Other Info
Will be Getting the Tesla Card from NVIDIA SOON <<<<< tesla supercomputer >>> nvidia CODA, PS: Motherboard Has Got Hardware assisted virtualization... If Your motherboard does not have it, It may JUST need the correct BIOS UPGRADE, CHECK BIOS DATES BEFORE FINALIZING A BUY, EVEN LOOKIN BIOS IF POSSIBLE as its not stated on the spec sheets, THAT WILL HAVE TO CHANGE as many mother board DO have hardw
Ok I forgot about this posting... SORRY!

diskpart /s c:\scripts\drives.txt

we create a file called AttachPersistantDrives.CMD with the above text and create a shortcut in the start folder in the menu of your user.


then we create a script.TXT file to contain the list of disks to be added

select vdisk file="z:\storage\Application Library.vhd"
attach vdisk


select vdisk file="z:\storage\Music Library.vhd"
attach vdisk


select vdisk file="z:\storage\video library.vhd"
attach vdisk


I found that there was a lot of boxes coming up on screen, SO. I edit Local Security policy.

And Made Minor changes to User Acount Control. As We DONT WANT TO TURN OFF THIS FEATURE.... I have Exported the security poilcy to a VhdSecpolicy.INF to imported For ease later.

LOCAL POLICES / SECURITY OPTIONS /
User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode - YES ELEVATE

User Account Control: Turn on Admin Approval Mode -YES

User Account Control: Switch to the secure desktop when prompting for elevation - disable (personal)

Now when i logon All My Vhds Logon TOO. In their specified order AND able to be added to Libraries... <my drives always get the same Letters Now. although i should be using folder mounts instead> If I am Not logged on then My Librarys are unavailable!<my drive are not attached>

So You Can And Should Manage files better and even Protect Files From Evil Antivirus softwares with Hidden agendas to delete "SPECIFIC SOFTWARE" from your pc,even when NOT VIRUSED UP!... also easier to Scan whole system as not so much files unless all the Vhd's are attached...
 

My Computer My Computer

At a glance

Windows 7 64-bit 7600 OEMAMD Phenom Quad CORE 2.5 ghzOCZ Vista Series 8GB (2x4GB) DDR2 PC2-6400C5 ...RADION 3200 HDMI & DVI
Computer Manufacturer/Model Number
MySelF -
OS
Windows 7 64-bit 7600 OEM
CPU
AMD Phenom Quad CORE 2.5 ghz
Motherboard
Gigabyte GA-MA78GM-S2H AMD 780G Micro-ATX (Socket AM2) PCI-E
Memory
OCZ Vista Series 8GB (2x4GB) DDR2 PC2-6400C5 Dual Channel
Graphics Card(s)
RADION 3200 HDMI & DVI
Sound Card
EMU 1812 - Optical ADAT
Monitor(s) Displays
42LG LCD & 2 19inch ELO TOUCH SCREENS
Screen Resolution
1360x768
Hard Drives
2 1TB samsung 39mbCACHE - SATA
1 500GB Western Digital - SATA
PSU
500W
Case
silverstone -
Cooling
Standard CPU FAN <<<<< ALWAYS BEST >>>>> Coolermaster
Keyboard
Microsoft Wireless optical
Mouse
Microsoft Wireless optical
Internet Speed
2mbits
Other Info
Will be Getting the Tesla Card from NVIDIA SOON <<<<< tesla supercomputer >>> nvidia CODA, PS: Motherboard Has Got Hardware assisted virtualization... If Your motherboard does not have it, It may JUST need the correct BIOS UPGRADE, CHECK BIOS DATES BEFORE FINALIZING A BUY, EVEN LOOKIN BIOS IF POSSIBLE as its not stated on the spec sheets, THAT WILL HAVE TO CHANGE as many mother board DO have hardw
Hi,

I've tried your advice on both Windows 7 x64 Home Premium and Professional and it's not working. All I am receiving is "DiskPart has encountered an error: The system cannot find the path specified. See the System Event Log for more information."

The VHD I'm trying to attach is on an external harddrive connected to my router. The only way I can attach it right now is through the disk management GUI. The command prompt version doesn't work at all.

EDIT: For remote drives you need to give a UNC path and not a mapped drive e.g. \\COMPUTER\backup.vhd.
 
Last edited:

My Computer My Computer

At a glance

Windows 7 Home Premium x64
OS
Windows 7 Home Premium x64
sorry for hijacking but figured y'all might be in the know...

My experience is that Josip Medved's VHD Attach is the quickest method I've found so far.

After re-reviewing comments in How to Create Scheduled Task to attach volume, it seems that the Administrators group required permissions advice given is incorrect, but that 'System' will work.

When I use the batch method I can stamp a log

Code:
echo %date% %time% startedScript >> D:\log.txt
diskpart /s "D:\vhd\attachLBS.txt" >> D:\log.txt
ECHO. >> D:\log.txt
echo %date% %time% finishedScript >> D:\log.txt

Code:
17/10/2015  0:25:11.55 startedScript 

Microsoft DiskPart version 6.1.7600
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: DELHIBOY

DiskPart successfully selected the virtual disk file.


  100 percent completed


DiskPart successfully attached the virtual disk file.
 
17/10/2015  0:25:31.66 finishedScript

I'm looking at VHD Attach, and wondering a) if there's a log that shows when a volume was mounted (or if that can be inferred), to compare with when the VHD Attach svc starts (& what else happens @ boot>startup>loginscreen>login)

Any way of identifying WHEN a volume was mounted?
 

My Computer My Computer

At a glance

Windows 7 Ultimate 64bit2.28GbNVIDIA
Computer type
Laptop
Computer Manufacturer/Model Number
Dell
OS
Windows 7 Ultimate 64bit
CPU
2.2
Memory
8Gb
Graphics Card(s)
NVIDIA
Screen Resolution
1280/762
Mouse
built in pad || iphone || MS wireless
Internet Speed
100MB
Antivirus
Avast
Browser
Chrome, Chrome portable
Back
Top