FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 06-22-2008, 03:20 PM
"Mag Gam"
 
Default random file

Is it possible to create a file on a random inode on a file system?

I am trying to simulate a random read and write for testing purposes.


TIA


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-22-2008, 05:57 PM
Frank Cox
 
Default random file

On Sun, 22 Jun 2008 11:20:22 -0400
Mag Gam <magawake@gmail.com> wrote:

> Is it possible to create a file on a random inode on a file system?

Wouldn't it be easier (and safer) to create a large file, then seek within it?

--
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-22-2008, 06:14 PM
"Mag Gam"
 
Default random file

even seeking thru it requires a sequential* scan, right?



On Sun, Jun 22, 2008 at 1:57 PM, Frank Cox <theatre@sasktel.net> wrote:

On Sun, 22 Jun 2008 11:20:22 -0400

Mag Gam <magawake@gmail.com> wrote:



> Is it possible to create a file on a random inode on a file system?



Wouldn't it be easier (and safer) to create a large file, then seek within it?



--

MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-22-2008, 10:52 PM
"William L. Maltby"
 
Default random file

On Sun, 2008-06-22 at 14:14 -0400, Mag Gam wrote:
> even seeking thru it requires a sequential scan, right?

If Linux FS systems work like real *IX, it depends. The underlying
C/system calls should be smart enough to calculate an offset that
traverses inode information to cause a direct access seek of the read
write head.

If you use a utility, it depends on if the utility is smart enough to
use the correct system calls or just does a sequential read until the
proper location is achieved. I *suspect* that most utilities are smart
enough to work the "fast" way.

You can test this for various utilities or applications.

For instance

dd if=<your file name> skip=<some large number> of=/dev/null count=1

should return *very* quickly. If not, that means it is stupid.

For output, the same. Just replace skip with seek.

Think of large database handlers. If they had to process sequentially,
there would be no fast ones unless the whole DB was cached.

> <snip>

> On Sun, Jun 22, 2008 at 1:57 PM, Frank Cox <theatre@sasktel.net>
> wrote:
> On Sun, 22 Jun 2008 11:20:22 -0400
> Mag Gam <magawake@gmail.com> wrote:
>
> > Is it possible to create a file on a random inode on a file
> system?
>
>
> Wouldn't it be easier (and safer) to create a large file, then
> seek within it?
> <snip sig stuff>

HTH
--
Bill

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 06:27 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org