Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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
I want to be able to do this, as one of the disks in an lvm array seems to be acting up, so i want to be able to move the data to the other disks (which i believe correspond to earlier blocks). – Jayen Jan 22 at 3:18

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

share|improve this answer

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

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

Your Answer


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