file read/write - when moved to external device.
Posted on 2004-09-17
have one problem, n I'm not getting the solution.
I have one nfs server, which has exported some directories to the nfs clients.
Wht ever files the clients read/writes, it gets written to this nfs exported directory (on the server) giving each of them the feel of local storage.
Now here is the twist, in the nfs server also the files does'nt remains it gets stored onto some external storage.
Now suppose the "client1" has stored a file "FILE1" on the server, after moving the file onto the external device, still the "client1" shld able to see
"FILE1" with proper stats (as per stored).
Now my problem is when I move the file from server to SAN, i.e I need to physically remove the file from the server disk.
So no longer the file is available. But I maintain the metadata, which contains the stats n other info about the file.
How is this to be displayed onto the shell on say on "ls" --- > does this indicate I need to get into filesystem stuff.
Can linking (soft links) be of some help ?????? any ioctls.
n Displaying is not only the purpose, if smhow we display it, the client shld be able to read the file as normal.
One solution I came:
We mount the nfs (server) exported directory on the device, which runs on our block driver.
So when ever some operation read/write etc happens onto the directory the control gets passed to our driver, later for writing the file n reading the file
control could be passed to our application daemon executing the APIs.
But getting the file info, filesystem comes into picture, I think the driver won't be of much help.
Some filesyetm driver wrapper could be the solution.
Please Help. Throw sm light