Unix & Linux Asked by sonnuforevis on October 11, 2020
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 atime
options.
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: /home
and /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.
Mounting scheme:
/ -> 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
To mount remote
and secure
directories you will probably need some script that asks you for password(s).
Directory sym-links pwd=/home/miroslav
:
projects -> secure/projects
documents -> secure/documents
mails-dir -> secure/mails
Correct answer by kravemir on October 11, 2020
I used to make separate partitions for /
, /home
, /usr/local
and /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 /home
.
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.
Answered by Dan Ross on October 11, 2020
On our internal developement virtual machines we use three partitions:
/root
partition - housing mostly static operating system stuff
/var
partition - for all dynamic data
/home
partition - 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: /var
, /var/tmp
, /var/log
, /tmp
, /boot
, ... but these are production machines, where uptime matters.
Answered by Nils on October 11, 2020
At a minumum, I'd do:
1 partion for / 1 partition for /home (this would be most of the space)
Answered by bigdaveyl on October 11, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP