EldoS | Feel safer!

Software components for data protection, secure storage and transfer

GetVolumeId uniqueness

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
#27330
Posted: 11/24/2013 11:32:08
by Andy Key (Standard support level)
Joined: 11/12/2013
Posts: 16

How unique does the volume ID have to be?

Can a single program instantiate multiple CallbackFileSystem objects each with their own storage loaded, all using the same volume ID?

Or within a single process, all volumes must be unique?

Or within a single machine, all volumes must be unique?

I'm curious, because in examples (eg: VMounter), I see it hardcoded.

Put another way, what code will use the volume ID returned, and for what purpose...?

{{{ Andy
#27332
Posted: 11/24/2013 11:41:13
by Eugene Mayevski (EldoS Corp.)

The ID must be unique within the system. It can (and maybe should) be the same for the same virtual dataset represented by the virtual disk across application restarts.

Some applications use this ID to bind various settings to the disk. Changing the guid for the same disk will make those application think that this is a different disk and thus lose previous settings.


Sincerely yours
Eugene Mayevski
#27337
Posted: 11/24/2013 12:29:19
by Andy Key (Standard support level)
Joined: 11/12/2013
Posts: 16

So if two programs using CbFs run at the same time, how do they avoid fabricating duplicate volume IDs?

eg: imagine someone wrote a union-filesystem, and someone else wrote a GMail accessing filesystem.

{{{ Andy
#27338
Posted: 11/24/2013 12:37:37
by Eugene Mayevski (EldoS Corp.)

What problem are you having with generating your own volume ID?


Sincerely yours
Eugene Mayevski
#27339
Posted: 11/24/2013 12:41:12
by Andy Key (Standard support level)
Joined: 11/12/2013
Posts: 16

Its just that you said the ID _must_ be unique _within_the_system_.
I read that to mean within the computer.
And that bad things happen if collisions occur.

Whatever algorithm I might use, I don't know the algorithms other products using CbFs might be using, and indeed what algorithm other non-CbFs filesystems delivered out of the box might be using.

{{{ Andy
#27340
Posted: 11/24/2013 12:50:04
by Eugene Mayevski (EldoS Corp.)

Windows has a function (CoCreateGuid) that generates unique GUIDs.


Sincerely yours
Eugene Mayevski
#27341
Posted: 11/24/2013 13:08:23
by Andy Key (Standard support level)
Joined: 11/12/2013
Posts: 16

GetVolumeId is expected to return a DWORD, not a UUID or GUID.
#27342
Posted: 11/24/2013 13:30:11
by Eugene Mayevski (EldoS Corp.)

Looks like I've mixed volume ID and Storage GUID. Documentation says that the volume ID must be unique within CBFS storages only. Let's wait for developers' comments.


Sincerely yours
Eugene Mayevski
#27350
Posted: 11/25/2013 02:37:57
by Volodymyr Zinin (EldoS Corp.)

It seems the "volume id" property doesn't affect anything. I.e. it can be obtained via the ZwQueryVolumeInformationFile API (for details see VolumeSerialNumber in the FILE_FS_VOLUME_INFORMATION structure description in MSDN) but it doesn't really unique represent a volume. Just some additional parameter that can be requested from file system. For example FATFS for it returns the "serial number of partition" property that is located in the 1st sector of the file system (in its boot sector, or superblock).
But of course better to make it unique within all of your CBFS virtual disks.
#27407
Posted: 11/26/2013 16:22:19
by Andy Key (Standard support level)
Joined: 11/12/2013
Posts: 16

Thanks for the info.

> But of course better to make it unique within all of your CBFS virtual disks.
Are you saying we MUST do this or CbFS breaks?
Over volumes in the whole machine?
Over volumes from the same process?

Or are you saying it is better to keep them unique?
Because applications store settings against volumes using this key.

{{{ Andy
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.

Reply

Statistics

Topic viewed 2936 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!