How much space does /var need? Definite answer needed.
I have /var on a separate partition. While following the recommendations for ArchLinux, I made the partition 10GB. Less than 2GB is in use. I could really use every GB of the SSD the partition is on.
People around the internet seem to say 2GB is enough for Debian/Ubuntu. I know Debian has to download a tonne of stuff to /var for a system upgrade though... What is a safe minimum size for /var? Or am I stuck with 10GB still then? Thank you for your input. |
Short answer would be that there is no definite answer. Var is indeed variable directory. For example, in my case, it uses some 5,6GB of space. I could make it smaller, for example be cleaning /var/cache/apt/archives that take 4,4GB of that. But I have plenty of room, so no need for that. In your case, if you do not need archives and if you setup your apt tools to automatically clean archives and if you have nice set up for logs that do not fill like mad, you do not need more than 2GB. But, unless you really, really need /var as separate directory, just put it under / and do not think much about it. All you need of partitions is / and /home, plus some swap, depending on your RAM and need for hibernate, in case of laptops. You do not need even /home, it all can go under /, but having /home separate can make your life easier, when it comes to backups and such.
|
If you could really use every GB of the SSD, I would recommend you modify things so that everything is in a single partition that takes up the entire SSD. Only have a true swap partition if you use the hibernation feature (suspend to disk). If you don't use hibernation, but you still want swap, create a swapfile. With a swapfile, it's easy to delete it at any time if you need more disk space.
I've used Debian for many years, but honestly I have never used /var on a separate partition. But I can say 2GB would definitely be enough unless you have, say, a humongous web site stored on /var/www (the default location for a web site). Some stuff you can do to clean up disc space: Code:
apt-get clean Another thing that can help conserve disc space, but at the expense of RAM, is to mount /home/user/.cache on a tmpfs RAM disk. Depending on your web browser(s) and web browsing habits, this might amount to a large fraction of a GB. Of course, moving it from the SSD to RAM isn't a free ride. It consumes space in RAM, and also it gets wiped clean when you reboot. Still, there are various things I like to mount on RAM disks: Code:
Filesystem 1M-blocks Used Available Use% Mounted on Code:
none /tmp tmpfs defaults 0 0 1) copy /etc/fstab and prepare a modified fstab: Code:
cp -vax /etc/fstab /etc/fstab.backup 2) Boot up to a liveCD. 3) Use gparted to resize/move partitions, if necessary, to provide adequate room in the / partition to store everything. Delete the swap partition at this time (depending on the liveCD, you might need to run "swapoff -a" first to unlock the swap partition.) 4) Mount the various partitions. 5) Copy the contents of various partitions to the appropriate locations in the / partition. Something like this: Code:
cp -vax /media/user/VARPART/* /media/user/ROOTPART/var/ 7) Boot back into the liveCD; use gparted to delete the now unused partitons. Resize the main partition to use the entire space of the SSD. |
On my laptop /var is 1.6G. IIRC I installed the previous Debian version and did one dist-upgrade. But /var can grow fast if you have some logfiles which suddenly grow large.
Current desktop installations I make with 1 or 2 partitions. At most a separate /home but often not even that. Because with limited disk space you need space overhead on each partition just to be sure. And with a single partition you share that overhead. jlinkels |
I guess the definitive answer is: you can't know. Also the tip to just put it under the root directory makes sense.
(In my previous setup it sort of made sense, because I tried to spare another SSD from spurious writes.) |
All times are GMT -5. The time now is 04:56 AM. |