Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: VMware V12 and V15 in Windows 10, MX Linux 23.1, Kubuntu 23.10, IBM z/VM 5.4
Posts: 558
Rep:
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.
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.
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.
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:
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
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.
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!
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.
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.
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.
/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.
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:
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.