LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-13-2012, 11:29 AM   #1
newbie14
Member
 
Registered: Sep 2011
Posts: 646

Rep: Reputation: Disabled
/var folder size


Dear All,
We are about to build a new centos machine and have seen previously that this /var could grow due to many log and even the mysql db in it. So what is the best way to handle it create a separate partition or increase its size will do? Thank you.
 
Old 12-13-2012, 12:22 PM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
Quote:
So what is the best way to handle it create a separate partition...
Yes, best choice. /var holds logs and important system run records; moreover, it often house some /tmp directories peculiar to DE's, so it can reasonably grow, especially if running as a server.

Regular desktop eats between 800Mb to 1.5 GiB of space for /var. So, if you want to make sure not to overrun the size you may create a partition for /var about 2-3GiB.

Should consumption increase as to exceed that partition space you can remedy by moving that voracious tmp file to another spacious partition and leave only a link in the original /var location; (I have done this many times with mine) --
Quote:
ln -s /home/tmp/kde.tmp /var/tmp/kde.tmp
There are many ways of working it around though.

Quote:
or increase its size will do?
It is not arbitrary for the user to increase or decrease usage of /var/tmp; this is a work space for some important libraries. If you expect your system will use /var extensively then mount it to a sizable partition.

Quote:
Thank you.
Welcome.
 
Old 12-13-2012, 12:28 PM   #3
newbie14
Member
 
Registered: Sep 2011
Posts: 646

Original Poster
Rep: Reputation: Disabled
Dear Malek,
Well we have encounter before the log files even cross 50Gb so wondering if we allocate it 100Gb where it houses mysql server too. Will that be a good and safe choice. What are the other folders which can be eating up the hard disk ? Is it good to keep /tmp also on separate partition? IS there any security vulnerability if we keep them on separate partitions?
 
Old 12-14-2012, 09:42 AM   #4
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
Quote:
Well we have encounter before the log files even cross 50Gb so wondering if we allocate it 100Gb where it houses mysql server too. Will that be a good and safe choice.
I have overlooked your declaration that you will house the mysql database there; so, if that's the case you'd better prepare a bigger volume commensurate to the size of database expected.

W
Quote:
hat are the other folders which can be eating up the hard disk ?
/usr should be enough to contain all libraries, binaries, documentations, etc.


Quote:
Is it good to keep /tmp also on separate partition? IS there any security vulnerability if we keep them on separate partitions?
Yes, for in doing so you can impose permissions at mounting the /tmp partition.
 
Old 12-14-2012, 11:26 AM   #5
newbie14
Member
 
Registered: Sep 2011
Posts: 646

Original Poster
Rep: Reputation: Disabled
Dear Malek,
For example when I run this command fdisk -l I get this . So when I do partition each will be shown separately I guess rite. What does this represent /dev/mapper/VolGroup-lv_? What is the VolGroup here? So how big should I keep the /usr folder? What is the security permission I should impose on /tmp and how big this size should be? Say I got a 250Gb hard disk can I give 150 gb to /var and /5gb to /usr and 5gb to /tmp?

Quote:
Disk /dev/xvda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a854e

Device Boot Start End Blocks Id System
/dev/xvda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2 64 13055 104344576 8e Linux LVM

Disk /dev/mapper/VolGroup-lv_root: 51.7 GB, 51707379712 bytes
255 heads, 63 sectors/track, 6286 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_swap: 2080 MB, 2080374784 bytes
255 heads, 63 sectors/track, 252 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_home: 53.1 GB, 53057945600 bytes
255 heads, 63 sectors/track, 6450 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
 
Old 12-14-2012, 11:59 AM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
It depends on what the machine is doing. /tmp can be a hog. When you watch a youtube video it hogs space in /tmp (depending on version of flash). When I edit an audio file in audacity it makes copies of each track in /tmp. And I do 24bit/192kHz recording of hour plus concerts, so 4GB per copy, and each edit creates an additional copy for undo history.

In debian /var also hosts /var/cache/apt/archives/ which is where all of your packages get downloaded to when you do the inital install and each update there after. You can generally purge these safely, but you have to know they exist first. And /usr/share/doc/ can be a real hog of mostly unused stuff. At least from a desktop orientation where every available thing is installed even if most of it never sees a cpu cycle after the install.

As I look at my fresh debian sid install of < 1 weeks use and already just shy of 9GB of space. And Gnome or KDE isn't even installed (using IceWM). With 1.3GB of debs in the archive and 0.9GB in /usr/share/doc/ and 2.7GB in /home/. /home breaks down to 1GB in game/browser cache + 1.1GB in video driver files(--keep), which isn't really much in user files yet. For someone who records and edits video and audio. Fortunately I still have 39GB elbow room with the current setup. Which would imply that I still have 30GB of cruft to sort through from the previous install on this same device and location.
 
Old 12-14-2012, 12:43 PM   #7
newbie14
Member
 
Registered: Sep 2011
Posts: 646

Original Poster
Rep: Reputation: Disabled
Dear Shadow,
My usage is on centos 6.2 mainly for mysql server and apache server. With that in mind do you think I should make a bigger /tmp?
 
Old 12-14-2012, 04:41 PM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Only one way to know that. Is to use it and see what works. If you're already using it, you might want to monitor it too see what it's typical usage is during peak hours for your purposes. From my experience, /tmp seems to have taken on the role that swap used to take. Except that it's treated directly as temporary storage space instead of RAM that doesn't exist. And most things that use it for anything size-able seem to be expecting sizes that they already know will NOT fit in RAM. Does that mean use the old 2*RAM rule associated for swap space, I do not know. But it's always good to have too much than too little.
 
Old 12-16-2012, 07:32 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
1. you need to look at current usage and go from there. Each system is different, A separate partition for /var may be a good idea.
Also consider putting the DB on its own partition.
2. maybe you need to make logrotate more aggressive; adjust your backup system to match so you don't lose anything.
 
Old 12-16-2012, 09:22 PM   #10
newbie14
Member
 
Registered: Sep 2011
Posts: 646

Original Poster
Rep: Reputation: Disabled
Dear Chirsm,
So if I set the db for its own partition I must set from the mysql settings right? Another thing will partition be good idea to maintain the harddisk space? For the tmp I think I will go with the idea from Shadow_7.
 
Old 12-17-2012, 02:55 AM   #11
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
From a performance perspective you might want the DB to be it's own device. And not just a partition. If you're still on spinning platter storage medium, there's a performance costs to move the read heads back and forth between partitions. It does not "have to" be, depending on usage. But things that are going to abuse a device (heavy reads / write) like a database or logging, you'll want to point at a different device to manage wear and tear. Plus that makes backing up and long term maintenance easier.
 
Old 12-17-2012, 06:16 AM   #12
newbie14
Member
 
Registered: Sep 2011
Posts: 646

Original Poster
Rep: Reputation: Disabled
Dear Shadow,
Yes this machine is going to be dedicated just for the db. So what else to do because I am sure there will be heavy read/write because it is the db server. So what type of backing is suggesting like for mysql I see there is tools from percona. Based on your experience what are key steps normally taken to avoid disasters?
 
Old 12-20-2012, 01:19 AM   #13
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Disaster, redundancy, resiliency, performance options; backups, RAID, clusters, replication.
See also the innodb_file_per_table option.
 
Old 12-20-2012, 07:05 AM   #14
newbie14
Member
 
Registered: Sep 2011
Posts: 646

Original Poster
Rep: Reputation: Disabled
Dear Christmas,
So far tried to implement replication and also innodb_file_per_table. Will look into your other options too.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What to delete in /var dir if size of /var directory is 98%? manalisharmabe Linux - Newbie 6 10-15-2011 12:20 PM
[SOLVED] How to list folder size, and number of files and folders in folder steven.c.banks Linux - General 3 11-24-2010 06:24 AM
Increasing size of /var folder or mount to another folder jbspain Linux - Server 7 11-18-2010 02:33 AM
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 02:09 PM
how can i default the max folder file size when it create inside a folder antony_csf Linux - Software 1 06-17-2004 02:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:00 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