LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-28-2008, 10:12 AM   #1
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, USA
Distribution: VMware V12 and V15 in Windows 10, MX Linux 23.1, Kubuntu 23.10, IBM z/VM 5.4
Posts: 558

Rep: Reputation: 34
Out of space on the VAR file system


Hello,

I ran out of space on the VAR file system.

The VAR file system isn't the last one on the disk and there is plenty of space on the rest of hard drive and it was allocated when I the extended partition.

Is there anyway to move the file systems that follow VAR down, then leave free space just after VAR and expand it?

Won't I have to unmount the VAR file system and the rest of the file systems before they are moved...providing they can be moved?

Windows has Partition Magic is there any such thing for Linux.

Suse 11.0

Thanks
 
Old 12-28-2008, 10:31 AM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
parted magic or systemrescue cd, and symlinks should be enough
 
Old 12-28-2008, 10:56 AM   #3
mk27
Member
 
Registered: Sep 2008
Distribution: fedora, gentoo, ubuntu
Posts: 148

Rep: Reputation: 23
Quote:
Originally Posted by swamprat View Post
The VAR file system isn't the last one on the disk and there is plenty of space on the rest of hard drive and it was allocated when I the extended partition.

Is there anyway to move the file systems that follow VAR down, then leave free space just after VAR and expand it?
Do you mean there is actually space left on the device (eg, /dev/sda1) with /var on it? If so, you have not really run out of space. Who/what told you this?

But I presume you mean that the partition is full but you could add another partition on the hard drive. If so, you could make another partition, move /var into it, create an empty /var as a mount point in your root filesystem, and add something like this to /etc/fstab, if the new partition is /dev/hda3:

Code:
/dev/hda3   /var   ext3 auto 0 2
Then at boot time that partition will automatically be mounted on /var.

Last edited by mk27; 12-28-2008 at 10:57 AM.
 
Old 12-28-2008, 11:29 AM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Note that the OP is using CentOS under VMWare running on an XP system. That's a configuration that may impose additional restrictions on file and partition management, and I'd expect that "standard" replies related to /dec/sda and 'partitions" need to factor in the VMWare restraints.

That being said, I haven't a clue as to what the OP meant by "the VAR file system," nor anything about VMWare.
 
Old 12-28-2008, 03:09 PM   #5
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, USA
Distribution: VMware V12 and V15 in Windows 10, MX Linux 23.1, Kubuntu 23.10, IBM z/VM 5.4
Posts: 558

Original Poster
Rep: Reputation: 34
Thanks MK27.

A DF -K noted that /var was 100% full.

I like your idea of how to fix this problem.

I have these questions, how can I create a second /var partition (empty space on the same physical drive, like you said). Do I need to unmount the filled up partition?

How can I copy the data from one /var to another /var both with the same name.

Can be more specific with some details please.

Thanks again...

Last edited by swamprat; 12-28-2008 at 03:15 PM. Reason: Include OS: Suse 11.0
 
Old 12-28-2008, 03:37 PM   #6
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Why go through the effort and aggravation of having a separate /var partition in the first place? Put it all (/home, /etc, /everything) under "/" and have done with it.

Last edited by Quakeboy02; 12-28-2008 at 03:39 PM.
 
Old 12-28-2008, 03:56 PM   #7
mk27
Member
 
Registered: Sep 2008
Distribution: fedora, gentoo, ubuntu
Posts: 148

Rep: Reputation: 23
I agree with QuakeBoy2 and think you should have a look in /var first.

/var/log contains the system logs, like messages, that can get very big over time if you don't occasionally trim them. You probably have a few monster logs in there. How big is the partition?

Anyway, you are obviously close to overstuffing the thing anyway. You can expand your filesystem in the manner I describe by choosing a directory to move out for fstab mounting. /usr/local is a more normal choice, but if you want to use /var I think it should be fine. Just make sure it is set up to automount as I described! There are some directories you should not do this with, notably /lib and /sbin.

You can add a partition with fdisk. You should try and figure out how to do this yourself, tho, by reading the man page and asking questions, because obviously you can ruin everything if you are not clear about what you are doing (there are some graphical tools for this that I'm unfamiliar with which you might prefer).

Once you have a new ext3 partition, create a temporary mount point for it and try to mount it (let's say this is /dev/hda3):

Code:
mkdir /mnt/tmp
mount -v -t ext3 /dev/hda3 /mnt/tmp
If it doesn't mount, you didn't create a valid ext3 partition. If it did, everything is fine.

Now you just copy the contents of /var into /mnt/tmp. Don't do it so you end up with a /mnt/tmp/var, do it so that /mnt/tmp looks exactly like /var. Follow?

Then you can ADD THAT LINE TO FSTAB, erase /var, and reboot immediately. I'm presuming that you are actually using a normal Suse installation and not that thing PTrenholme mentioned. Be careful!

Last edited by mk27; 12-28-2008 at 03:59 PM.
 
Old 12-28-2008, 04:11 PM   #8
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
There is no good reason for /var to ever fill up anyway. Pruning the logs is a good place to start, but likely isn't the biggest problem. You should take a look in cache, particularly in the mail cache, to see if you have a directory that is just getting bigger and bigger and bigger.

Could be you have an error message being emailed to someone every couple of minutes but your mail transfer agent is not properly configured, so those messages are piling up in the outgoing mail queue. I have seen literally millions of files accumulate in that queue under these conditions, taking up gigabytes of hard drive space.
 
Old 12-28-2008, 05:00 PM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Quote:
Originally Posted by Quakeboy02 View Post
Why go through the effort and aggravation of having a separate /var partition in the first place? Put it all (/home, /etc, /everything) under "/" and have done with it.
For workstations that is fine, but for a server, you want separate partitons that need to be mounted with different attributes. For example, /tmp and /var/tmp should be mounted with the noexec,nodev options. On some filesystems, you want to include quota support. Some partitions should be mounted read-only. On a workstation, the /home and /usr partitions will be the largest, you having a separate /home partition makes sense, allowing you to reinstall or install a different distro, but preserving your personal files. On a server, the /srv may be the largest, and the /home directory relatively unimportant.

I would first look at /var/log/ and check if there are a lot of archived logs that can be moved to backup or deleted. If it is a mail server, do you have a user with GBs of mail? Maybe you want to enforce quotas.

However, since the OP is running CentOS under VMWare, your advice is this case may be best. The OP's capitalization of /var distracted me from some details, wondering if it was an acronym instead of the /var directory.

Last edited by jschiwal; 12-28-2008 at 05:02 PM.
 
Old 12-28-2008, 05:04 PM   #10
mk27
Member
 
Registered: Sep 2008
Distribution: fedora, gentoo, ubuntu
Posts: 148

Rep: Reputation: 23
Quote:
Originally Posted by jiml8 View Post
There is no good reason for /var to ever fill up anyway.
Most likely we have run out of space on the partition and the first time it was noticed was when something went to write to /var.

So probably swamprat does need to reorganize his/her filesystem, but not necessarily by moving /var, which is what I was trying to hint at by saying there may be a (larger) and more appropriate directory, like /usr/local or (best idea) even /usr itself, since /usr is never suppose to contain files needed prior to fstab mounting.

In fact, the original purpose of the /usr directory in the *nix filesystem hierarchy was to permit a filesystem to be split across devices in the manner I've described.
 
Old 12-28-2008, 05:15 PM   #11
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
/var is not supposed to be a subdirectory of anything other than "/". If it's too small it needs to be expanded: either by making the partition larger or moving it to "/". If you are trying to say that it should somehow be linked out of /usr or anything else, then that is wrong.
 
Old 12-31-2008, 10:00 PM   #12
swamprat
Member
 
Registered: Sep 2005
Location: New Jersey, USA
Distribution: VMware V12 and V15 in Windows 10, MX Linux 23.1, Kubuntu 23.10, IBM z/VM 5.4
Posts: 558

Original Poster
Rep: Reputation: 34
Thanks again MK27.
Been tied up with the day job for the last few days but back to this issue now.

As you can see from the information I pasted in below I named the new partition "varnew".
I did the copy as you indicated and that worked without an issue also.
Now I'm ready to do the fstab thing and I need some more information and hand holding with this as I'm a newbie and I don't want to kill the whole system. The FSTAB is posted below also.

As you can see when I executed the mount command it must have placed the information about the new filesystem in the FSTAB member.

Now I'm not sure what to do next. I really want to rename varnew to var...if possible and get ride of the old VAR partition.

Can I just delete the old VAR partition, do a MV VARNEW VAR? Fix the line with /dev/sda11 to VAR and the reboot? Will that do the trick?

If not how would I go about resolving this.

Thanks all and Happy New Year.


vuquestmain:/ # df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 608756 331988 245844 58% /
udev 133584 136 133448 1% /dev
/dev/sda3 62217 17760 41244 31% /boot
/dev/sda7 311123 147664 147396 51% /home
/dev/sda9 2071384 68960 1897200 4% /opt
/dev/sda10 497829 31808 440319 7% /srv
/dev/sda6 209998 55185 143971 28% /tmp
/dev/sda8 5676464 3605216 1782884 67% /usr
/dev/sda5 311123 299236 0 100% /var
/dev/sda11 798476 312580 445336 42% /varnew
vuquestmain:/ # cd varnew
vuquestmain:/varnew # ls
adm games lock lost+found opt spool usermin X11R6
cache lib log mail run tmp webmin yp
vuquestmain:/varnew #

/dev/sda1 swap swap defaults 0 0
/dev/sda2 / ext3 acl,user_xattr 1 1
/dev/sda3 /boot ext3 acl,user_xattr 1 2
/dev/sda7 /home ext3 acl,user_xattr 1 2
/dev/sda9 /opt ext3 acl,user_xattr 1 2
/dev/sda10 /srv ext3 acl,user_xattr 1 2
/dev/sda6 /tmp ext3 acl,user_xattr 1 2
/dev/sda8 /usr ext3 acl,user_xattr 1 2
/dev/sda5 /var ext3 acl,user_xattr 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
/dev/sda11 /varnew ext3 acl,user_xattr 1 2

Last edited by swamprat; 12-31-2008 at 10:02 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with /var File system AbrahamJose AIX 8 02-19-2006 03:28 PM
Problem with /var File system AbrahamJose AIX 1 02-06-2006 09:54 AM
Large tar file taking huge disk space in ext3 file system pcwulf Linux - General 2 10-20-2003 07:45 AM
/var file space too low need to make it larger hoodman10 Linux - Newbie 1 11-25-2002 06:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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