This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
开发者_JAVA技巧 Improve this questionIn linux we can create a filesystem in single file and mount it. Is there any way to create a filesystem in a file in windows and mount the filesystem created in a file?
In Windows 7 you can use diskpart to do this.
Save the command lines to a text file, such as c:\newdisk.txt. This example will create a 500 MB virtual disk and mount it:
create vdisk file=c:\test.vhd maximum=500 type=fixed
sel vdisk file=c:\test.vhd
attach vdisk
Execute the script with diskpart:
diskpart /s c:\newdisk.txt
You can also format the volume, assign a drive letter, etc with diskpart.
In Windows 7/2008 it is simple to mount a VHD file:
http://thelazyadmin.com/blogs/thelazyadmin/archive/2009/01/15/mount-a-vhd-within-windows-7-server-2008-r2.aspx
VHD is a "virtual hard disk" normally used to host a virtual OS, but you could certainly create an empty one as a single file based file system...
精彩评论