[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Where does Debian usually install stuff?



The 1024 cylinder limit is not the only reason to seperate /boot and /.  I
like a /boot around 16MB, 2 cylinders on an LBA disk.

Think about your systems operation, once it's up.  A number of my machines
serve web pages, which is partly largish image files, and /usr tends to be
fairly large.

As an optimisation, those image files go on the outer edges of the platters,
with the highest transfer rates.  As the files systems are large, there will
be fair amount of seeking no matter what, so they're on the edge of the
disk.

Systems like /, are rightly kept as static as possible, root corruption
after power failure, is not fun, and precautions such as seperating out /tmp
and /var are worthwhile.

The other reason is security, a number of exploits have involved making hard
links in public writeable areas, eg) /tmp and /var/tmp.

Traditionally /tmp would be agressively cleared out, perhaps rebuilt after a
reboot, and /var/tmp was used by programs like vi(1) which use recovery
files, that need to survive a reboot.  The waters became muddied, as /var
with log, spool and tmp all with the potential to become large, would often
on servers be moved off to a quieter disk, in a large file system to itself.

The directory your temporary files are written can be controlled by
environmental variable, IIRC TMPDIR, see C library routines like tmpnam(3)
for details.  The system default directory is actually determined by the C
library, it's policy, user space issue not a kernel decision.  On systems by
Sun, /tmp defaults to be implemented on top of the VM system, using the swap
space if files get left around, or are too large for RAM.  There are pro's
and con's, the material makes for good flame bait, personally I found it
_did_ speed up compiles and things, working a little like a RAM disk, at the
risk of denial of service attacks, due to VM clogged up with large temporary
files.

As a few programs may use /var/tmp rather than $TMPDIR (/tmp default), or
both, and expect them to be different, I would suggest having seperate
directories for /tmp and /var/tmp, even if you wish to share one filesystem,
possbily on another disk for speed reasons.

Finally to write and read small temporary files quickly, lets keep them in
the centre of the disk, with lots of free blocks to avoid fragementation.
But not so large that lots of seeking takes place.

Thus the partition layout goes something like :

/boot
/images
/usr
/
/tmp
/var
/home
/less_frequently_used_data
/rarely_used_stuff

Rob



Reply to: