LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Reduce /var filesystem Size - Impact? (https://www.linuxquestions.org/questions/linux-newbie-8/reduce-var-filesystem-size-impact-807011/)

kopper27 05-10-2010 01:57 PM

Reduce /var filesystem Size - Impact?
 
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

Tinkster 05-10-2010 02:12 PM

Why is "reducing /var" the only way? As a quick and dirty
hack you could just as well get rid of the physical /tmp
and symlink it to something under /var (if this is a temporary
measure, that is).

But yes, if you go to single user mode you should be able
to unmount /var and resize it. If it won't let you use a
rescue-/live-CD.


Cheers,
Tink

anomie 05-10-2010 02:24 PM

There are probably a couple ways to deal with this situation that do not involve shrinking the /var filesystem. What is the exact problem you are trying to solve? How "temporary" is this new 3GB filesystem going to be? Do you have physical access to the server?

kopper27 05-10-2010 03:19 PM

thanks guys

well basically this system has

Code:

[root@vvvvvv ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol02
                      79G  23G  53G  30% /
/dev/sda1              99M  14M  80M  15% /boot
tmpfs                1.7G    0  1.7G  0% /dev/shm
/dev/mapper/VolGroup00-LogVol00
                      9.7G  3.1G  6.2G  34% /var

and someone needs to install an application and requires a temporary filesystem let's say for 3 weeks after that the filesystem can be deleted or whatever
but as you see I only have / and /var filesystem and no space for more filesystems
Code:

[root@vvvvvv ~]# pvs
  PV        VG        Fmt  Attr PSize  PFree
  /dev/sda2  VolGroup00 lvm2 a-  67.88G    0
  /dev/sdb1  VolGroup00 lvm2 a-  24.97G    0
[root@vvvvvv ~]# lvs
  LV      VG        Attr  LSize  Origin Snap%  Move Log Copy%
  LogVol00 VolGroup00 -wi-ao 10.00G
  LogVol01 VolGroup00 -wi-ao  2.00G
  LogVol02 VolGroup00 -wi-ao 80.84G
[root@vvvvvv ~]# vgs
  VG        #PV #LV #SN Attr  VSize  VFree
  VolGroup00  2  3  0 wz--n- 92.84G    0


anomie 05-10-2010 03:30 PM

Do they really need a new filesystem for their installation? You have 53GB free on /. Can't you just instruct them to install under, e.g., /foo?

Another option for avoiding interrupting your system is connecting a cheapo USB drive, and creating the new filesystem on it. The performance will be dismal, but this is temporary.

If you really need this space to come from your current volume group, then I'd plan a system downtime and use a live cd (which supports LVM) to 1) shrink the / filesystem; and 2) reduce the / LV. Take backups first.

(Next time, try to keep some free space in your VG so that you can have the flexibility to deal with issues like this.)

kopper27 05-10-2010 03:52 PM

Quote:

Originally Posted by anomie (Post 3963758)
Do they really need a new filesystem for their installation? You have 53GB free on /. Can't you just instruct them to install under, e.g., /foo?

Another option for avoiding interrupting your system is connecting a cheapo USB drive, and creating the new filesystem on it. The performance will be dismal, but this is temporary.

If you really need this space to come from your current volume group, then I'd plan a system downtime and use a live cd (which supports LVM) to 1) shrink the / filesystem; and 2) reduce the / LV. Take backups first.

(Next time, try to keep some free space in your VG so that you can have the flexibility to deal with issues like this.)

yeah I agreed with you...but I did not install these servers...
yeah I really need to know if a filesystem is really required...so if it's really require I will need to take the system down to shrink /var right? I think shrinking /root is more complicated and risky

anomie 05-10-2010 04:16 PM

Well, that's your choice. I suggested the / filesystem because it has plenty of free space.

Shrinking a filesystem is normally OK, but it is definitely not risk free. And it's going to require downtime in your case. Back up first.


All times are GMT -5. The time now is 07:34 PM.