Reduce /var filesystem


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Reduce /var filesystem
# 1  
Old 05-10-2010
Reduce /var filesystem

hi guys

I need to create a temporary Filesystem and the only way to do it is to reduce /var and create a new filesystem 3GB size

Code:
df -h
....
...
/dev/mapper/VolGroup00-var
                      9.7G  1.5G  7.8G  16% /var

my question is according to google search I need to umount the filesystem point in order to reduce its size.... so it means I will require that nobody uses the system? since /var logs a lot information?

I also have the option to reduce /root but I think is more complicated.

so what are the precautions in order to reduce /var/?

thanks a lot
# 2  
Old 05-11-2010
There will be a lot of demons writing in there - I suggest you boot up this box with same rescue disc or in safe mode and try to umount /var and reduce it according to your LVM commands. Anyway your /var looks veeeery large, maybe far too large.
Maybe there is another less important FS in your VG that can be unmounted and reduced only.. maybe something like /home, idk.
This User Gave Thanks to zaxxon For This Post:
# 3  
Old 05-11-2010
We assume that you do not have 3 Gb of unallocated disc space and cannot add new discs.

Personally I wouldn't attempt to reduce a filesystem "in situ". I believe that it is only ever safe to create a replacement filesystem. This is because it can be too difficult to find out the high water mark of a filesystem even where your O/S allows you to re-size filesystems and disc partitions.

If you embark on this, make two "cold metal" backups (I don't mean "tar") of all system partitions (incl. /var) and rehearse recovery on a spare computer before rehearsing the operation on that spare computer.

It may be easier to create soft link under root (or whatever) with the required name of the temporary filesystem and point it to a new directory under /var .
This User Gave Thanks to methyl For This Post:
# 4  
Old 05-11-2010
Quote:
Originally Posted by methyl
It may be easier to create soft link under root (or whatever) with the required name of the temporary filesystem and point it to a new directory under /var .

just something like this

Code:
ln -s /var/newfs NewFileSystem

?
# 5  
Old 05-11-2010
If you want to provide space to this server on temporary basis then :

Code:
1) You can take space from any other server.
2) Make a filesystem on that server.
3) NFS mount this filesystem on to your required server.

SmilieSmilie
# 6  
Old 05-12-2010
Code:
ln -s /var/newfs NewFileSystem

Yes.

Of course it isn't actually a filesystem, you are just using disc space under /var .

Depending on the circumstances you could just create a directory under /var .
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to increase the /var (UFS) filesystem and root disk under veritas control?

I need to increase the /var (UFS) filesystem and root disk under veritas control or root disk is encapsulated # df -k /var Filesystem kbytes used avail capacity Mounted on /dev/vx/dsk/var 13241195 12475897 674524 96% /var # fstyp /dev/vx/dsk/var ufs # pkginfo... (1 Reply)
Discussion started by: amity
1 Replies

2. Red Hat

Shrink ext4 filesystem and reduce the size of a Logical Volume in Linux

Hello guys, I would like to ask you kindly if you don't know some quick and safe method how to shrink ext4 filesystem and reduce the size of a Logical Volume in Linux, please? Thank you very much. (2 Replies)
Discussion started by: los_bandidos
2 Replies

3. Shell Programming and Scripting

Csh , how to set var value into new var, in short string concatenation

i try to find way to make string concatenation in csh ( sorry this is what i have ) so i found out i can't do : set string_buff = "" foreach line("`cat $source_dir/$f`") $string_buff = string_buff $line end how can i do string concatenation? (1 Reply)
Discussion started by: umen
1 Replies

4. Red Hat

How to reduce inode size of /var?

Hi, inode size reached its 100% in /var Due to this i'am getting the error No space left on device my crond process is stopped and when i want to restart it it is showing the below error Starting crond: crond: can't open or create /var/run/crond.pid: No space left on device df -i o/p ... (3 Replies)
Discussion started by: Mohamed Thamim
3 Replies

5. Solaris

metadetach error on /var filesystem

Hi Everyone I am trying to detach sub mirror for /var/ filesystem not sure how to detach this sub mirror. someone please guide, I am removing all devices from using SVM. metastat -p bash-3.00#metastat -p d3 -m d13 1 d13 3 1 c1t2d0s3 \ 1 c1t2d0s5 \ 1 c1t3d0s3... (6 Replies)
Discussion started by: bobby320
6 Replies

6. Solaris

Have mounted a filesystem in /var and now cannot log in

hi, i might not be posting my question in the right place because i don't know where to post questions my question is like this i created a partition named 'var' in the SOLARIS os .,and then i knowingly mounted it on /var ..now after doing this am not able to login to my... (4 Replies)
Discussion started by: shekhar_4_u
4 Replies

7. AIX

/var filesystem is full

Hi, Is there a way to clear the temp files from /var/tmp? Is root access required to delete the files? Thanks, Narayan (2 Replies)
Discussion started by: narayanv
2 Replies

8. Solaris

diff b/w /var/log/syslog and /var/adm/messages

hi sirs can u tell the difference between /var/log/syslogs and /var/adm/messages in my working place i am having two servers. in one servers messages file is empty and syslog file is going on increasing.. and in another servers message file is going on increasing but syslog file is... (2 Replies)
Discussion started by: tv.praveenkumar
2 Replies

9. UNIX for Advanced & Expert Users

diff command filling /var filesystem space

Hi, I am using diff command to check difference between two files.Both files are very big and when i execute this command /var temp space is filled up almost 99%. Can any one please tell me is there any way i can specify directory name which has more space so that diff can use that dir for... (2 Replies)
Discussion started by: ukatru
2 Replies

10. Solaris

/var filesystem recovery from other machine

Hi Folks, I'm wordering if I can ufsdump the /var fs from a server1 and create a new /var fs in Server2, that is because some damage happened in the /var fs and we don't have backup of it, I've tried fsck and no sucess at all.. Any ideia how I can recovery that /var fs ? Thanks, ... (0 Replies)
Discussion started by: ramosbrazil
0 Replies
Login or Register to Ask a Question