EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How can I make a separate umount app?

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
Posted: 12/16/2010 19:52:51
by Sangmin Lee (Standard support level)
Joined: 06/03/2009
Posts: 57

I developed a mount application. It's has the form like "myfs_mount z:". It works fine..

And then I made a separate windows service which automatically execute the mount app executable when windows boot up. Everything is fine except umount. Currently, the only way I unmount the drive is just killing the mount process itself either by taskkill command or process manager window.

Actually, I want a separate executable which unmount CBFS drive gracefully. I want "myfs_unmount z:" like command syntax. How I develop separate unmount app for this purpose? Can I call CBFS API within the separate unmount app or should the unmount app send a message (i.e. pipe?) to mount app to initiate call those unmount related function?

Thanks in advance.
Posted: 12/16/2010 22:07:32
by Eugene Mayevski (EldoS Corp.)

The architecture of CBFS expects a control process, which mounts, "processes" and unmounts the storage. If you have a running control process, you can inform it from outside, that it needs to unmount the disk using one of interprocess communication (IPC) mechanisms. But you can't unmount the disk directly from the other process - doing this would be a security hole.

Sincerely yours
Eugene Mayevski
Posted: 12/17/2010 00:23:21
by Sangmin Lee (Standard support level)
Joined: 06/03/2009
Posts: 57

Thanks... As I expected, I should use pipe...

One more question..

My customer want multiple mountpoint/storage.

When I mount multiple mountpoint/storage with my mount service start manually, or setting start mode to delayed start (windows7), it works well, showing multiple drive name as following...


But, when actual mount occur while reboot (service start type = auto), some of the drive shows as network drive as follow.. or some of them fail to mount at all...

"Network Drive (X:)"
"Network Drive (Y:)"


Why? Is there any service dependency or DLL dependency while booting?

CallbackFileSystem::Install(FilePath, g_Guid, false,

I installed all of the helper DLL and rebooted completely.
Posted: 12/18/2010 05:28:48
by Eugene Mayevski (EldoS Corp.)

1) Do you handle each mounting point in the separate instance of CallbackFileSystem class (which is the right way) or you are adding multiple mounting points for the same object?

2) what error code do you get when adding a mounting point fails during reboot?
Posted: 12/18/2010 19:09:07
by Sangmin Lee (Standard support level)
Joined: 06/03/2009
Posts: 57

1) YES, definitely.. Each mountpoint/storage are handled in the separate executables... One mounter per mountoint/storage

2) I don't sure... Because the executalbe runs within service, its hard to detect the error code... But I will try it... Currently only I know is that
- Some sleep() between mount help
- delayed start works perfectly...
- even if some drive shown as network drive, it works well

Anyway, you think there should be no problem for this case...
There may be a bug within my code... I'll check more..
Posted: 12/18/2010 23:07:04
by Sangmin Lee (Standard support level)
Joined: 06/03/2009
Posts: 57

I found that some of the mount process hang within cbfs.createstorage().

When the service auto-start while booting, it launches mount processes for three mountpoints as following.. Is there any problem? Should I start mount process synchronously? The start() method seems to start each process asynchronously. If I insert Sleep(10000) between start(), it mount anyway.. but some of them appear as network drive... If I omit Sleep(10000), some of them fail to mount and they hang within cbfs.createstorage().

Please help...

private: System::Void doAutoMount() {
String^ strVol;
StreamReader^ fstab;

try {
fstab = gcnew StreamReader(baseDir + L"\\fstab.txt");

while ( !fstab->EndOfStream ) {
// strVol is following form: L" Z: 0 0"
strVol = fstab->ReadLine();

if ( strVol->Length > 0 ) {
System::Diagnostics::Process::Start(baseDir + L"\\GFSMount.exe ", strVol);
// System::Threading::Thread::Sleep(10000);
} catch ( Exception^ e) {
this->eventLog1->WriteEntry(L"Auto mount fail: " + e->Message);
} finally {
delete fstab;
Posted: 12/19/2010 04:18:40
by Eugene Mayevski (EldoS Corp.)

We will investigate the problem, though it will take quite long time to create a test case and try to catch the issue.

Sincerely yours
Eugene Mayevski
Posted: 12/20/2010 00:43:21
by Sangmin Lee (Standard support level)
Joined: 06/03/2009
Posts: 57

I'll test my app also to find some more clue on this problem..

FYI, I use CBFS 3.0.

Service program were developed with dotnet/VC++, but mounter app were developed with MFC console application/VC++/CBFS.lib.

Posted: 12/20/2010 01:01:04
by Eugene Mayevski (EldoS Corp.)

As I understood your problem, it's service, started in Boot mode, that doesn't always create mounting points, right? So Mounter application should not matter in this case at all.

Sincerely yours
Eugene Mayevski
Posted: 12/20/2010 01:30:05
by Sangmin Lee (Standard support level)
Joined: 06/03/2009
Posts: 57

Service program merely launches multiple mounter app and actual mount are done within the separate mounter app. For each mountpoint/storage, mount app will be launched by the service. So, I think service program has no problem.. It sucessfully launches multiple mount app as expected while booting.

The mounter are linked with cbfs.lib and it hangs within createstorage() while booting.

So, mounter app does matter, service program does not matter, in this case..

(I prefer this architecture, because separate mounter app per mountpoint will isolate completely other mountpoint failure.)

To reproduce my case, you need a service program and a mounter app. The service program merely launch multiple mounter app. The mounter app does actual mount for different mountpoint.
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.



Topic viewed 6614 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!