book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!







sparse files


What is this stuff?

If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):



From: Tony Lawrence <tony@aplawrence.com>
Subject: Re: Problems with backups/restores References: <9rdoqi$ui0$00$1@news.t-online.com> <3bdec471$1_7@news.newsgroups.com> <3BDFD67E.69F8D527@aplawrence.com> <GM2uLn.1rA5@wjv.com>
Date: Wed, 31 Oct 2001 20:34:06 GMT


Hate these ads?



Bill Vermillion wrote:



> But sparse files don't have to be assocaited with hashed files - at
> least not as I understand them - so feel free to point me in the
> proper direction if I'm wrong.














.. stuff deleted..



> Let's take something like a file created with something as simple
> as a BASIC program [yes - you used to see that on Unix systems].

> Using randon I/O - and for easy of math computation lets say the
> data is a 100 byte record.   Write record number 1 and you start at
> the front.  Then just call the identify the second record as record
> number 1000.  



But there would be absolutely no reason whatsoever for you to choose
1000 as the position of the second record *unless* you were using a
hashing algorithm.  Logically, the second record would be, well, the
second record.




> That is correct and this assumes something like a database as good
> design requires this.  I was only commenting on the fact that
> the hashing method is not the only way to create sparse files.



No, but it's generally the only logical reason one would arbitrarily
jump out to some high byte position.  Why else would you do such a
thing?  Maybe I'm just too tired (I had a 22 hour day a couple of days
back), but I can't think of any other reason.









The purpose of hashing is ultrafast access- no other access method can
even begin to approach it for random keys- it's really not a "database"
thing (unless you consider any access to data a database),  Back in the
days of slow media I wrote programs that used hashed storage for no
other reason than that- it let me get my data back quickly.



A side effect of hashing is the sparse file if the file system supports
it.  I really cannot think of any other reason that one would create
data in this manner.. someone less burned out than I can feel free to
remind me of such a reason..




I suppose there is the case (which I've certainly used where I could)
where some sequentially assigned number is part of the data- in that
case you can use that number in the same manner as a hash, and it is, in
effect, a degenerate hash- the function is just times 1 or plus zero-
but to my mind that's a hash even though you don't actually do any
math..  purists can disagree, of course, but I ignore purists anyway :-)



I'm pretty sure that the rationale for sparse files was hashing- I'm not
sure whether the driving force was efficiency in creating and reading or
to save space, but certainly both space and media speed were much more
critical then than now.



--
Tony Lawrence
SCO/Linux Support Tips, How-To's, Tests and more: 






Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner


ad

Views for this page
Today This Week This Month This Year  Overall
1444 1,105

/Bofcusm/948.html copyright 1997-2004 (various authors) All Rights Reserved

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

More:
       - Newsgroup




Unix/Linux Consultants


http://www.vss3.com SCO/Caldera OpenServer, Unixware & Linux. Tarantella & Non-stop Clustering


http://www.cleverminds.net Need expert advice? Want a second opinion? CleverMinds is a one-stop-shop for a wide range of technology solutions. We support Unix, Linux, SCO as well as CMS, ecom, blogs, podcasts, search engines consulting and more. Contact us at web2.0@cleverminds.net 0r (617) 894-1282


http://www.breakthru.com.au SCO (Openserver and Unixware), Unix, Solaris and Linux Consulting services including: Secure Networking Solutions; Linux based Firewalls; Backup Solutions; Secure Home to Office Network Setup; Phone, Remote and On-Site Support available - Satisfaction Guaranteed!



Twitter
o You can't live for ever - at least not yet 1:48 PM Jan 28th 2008




card_image







Change Congress