Is there some kind of "best disk partitioning scheme" for a Linux-based web and application developer machine, in terms of performance, organization or others?
Partitioning doesn't affect performance so much, but yes, file systems and their configuration affect performance. Look at this benchmark. For a little information about mounting options, see fstab at the ArchWili; especially look at
Partitioning has nothing with organization files in Linux, because in Linux everything is mounted into one tree.
I recommend one partition for the root filesystem,
/, and separate partitions for folders where you place your work and personal data:
/var/www if you put your websites here, because if you change distro you will no need to do backup.
You may make partitions/disks based on files organization and their importance.
For example, you have got projects and documents which are very precious, then you can have them on RAID-ed disks. Also you may have remote disk mounted with ssh/ftp.
/ -> SSD disk, partition 1 /home -> SSD disk, partition 2 /tmp -> tmpfs /media/data -> RAID-ed disk, partition 2 (ie. shared photos with family) user mounts: /home/miroslav/secure -> RAID-ed disk, partition 1 (encrypted) /home/miroslav/remote -> sshfs/curlftpfs
secure directories you will probably need some script that asks you for password(s).
projects -> secure/projects documents -> secure/documents mails-dir -> secure/mails
On our internal developement virtual machines we use three partitions:
/rootpartition - housing mostly static operating system stuff
/varpartition - for all dynamic data
/homepartition - this is where development takes place with the user accounts of the developers
The reason to separate the partitions is to avoid a system halt due to full filesystem. If
/home is full - does not matter. No running processes are affected. Delete something, enlarge online and continue.
/ should not change much (the only exception is
/tmp - but files there are usually never big).
/var is the place where
/var/tmp and all other "live" data resides (including
/var/log). A full
/var/log is still the number one reason for system/application failures, so
/var has to be big enough and there has to be a warning in time when space is becoming sparse there...
On physical machines, where disk space does not matter that much, we divide up additional "partitions" (mostly LVs), including:
/boot, ... but these are production machines, where uptime matters.
I used to make separate partitions for
/var, but I always seemed to end up with some sort of interactions across partitions. If I did install a different distro, I would want to have the unused dotfiles removed for simplicity, so I still made a backup and wiped
As for making a
/var partition, I made so many sites at school (~100 or so), with such a large variance in sizes between media heavy sites and text only exercises, that it was impossible for me to accurately estimate the amount of space to allocate.
Now, I just have one partition for everything, and I don't come anywhere near filling it up. Personal media (movies, games, shows) go on an external HD, so that I can take it to a friend's house. For virtual machines, which have to be virtual appliances in virtualbox if you want to move them, I like to have a dedicated flash drive for each one.
I've never seen a HD crash, but if it did, I don't think it would matter how the physical drive was partitioned; it would just be dead. The riskiest thing I've ever done with my HD is resizing partitions, which is no longer necessary.