3

When I do:

ls -a /

on Fedora 21 there is a hidden file named:

.readahead and it's 104092k

What is this file?.... is it suppose to be there?

I found this on google:

readahead system call on wiki.

Excerpt:

readahead is a system call of the Linux kernel that loads a file's contents into the page cache, providing that way a file prefetching technology. When a file is subsequently accessed, its contents are read from the main memory (RAM) rather than from a hard disk drive (HDD), resulting in much lower file access latencies due to much higher performance of the main memory.

More on the readahead system call from man:

Excerpt:

readahead() initiates readahead on a file so that subsequent reads from that file will be satisfied from the cache, and not block on disk I/O (assuming the readahead was initiated early enough and that other activity on the system did not in the meantime flush pages from the cache).

The only hit for this particular file was this mailing-list:

http://linux.derkeiler.com

Excerpt:

Indeed those files appear to be misplaced, the .config directory look like a leftover from the installation.. and the .readahead file appears to be written at boot time, dunno what writes it, monitoring it with "audit" may yield some clues.

File a bug report.

  • 1
    systemd-readahead-done.service is executed a short while after boot completed and signals systemd-readahead-collect.service to end data collection. On this signal, this service will then sort the collected disk accesses and store information about them in /.readahead – don_crissti Apr 26 '15 at 15:18
1

Thank's to @don_crissti for the link: systemd-readahead-replay.service.html, here is what this file does.

Excerpt:

systemd-readahead-collect.service is a service that collects disk usage patterns at boot time. systemd-readahead-replay.service is a service that replays this access data collected at the subsequent boot. Since disks tend to be magnitudes slower than RAM, this is intended to improve boot speeds by pre-loading early at boot all data on disk that is known to be read for the complete boot process.

systemd-readahead-done.service is executed a short while after boot completed and signals systemd-readahead-collect.service to end data collection. On this signal, this service will then sort the collected disk accesses and store information about them in /.readahead.

Normally, both systemd-readahead-collect.service and systemd-readahead-replay.service are activated at boot so that access patterns from the preceding boot are replayed and new data collected for the subsequent boot. However, on read-only media where the collected data cannot be stored, it might be a good idea to disable systemd-readahead-collect.service.

On rotating media, when replaying disk accesses at early boot, systemd-readahead-replay.service will order read requests by their location on disk. On non-rotating media, they will be ordered by their original access timestamp. If the file system supports it, systemd-readahead-collect.service will also defragment and rearrange files on disk to optimize subsequent boot times.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.