Jump to content











Photo
- - - - -

NFS Imdisk Proxy


  • Please log in to reply
10 replies to this topic

#1 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2776 posts
  • Location:Nantes - France
  •  
    France

Posted 10 December 2018 - 06:46 PM

Here comes a new proxy for ImDisk.

This time this is about mounting a file (an ISO for now, probably a RAW image shortly) over a NFS share.

To accomplish this I am using libnfs library.

 

Find here attached the proxy.dll for ImDisk.

 

To launch the proxy : devio --dll=proxy.dll;dllopen shm:test_proxy nfs://192.168.1.248/volume2/public/debian-8.7.1-amd64-netinst.iso

 

To use the proxy from ImDisk : 

imdisk -a -t proxy -o shm,cd -o ro -f test_proxy -m i:

 

writing is disabled for now.

 

 

This is experimental for now and far from being bug free.

 

Njs6Eox.png

 

Regards,

Erwan

Attached Files


  • Olof Lagerkvist likes this

#2 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2776 posts
  • Location:Nantes - France
  •  
    France

Posted 10 December 2018 - 07:15 PM

URL-FORMAT:

===========
Libnfs uses RFC2224 style URLs extended with some minor libnfs extensions.
The basic syntax of these URLs is :

nfs://<server|ipv4|ipv6>/path[?arg=val[&arg=val]*]

Arguments supported by libnfs are :
tcp-syncnt=<int> : Number of SYNs to send during the session establish
                  before failing setting up the tcp connection to the
                  server.
uid=<int> : UID value to use when talking to the server.
                 default it 65534 on Windows and getuid() on unixen.
gid=<int> : GID value to use when talking to the server.
                 default it 65534 on Windows and getgid() on unixen.
readahead=<int> : Enable readahead for files and set the maximum amount
                   of readahead to <int> bytes.
auto-traverse-mounts=<0|1>
                   : Should libnfs try to traverse across nested mounts
                   automatically or not. Default is 1 == enabled.
dircache=<0|1> : Disable/enable directory caching. Enabled by default.
autoreconnect=<-1|0|>=1>
                    : Control the auto-reconnect behaviour to the NFS session.
                    -1 : Try to reconnect forever on session failures.
                     Just like normal NFS clients do.
                     0 : Disable auto-reconnect completely and immediately
                    return a failure to the application.
                    >=1 : Retry to connect back to the server this many
                     times before failing and returing an error back
                    to the application.
if=<interface> : Interface name (e.g., eth1) to bind; requires `root`
version=<3|4> : NFS Version. Default is 3.
nfsport=<port> : Use this port for NFS instead of using the portmapper.
mountport=<port> : Use this port for the MOUNT protocol instead of
                        using portmapper. This argument is ignored for NFSv4
                        as it does not use the MOUNT protocol.



#3 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2776 posts
  • Location:Nantes - France
  •  
    France

Posted 10 December 2018 - 08:04 PM

Version 0.2 added to initial post.

Write supported.

 

Tested successfully with a disk image.

devio --dll=proxy.dll;dllopen shm:test_proxy nfs://192.168.1.248/volume2/public/disk.img 0 0
imdisk -a -b 1048576 -t proxy -o shm,hd -f test_proxy -m i:

I had to force the offset to 0 on devio and specify the boot sector offset to ImDisk - not sure why as I am pretty sure this should work auto.

Possibly an old imdisk/devio version on my system.

 

If I dont provide the offset on devio, BS offset is correct but then ImDisk picks up a wrong partition list.



#4 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1415 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 10 December 2018 - 09:49 PM

Thanks! Really interesting work! I have used NFS with ImDisk before, but only using DiscUtils.dll. Really interesting to do this without .NET requirements!

 

Regarding offsets etc, ImDisk does not support parsing partition tables though proxy connections at all. That is instead entirely handled by server end, devio.exe. It should automatically use first partition but there could of course be something wrong somewhere. You should at least never need to specify an offset with -b switch to imdisk.exe in that way, it is at least better to do that at the other other end:

devio --dll=proxy.dll;dllopen shm:test_proxy nfs://192.168.1.248/volume2/public/disk.img 1048576 0
imdisk -a -t proxy -o shm,hd -f test_proxy -m i:

Does that work? Does it give the same results in practice?



#5 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2776 posts
  • Location:Nantes - France
  •  
    France

Posted 11 December 2018 - 07:35 AM

Thanks! Really interesting work! I have used NFS with ImDisk before, but only using DiscUtils.dll. Really interesting to do this without .NET requirements!

 

Regarding offsets etc, ImDisk does not support parsing partition tables though proxy connections at all. That is instead entirely handled by server end, devio.exe. It should automatically use first partition but there could of course be something wrong somewhere. You should at least never need to specify an offset with -b switch to imdisk.exe in that way, it is at least better to do that at the other other end:

devio --dll=proxy.dll;dllopen shm:test_proxy nfs://192.168.1.248/volume2/public/disk.img 1048576 0
imdisk -a -t proxy -o shm,hd -f test_proxy -m i:

Does that work? Does it give the same results in practice?

 

Thanks for your feedback : ImDisk and DevIO are great tools and it is always a pleasure to add some proxies to it.

 

As for providing the offset to DevIO and use a default ImDisk command line (i.e without offset), it did not work.

ImDisk did not recognize the image (and windows then proposes to format it).

I would definitely prefer putting all details to DevIO and use a default ImDisk command line.

Suprisingly I did not that issue with my previous proxies (EWF, VMDK, QCOW, VHD, VDI).

 

Disk image is rather simple :

-256Mbytes raw image.

-a MBR with one partition starting at offset sector 2048 (i.e offset byte 1048576) - no boot code.

-A BS (at offset sector 2048) with FS=NTFS - formatted by windows.

 

Image is mounted fine when used directly from ImDisk (I use the cpl applet).

 

I have seen another thread about ImDisk and a possible issue with NTFS partition(s) in some scenarios.

i'll update ImDisk later today and re do my tests.



#6 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 410 posts
  •  
    Germany

Posted 11 December 2018 - 10:13 AM

is there a possible for mounting nfs and nfs/file.iso via imdisk-gui *s*
and then as user ([]auto select actual login+pw from WinNt / []or with other name and passwd) ?
maybe mounting in folder or at letter, maybe both possible ?
(btw. Reactos/WinNT2003Server ... compliant ?)


edit:
btw: https://github.com/r...e/master/dll/np

best regards
Blacky

#7 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2776 posts
  • Location:Nantes - France
  •  
    France

Posted 11 December 2018 - 10:29 AM

is there a possible for mounting nfs and nfs/file.iso via imdisk-gui *s*
and then as user ([]auto select actual login+pw from WinNt / []or with other name and passwd) ?
maybe mounting in folder or at letter, maybe both possible ?
(btw. Reactos/WinNT2003Server ... compliant ?)

best regards
Blacky

 

I will leave that question to Olof then :)

 

All I can provide is a devio proxy which can be used from ImDisk command line.

 

Never tried to use a proxy from ImDisk Gui : Can we actually enter proxy details such as a commdev or tcp-port?

Within the imagefile field with a specific syntax may be?

Or by adding an extra device type = proxy in the GUI?

In short something matching that command line : imdisk -a -t proxy -o shm,cd -o ro -f test_proxy -m i: 

That would be handy...and could render proxies more popular as there are so many extra proxies we could develop.



#8 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1415 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 12 December 2018 - 12:52 PM

There is no support for proxy mounting in the Control Panel applet. I would say that it would be better to build some other kind of GUI for more advanced features if we want a GUI tool for proxy mounting somehow. Control Panel applets are a rather outdated concept for administration of drivers and system services anyway these days and they are increasingly difficult to support for each new Windows version.



#9 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2776 posts
  • Location:Nantes - France
  •  
    France

Posted 12 December 2018 - 07:28 PM

There is no support for proxy mounting in the Control Panel applet. I would say that it would be better to build some other kind of GUI for more advanced features if we want a GUI tool for proxy mounting somehow. Control Panel applets are a rather outdated concept for administration of drivers and system services anyway these days and they are increasingly difficult to support for each new Windows version.

 

Understood.

As a developper,I fully appreciate that it is tough to decide to implement an extra featture or even "simply" rework the GUI.

What may appear as a simple GUI matter for end users ("oh it's easy! just add a radiobutton!") many times mean a complete rework of the logic, the function signatures, etc ...

Actually, this is a discussion we often find on this forum around dev guys "challenged" who are challenged to change this or that and related to that discussion, Wonko actually use a word for that : Featuritis :)

CloneDisk or Tiny PXE Server many times gave me cold sweats when I found myself engaged in a change which meant afterwards a complete rework of a unit...

 

Now, just to take one last chance ... what about "only" (shamelessly minimizing the effort there to increase my chances) introducing an extra device type in the GUI named "proxy" (next to harddisk, floppy, dvd, etc) and allowing the user to enter the proxy details in the filename field ?

 

Is not this what we are doing on the command line? specifying -t for type and -f for filename?

 

Dont get me wrong, I am a huge fan of Imdisk and DevIO and these two already do lots more than I need so they are already just great as they stand today  :thumbup:

 

Cheers,

Erwan



#10 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1415 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 12 December 2018 - 08:24 PM

It would probably not be that difficult to add proxy type, proxy options and proxy name settings to the Control Panel applet either. The problem is that the Control Panel applet is something I would much rather like to not develop any new features for since it is already quite messy (both appearance and code layout) and is difficult to get working correctly in modern Windows versions.

 

There is also the "problem" that I try my best to avoid GUI development completely because it usually takes much longer for me than for an experienced GUI developer to get things in place when I could have spent that time on things I do much better instead. Or something like that. But of course at the same time it would be interesting if someone could pick up development of the Control Panel applet and maybe turn it into an exe and add a few new features to it. I would be happy to support them and help the best I could!



#11 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 410 posts
  •  
    Germany

Posted 12 December 2018 - 08:50 PM

loud thinking ... (but not really interesting  ..)

Spoiler






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users