The 'T' attribute of the /home directory should be set

Bug #640287 reported by PeterPall
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
partman-target (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

Binary package hint: base-files

Detailed background:
One of the things the outstanding performance of a linux system is based on is the highly-optimized file system that does not only try to optimize the process of finding where a certain file can be found or try to keep fragmentation low so the whole file can be read in one chunk without the need of moving the hard disk's read head during the process. It also watches tiny details. For example it watches that the physical distance between the contents of two subdirectories of the same directory on the hard disk is kept as low as possible, too.

For most directories this makes sense:
/etc/network/if-pre-up.d will be used shortly before /etc/network/if-up.d is, so making the distance the hard disk's read head has to cross in order to move from one of these directories to the other small is a good idea as is keeping the whole directory structure ~/.firefox as physically compact as possible.
It also makes sense to keep the contents of the home directory of any individual user as physically compact as possible. In the ideal case the files from the user foo are in one very compact part of the hard disk, and the files owned by the user bar are in another very compact chunk of the hard disk.

There is one exception of this rule, though:
It does not make sense to make the individual subdirs of /home to be as close to each other as possible since this would mean that the file system has to choose if it wants to keep this file from the user foo as close as possible to that file from the user bar --- or if it wants to keep this file from the user foo as close as possible to the other files from the user foo. Which in turn makes the files of the user foo to be spread over a bigger part of the hard disk than necessary.

Poposed enhancement:
add a
chattr +T /home
to the post-install-script. This allows the file system to put every subdirectory of /home into a different physical place on the hard disk --- which in turn allows it to to keep each of these physical places as compact as possible.

Source:
The manpage of the chattr command (chattr(1)) contains the following paragraph:
       A directory with the 'T' attribute will be deemed to be the top of
       directory hierarchies for the purposes of the Orlov block allocator.
       This is a hint to the block allocator used by ext3 and ext4 that the
       subdirectories under this directory are not related, and thus should be
       spread apart for allocation purposes. For example it is a very good
       idea to set the 'T' attribute on the /home directory, so that
       /home/john and /home/mary are placed into separate block groups. For
       directories where this attribute is not set, the Orlov block allocator
       will try to group subdirectories closer together where possible.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: base-files 5.0.0ubuntu22
ProcVersionSignature: Ubuntu 2.6.35-21.31-generic 2.6.35.4
Uname: Linux 2.6.35-21-generic i686
Architecture: i386
Date: Thu Sep 16 08:25:56 2010
EcryptfsInUse: Yes
ProcEnviron:
 LANG=en_GB.utf8
 SHELL=/bin/bash
SourcePackage: base-files

Revision history for this message
PeterPall (peterpall) wrote :
description: updated
Revision history for this message
PeterPall (peterpall) wrote :

The directory /home is no more created by base-files but is created at boot-time by ubiquity.

affects: base-files (Ubuntu) → ubiquity (Ubuntu)
Colin Watson (cjwatson)
affects: ubiquity (Ubuntu) → partman-target (Ubuntu)
Changed in partman-target (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.