LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-10-2010, 02:57 PM   #1
kopper27
Member
 
Registered: Nov 2009
Posts: 147

Rep: Reputation: 16
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
 
Old 05-10-2010, 03:12 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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
 
Old 05-10-2010, 03:24 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
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?
 
Old 05-10-2010, 04:19 PM   #4
kopper27
Member
 
Registered: Nov 2009
Posts: 147

Original Poster
Rep: Reputation: 16
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
 
Old 05-10-2010, 04:30 PM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
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.)
 
Old 05-10-2010, 04:52 PM   #6
kopper27
Member
 
Registered: Nov 2009
Posts: 147

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by anomie View Post
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
 
Old 05-10-2010, 05:16 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to reduce size of a partion /dev/sda4 containg /var farnaw4u Linux - Software 2 03-27-2009 12:53 AM
How to reduce the size of wpa_suppliments? sybercop Programming 1 11-10-2007 01:39 PM
LVM: The Impact of Reducing a Logical Volume Size? muff Linux - General 0 07-27-2007 03:18 AM
Reduce Install Size Andy@DP Debian 12 07-03-2007 06:10 PM
help me reduce my OS size =/ xushi Slackware 29 12-01-2004 12:45 PM


All times are GMT -5. The time now is 12:56 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration