Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

working with raw or defined filesystems

Status
Not open for further replies.

Mag0007

MIS
Feb 15, 2005
829
US
Is it easier to work with raw filesystems or regular filesystems (ext2,jfs,xfs,etc..) from a programming point of view..

 
Depends on the context of the question, and whether you already have an OS running which supports whatever filesystem interests you.


--
 
well, I am planning to write a program which will have thousands of images (size from 1M to 2G), and I want to store them on a raw partition. I will use a database, postgresql to keep track of where the image is, on the filesystem.

On a raw filesystem, how does one know where a certain object exists? Using Linux, BTW
 
> On a raw filesystem, how does one know where a certain object exists?
The name "raw" says it all - you're on your own.
It's up to you to record the names, sizes, locations on disk.

Don't forget that once you've written all your images, you may want to start deleting them as well. This will then create a huge fragmentation problem for you (not to mention a defragmentation problem).

Personally, I'd go with the file system until I know exactly what performance problem there is (if indeed there is any).

Being Linux, installing new file systems isn't too hard, so there may be some 'hugeImageFs' out there which provides the advantage of writing images to large contiguous blocks of disk (for performance), but hides some of the pain from you as well.

--
 
Salem:

Thanks for the good post!

I have no problem recording where my file size, the whole point of my program is to keep some inventory of the image (such as physical location on hdisk).

How would you go about writing to a raw partition on Linux? Are there any docs out there for this?

Fragmentation, I am write something for that too :)

 
I have to say that if need to ask how to write a file system, you probably do not yet possess the skills necessary to do it.

Take Salem's advice - use an existing file system.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Altought I think the existing filesystems are pretty accurate and they can offer nearly the best performance, he will never get the skills if he doesn't try.

Anyway, I'm curious about this. I imagine the filesystem must acomplish a kind of interface that the OS will understand. That interface is called by the native OS file handling calls, that are the actual link with the compiler. Is this right?

Cheers,
Dian
 
There is a huge difference between thinking "I'm not sure how to write <insert unknown skill>, so I'll give it a try", and writing your own file system which may potentially completely stuff your hard drive.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Nothing that a format on your partition can't fix. There's no glory without risk.

Cheers,
Dian
 
Well I'd say it depends on what this program is for. If it's something for work that they need quickly, I'd say stick with what you know. If it's your own pet project, you might as well learn something new, so try the raw file system (and once you figure it out, let me know too ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top