What is the preferred way to create a partition and then format an NTFS volume within this volume?
I'd prefer to stick with the Win32 API, instead of using WMI or a script
is this possible? any clues to the API's/IOCTLs? (an example would be great)
thanks!
Everything you need to know is on MSDN:
Disk Management
Virtual Disk Service
Windows Storage Management API
IVdsAdvancedDisk interface
Related
There are some applications (let us call them providers), which (when running) provide a virtual file and directory structure under a new drive letter. Access requests from other processes to those files and directories are served by the provider.
One example of such provider could be the Google Drive for Windows (the new one, not the old Backup and Sync), which maps the contents of your Google Drive to a chosen drive letter.
I thought there should be some simple user-mode API, which should allow my app to provide a new drive and the contents of files and directories on it. I thought that many applications use such API, but I cannot find it. The closest I could get are IFS (installable file system drivers) and file system filter drivers, but those are kernel-mode and they seem too complex. They just seem not designed to accomplish such task.
So, what API should I use to make a simple software-implemented drive?
In addition to the suggestions in the comments there is also now the Projected Filesystem, which allows software to provide a drive-like interface though callbacks and not just by creating an actual disk image. It is my understanding that Projected FS is how, for instance, SQL Server does its table-backed files interface.
Great information on interrogating mounted drives via IOKit in this question. But is there a way to determine which of the devices returned by IOIteratorNext() is the boot drive? Or better yet, might there be a way to get just the boot drive in the iterator returned by IOServiceGetMatchingServices()?
Booting is done from media, not a device per se. Devices have media, media have volumes. I don't believe that volumes are represented in IOKit.
This is probably easiest using Disk Arbitration. Use DADiskCreateFromVolumePath() with the CFURL for /. Then call DADiskCopyDescription() to get the description dictionary. That will include properties of the volume, the media, the device, and even the bus, including IOKit paths if you need them. There's a good chance the information you're looking for is directly in the description dictionary, though.
The NVRAM information cited by Mark Setchell is available from IOKit, too, at path IOService:/AppleACPIPlatformExpert/AppleEFIRuntime/AppleEFINVRAM. There's a property efi-boot-device. Its value is a property list including a service matching dictionary. As you can see, it looks for an entry with provider class of IOMedia whose UUID property is a certain UUID.
You can use this:
nvram efi-boot-device
efi-boot-device <array><dict><key>IOMatch</key><dict><key>IOProviderClass</key><string>IOMedia</string><key>IOPropertyMatch</key><dict><key>UUID</key><string>78025031-4C42-4FDE-8DD1-A515A2BF6032</string></dict></dict><key>BLLastBSDName</key><string>disk0s3</string></dict></array>%00
I'm looking for some documentation/clues about how would it be possible to read a disk in Windows without the using CreateFile() on a volume. For example the standard files functions only give an access to formated disk.
Is there any kind of documentation about the driver disk.sys such as an export list, functions prototypes etc ?
Would the direct use of the driver be the right approach ?
I'm consider to use HDFS as horizontal scaling file storage system for our client video hosting service. My main concern that HDFS wasn't developed for this needs this is more "an open source system currently being used in situations where massive amounts of data need to be processed".
We don't want to process data just store them, create on a base of HDFS something like small internal Amazon S3 analog.
Probably important moment is that stored file size will be quite git from 100Mb to 10Gb.
Did anyone use HDFS in such purposes?
If you are using an S3 equivalient then it should already provide a distributed, mountable file-system no? Perhaps you can check out OpenStack at http://openstack.org/projects/storage/.
The main disadvantage would be the lack of POSIX semantics. You can't mount the drive, and you need special APIs to read and write from it. The Java API is the main one. There is a project called libhdfs that makes a C API over JNI, but I've never used it. Thriftfs is another option.
I'm also not sure about the read performance compared to other alternatives. Maybe someone else knows. Have you checked out other distributed filesystems like Lustre?
You may want to consider MongoDB for this. They have GridFS which will allow you to use it as a storage. You can then horizontally scale your storage through shards and provide fault tolerance with replication.
http://docs.mongodb.org/manual/core/gridfs/
http://docs.mongodb.org/manual/replication/
http://docs.mongodb.org/manual/sharding/
I need to get some information that is contained in the MFT on a Windows machine, and I'm hoping that there is some super-secret API for getting this information. I need to be able to get to this information programmatically, and because of legal concerns I might not be able to use the tools provided by the company formally known as sysinternals.
My other option (which I really don't want to have to do) is to get the start sector of the MFT with DeviceIoControl, and manually parse through the information.
Anyway, in particular, what I really need to get out of the Master File Table is the logical sectors used to hold the data that is associated with a file.
There is a documented API for getting info on file positions on disk since Windows 2000. Look for DeviceIoControl function with FSCTL_GET_RETRIEVAL_POINTERS control code on MSDN:
http://msdn.microsoft.com/en-us/library/aa364572(VS.85).aspx
The API has been provided for writing custom disk defragmenters and consists of several other control codes.