LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 09-10-2017, 12:44 AM   #1
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 262
Blog Entries: 2

Rep: Reputation: 49
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.
 
Old 09-10-2017, 01:49 AM   #2
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 09-10-2017, 01:49 AM   #3
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 09-10-2017, 06:18 AM   #4
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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
apt-get install localepurge
apt-get remove --purge packageYouDontWant
apt-get autoremove --purge
I always run apt-get clean to flush out cached archives after installing regular updates. Localepurge is a package to get rid of stuff for languages other than the one(s) you need. It doesn't actually free up much space, so don't be surprised when it doesn't really help much.

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
none                         3950      33      3917   1% /var/log
none                         3950       0      3950   0% /var/tmp
none                         3950       1      3950   1% /tmp
none                         3950       0      3950   0% /media
none                         3950     246      3705   7% /home/kuo/.cache
The /etc/fstab entries for these look like:
Code:
none /tmp         tmpfs defaults 0 0
none /var/tmp      tmpfs defaults 0 0
none /media         tmpfs defaults 0 0
none /var/log        tmpfs defaults 0 0
none /home/kuo/.cache tmpfs defaults 0 0
Anyway, the basic steps for converting to a single large partition would be:

1) copy /etc/fstab and prepare a modified fstab:

Code:
cp -vax /etc/fstab /etc/fstab.backup
vi /etc/fstab
Modify it by deleting or commenting out the entries for /var and /home and other such things, as well as comment out the swap partition entry.

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/
6) After all contents have been copied, reboot the system to make sure everything works. Use "fdisk -l" to confirm that none of the other partitions are mounted.

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.
 
Old 09-10-2017, 06:41 AM   #5
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
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
 
Old 09-13-2017, 09:48 AM   #6
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 262

Original Poster
Blog Entries: 2

Rep: Reputation: 49
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.)
 
  


Reply

Tags
installation, partitioning


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
is swap space needed when RAM is greater than hard drive space ? ron7000 Linux - General 9 11-13-2014 08:56 PM
Why? Why SetPageReserved is needed when map a kernel space to user space? osdev Linux - Kernel 9 03-10-2013 06:16 PM
I am out of /var space? RMLinux Linux - Newbie 17 11-26-2008 11:13 PM
confusingly weird prob. answer needed URGENTLY! sachitha Linux - Newbie 4 10-16-2003 05:34 PM
Small prob. but Answer needed URGENTLY!!! sachitha General 2 09-01-2003 05:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration