Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'd like to decrease the access-time for some files by moving them to the beginning of the fs.

Task 1: Clear a certain block range at the beginning of the fs (moving existing files to free space elsewhere).

Task 2: Move the files in question to that block range (should be able to grow a bit).

How would I do that?

share|improve this question
add comment

4 Answers

Where did you get the idea that this would matter?

Are you maybe thinking of the fact that most harddrives have higher read speeds on the outer tracks than on the inner tracks? I'm not sure the difference is significant counting seek times and other overhead. Even if it is, there are several abstraction layers between the physical disk and a filesystem, so I'm not convinced you could even reliably put stuff onto a certain part of the physical disk.

So you should first find out if what you are doing is really feasible, and will acutally make a difference. I fear it is not...

share|improve this answer
    
Right, inner tracks read slower but have faster seek times. –  kmarsh Jul 10 '09 at 12:24
    
Well, it does make a difference if I compare the IO-performances of a partition at the beginning vs. a partition at the end. Apart from that testing this is a nice way to learn more about how the fs works. :) –  HT74 Jul 10 '09 at 12:36
add comment

Modern filesystems exist to free the admin of these details. If you want to sequester some files, use partitioning.

share|improve this answer
add comment

Not directly answering the question, but it may be simpler to use a small partition at the beginning of the disk to store these files.

share|improve this answer
    
Thanks for your answer! Unfortunately I need the files to stay on the same partition. Otherwise this would have been a no-brainer. :( –  HT74 Jul 10 '09 at 12:16
add comment

Step 1: unmount the filesystem. File systems are generally designed to be accessed by a single driver at a time, and Ext4 is no exception.

Step 2: You're changing allocated blocks, not inodes. Cache the free block list in memory.

Step 3: copy block contents over, and update the extents in the inodes.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.