cloudozer / ling

Erlang on Xen

Home Page:http://erlangonxen.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mounting disk/file into ling

kansi opened this issue · comments

I wanted to know if I can mount disk or files into LING VM and read & write to them ?

I tried mounting by specifying the disk = ['file:/tmp/file.dat,hda,rw'] or disk = ['phy:/dev/sda3,hda,rw'] in the domain_config but I am not sure how to check if it worked and how to create files onto it ?
I know that I will need to use 9p to achieve the read write part but not sure how to access the disk ?

There is only a rudimentary support for disks (Xen vbd devices): check out core/arch/xen/ol_disk.c (you have to uncomment LING_CONFIG_DISK in the top-level Makefile to build Ling with the disk outlet support). ol_disk a port type that allows you to read and write blocks of data from a block device, but there is no filesystem implementations except 9p protocol to access other 9p servers (see apps/kernel/src/9p_mounter.erl).

Xen implementation of file module is a stub that falls back into a read-only image in RAM, created by railing at build time.

So, if you want a persistent storage in the current state, set up a 9p server elsewhere and communicate with it. In case you are ready to implement some filesystem functionality, your contributions will be appreciated.

Can you explain how can I go about implementing filesystem functionality ? (Just trying to see how hard it can be !)

isn't GooFs http://erlangonxen.org/blog/goofs-simple-filesystem the solution I am looking for.

I would recommend you try diod (the standard 9p server) and connect to it from inside LING. Alternatively, you can use the (non-standard) GooFS. Note that you will not be able to read the GooFS partition from Linux.