LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 11-19-2008, 10:44 PM   #1
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Rep: Reputation: 37
I am out of /var space?


Hi keen folks!

how can I increase my /var directory without reformating my system.
I am using RHEL4

[root@localhost var]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup_ID_17452-LogVol1
1008M 205M 752M 22% /
/dev/sda3 190M 15M 166M 8% /boot
none 2.0G 0 2.0G 0% /dev/shm
/dev/mapper/VolGroup_ID_17452-LogVol2
496M 15M 457M 4% /tmp
/dev/mapper/VolGroup_ID_17452-LogVol5
154G 3.1G 143G 3% /usr
/dev/mapper/VolGroup_ID_17452-LogVol4
496M 471M 0 100% /var
/dev/mapper/VolGroup_ID_17452-LogVolHome
123G 3.4G 114G 3% /home
[root@localhost var]#
 
Old 11-19-2008, 10:51 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You could add another partition into that logvol as one solution. Perhaps shrink the home logvol a bit and use that.
 
Old 11-19-2008, 10:57 PM   #3
n03x3c
Member
 
Registered: Aug 2008
Location: India
Distribution: Fedora, RedHat
Posts: 101

Rep: Reputation: 17
You have to use lvextend command for extending your logical volume

In case, if you're having some space left on your current volume group, use following command

Code:
lvextend -L +SIZEM/G lvname
If you don't have any space left on your volume group, create new physics volume, add it to your vol group and then extend your logical volume

pvcreate /path/to/new/dev
vgextend lvname /path/to/new/dev

And then you can extend your logical volume because your VG is now having space added to it.
 
Old 11-19-2008, 11:11 PM   #4
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by n03x3c View Post
You have to use lvextend command for extending your logical volume

In case, if you're having some space left on your current volume group, use following command

Code:
lvextend -L +SIZEM/G lvname
If you don't have any space left on your volume group, create new physics volume, add it to your vol group and then extend your logical volume

Code:
pvcreate /path/to/new/dev
vgextend lvname /path/to/new/dev
And then you can extend your logical volume because your VG is now having space added to it.
Hi thanks to all reply!


To n03x3c: can you give me the exact command on how to do it?

suppose I want to add 20G on /var? here's my fdisk-l command thank you.

can you fill-up your response with the correct Volume that am I going to type what I mean fill-up all your syntax :-)?

[root@localhost ~]# fdisk -l

Disk /dev/sda: 499.9 GB, 499999834112 bytes
255 heads, 63 sectors/track, 60788 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 5 40131 de Dell Utility
/dev/sda2 6 16305 130929750 83 Linux
/dev/sda3 * 16306 16330 200812+ 83 Linux
/dev/sda4 16331 60788 357108885 5 Extended
/dev/sda5 16331 60788 357108853+ 8e Linux LVM

according to man lvextend:
Examples
"lvextend -L +54 /dev/vg01/lvol10 /dev/sdk3" tries to extend the size
of that logical volume by 54MB on physical volume /dev/sdk3. This is
only possible if /dev/sdk3 is a member of volume group vg01 and there
are enough free physical extents in it.

which [/dev/sdk3] am I going to use in my case? is it sda4 or sda5?

Last edited by RMLinux; 11-19-2008 at 11:34 PM.
 
Old 11-19-2008, 11:45 PM   #5
n03x3c
Member
 
Registered: Aug 2008
Location: India
Distribution: Fedora, RedHat
Posts: 101

Rep: Reputation: 17
Ofcourse you're going to use sda5 in your case.

Extended partition hold all partition after it, so neva use extended partition. If you del it, all partition after it will be gone.

And the command you found on man page, let you extend your /var on specific partition, if you're having logical volume management tool on your system, you will see the logical as well as physical view of your volumes and you will understand it better.
 
Old 11-20-2008, 09:02 AM   #6
dickgregory
Member
 
Registered: Oct 2002
Location: Houston
Distribution: Arch, PCLinuxOS, Mint
Posts: 257

Rep: Reputation: 34
The first thing I would do is remove all of the old log files under /var. Log files can fill up a partition of < 500MB pretty fast if they are not managed. But if you have a regular process that rotates them and archives them, or simply removes the old ones, you may be fine without adding space.
 
Old 11-20-2008, 03:07 PM   #7
williebens
Member
 
Registered: Jan 2008
Posts: 88

Rep: Reputation: 16
I canceled this post.
I will post it again.
Thanks.
--Willie

Last edited by williebens; 11-20-2008 at 03:43 PM.
 
Old 11-21-2008, 03:19 AM   #8
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Original Poster
Rep: Reputation: 37
http://www.ibm.com/developerworks/li...ry/l-lvm2.html

I google to internet I am currently reviewing that links hope others can test it also.

here's another link to review folks! http://www.redhat.com/magazine/009jul05/features/lvm2/


I read RHEL4 use LVM2

Last edited by RMLinux; 11-21-2008 at 08:59 PM.
 
Old 11-21-2008, 08:07 PM   #9
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Original Poster
Rep: Reputation: 37
I tried lvextend here's the error message.


[root@localhost /]# lvextend -L+200G /dev/VolGroup_ID_17452/LogVol4

Extending logical volume LogVol4 to 200.50 GB
Insufficient free space: 6400 extents needed, but only 5772 available


what am I going to do next?

quote from no3x3c
Quote:
If you don't have any space left on your volume group, create new physics volume, add it to your vol group and then extend your logical volume

pvcreate /path/to/new/dev
vgextend lvname /path/to/new/dev
kindly fill this up according to my need. thanks



the following are my HDD partitions information:

[root@localhost etc]# df -h
Filesystem Size Used Avail Use% Mounted on


/dev/mapper/VolGroup_ID_17452-LogVol1
1008M 205M 752M 22% /
/dev/sda3 190M 15M 166M 8% /boot
none 2.0G 0 2.0G 0% /dev/shm
/dev/mapper/VolGroup_ID_17452-LogVol2
496M 15M 457M 4% /tmp
/dev/mapper/VolGroup_ID_17452-LogVol5
154G 3.1G 143G 3% /usr
/dev/mapper/VolGroup_ID_17452-LogVol4
496M 468M 2.5M 100% /var ------> I want to increase this Sir to 300G.
/dev/mapper/VolGroup_ID_17452-LogVolHome
123G 4.0G 113G 4% /home




[root@localhost etc]# fdisk -l

Disk /dev/sda: 499.9 GB, 499999834112 bytes
255 heads, 63 sectors/track, 60788 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 5 40131 de Dell Utility
/dev/sda2 6 16305 130929750 83 Linux
/dev/sda3 * 16306 16330 200812+ 83 Linux
/dev/sda4 16331 60788 357108885 5 Extended
/dev/sda5 16331 60788 357108853+ 8e Linux LVM
[root@localhost etc]#



[root@localhost etc]# vgscan -v
Wiping cache of LVM-capable devices
Wiping internal VG cache
Reading all physical volumes. This may take a while...
Finding all volume groups
Finding volume group "VolGroup_ID_17452"
Found volume group "VolGroup_ID_17452" using metadata type lvm2


[root@localhost etc]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup_ID_17452" using metadata type lvm2
[root@localhost etc]#



[root@localhost etc]# vgdisplay -v
Finding all volume groups
Finding volume group "VolGroup_ID_17452"
--- Volume group ---
VG Name VolGroup_ID_17452
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 12
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 6
Open LV 6
Max PV 0
Cur PV 2
Act PV 2
VG Size 465.41 GB
PE Size 32.00 MB
Total PE 14893

Alloc PE / Size 9121 / 285.03 GB
Free PE / Size 5772 / 180.38 GB
VG UUID eHI1zb-ETtp-35RA-fNJa-4r62-TITX-vEHBE0

--- Logical volume ---
LV Name /dev/VolGroup_ID_17452/LogVol1
VG Name VolGroup_ID_17452
LV UUID 4ajEIB-yMzl-om2y-sHGy-hHl3-plaK-fXoZke
LV Write Access read/write
LV Status available
# open 1
LV Size 1.00 GB
Current LE 32
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:0


--- Logical volume ---
LV Name /dev/VolGroup_ID_17452/LogVol2
VG Name VolGroup_ID_17452
LV UUID yUm11O-dakR-jVjZ-fk8P-I0Ld-DFvd-mw9UY5
LV Write Access read/write
LV Status available
# open 1
LV Size 512.00 MB
Current LE 16
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1



--- Logical volume ---
LV Name /dev/VolGroup_ID_17452/LogVol5
VG Name VolGroup_ID_17452
LV UUID 7KyTLD-t1in-ujxH-oXIo-bC1Q-5vQh-4hqUiC
LV Write Access read/write
LV Status available
# open 1
LV Size 156.19 GB
Current LE 4998
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:2



--- Logical volume ---
LV Name /dev/VolGroup_ID_17452/LogVol4
VG Name VolGroup_ID_17452
LV UUID 6wC20r-qVW5-cDK6-p6Xb-dSsw-e777-BMVPKa
LV Write Access read/write
LV Status available
# open 1
LV Size 512.00 MB
Current LE 16
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:3


--- Logical volume ---
LV Name /dev/VolGroup_ID_17452/LogVol0
VG Name VolGroup_ID_17452
LV UUID kXJe8T-uVVJ-CV38-bq0J-VU8x-spKH-pLOsv1
LV Write Access read/write
LV Status available
# open 1
LV Size 2.00 GB
Current LE 64
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:4



--- Logical volume ---
LV Name /dev/VolGroup_ID_17452/LogVolHome
VG Name VolGroup_ID_17452
LV UUID yJIGtt-4tlk-4ntK-aWIm-mhKL-cvL8-M2QumE
LV Write Access read/write
LV Status available
# open 1
LV Size 124.84 GB
Current LE 3995
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:5



--- Physical volumes ---
PV Name /dev/sda5
PV UUID 1v0ScE-7ZOe-o3Ef-PxJL-8hA0-LzA0-RHdsmU
PV Status allocatable
Total PE / Free PE 10898 / 1777

PV Name /dev/sda2
PV UUID a2gnZa-TFV0-sQIA-Ukvt-d3ra-TIWE-jPTCzs
PV Status allocatable
Total PE / Free PE 3995 / 3995

Last edited by RMLinux; 11-21-2008 at 08:47 PM.
 
Old 11-21-2008, 08:15 PM   #10
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
So you only have 180-181G free? Try extending by less - but first, you currently have 1/2G and you are planning to increase this to around 200G. That's a 400x increase. Are you sure you want it that large?
 
Old 11-21-2008, 08:44 PM   #11
n03x3c
Member
 
Registered: Aug 2008
Location: India
Distribution: Fedora, RedHat
Posts: 101

Rep: Reputation: 17
Quote:
Originally Posted by RMLinux View Post
I tried lvextend here's the error message.


[root@localhost /]# lvextend -L+200G /dev/VolGroup_ID_17452/LogVol4

Extending logical volume LogVol4 to 200.50 GB
Insufficient free space: 6400 extents needed, but only 5772 available


what am I going to do next?

quote from no3x3c


kindly fill this up according to my need. thanks
Assume you add new partition or you already have one sda5 that you need your extended data store into.

Code:
pvcreate /dev/sda5

vgextend VolGroup_ID_17452 /dev/sda5
 
Old 11-23-2008, 01:11 AM   #12
williebens
Member
 
Registered: Jan 2008
Posts: 88

Rep: Reputation: 16
Cancelled post.

Last edited by williebens; 07-24-2010 at 03:11 AM.
 
Old 11-24-2008, 12:15 PM   #13
salter
Member
 
Registered: Oct 2008
Posts: 100

Rep: Reputation: 15
Your /usr partition appears to be quite large (154 GB).
I would copy the entire /var directory (using cp -dpR to keep all permissions intact) to /usr (so it will be at /usr/var), renaming the current /var to /var.bak (or anything), and then create a softlink in /var pointing to /usr/var
Your old /var location (~ 500 MB) can then be used for any other purpose.

Last edited by Tinkster; 10-30-2010 at 05:14 PM.
 
Old 11-26-2008, 02:16 AM   #14
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by billymayday View Post
So you only have 180-181G free? Try extending by less - but first, you currently have 1/2G and you are planning to increase this to around 200G. That's a 400x increase. Are you sure you want it that large?
I created a website and I host it on my own. I put my website in /var/www and oracle to another user, third party to another user.

I run LAMPS ... now I am out of space in /var coz of a lots of very big log files... including mysql database data residing in /var/lib/mysql/data....is in /var directory ...so all are using /var.

anything you can suggest to me friend what am I going to do?
 
Old 11-26-2008, 02:20 AM   #15
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by n03x3c View Post
Assume you add new partition or you already have one sda5 that you need your extended data store into.

Code:
pvcreate /dev/sda5

vgextend VolGroup_ID_17452 /dev/sda5
What is the effect of pvcreate and vgextend? can i increase my /var directory after this?

friend can you give me a complete list of command plz.

1. instruction 1
2. instruction 2
3. instruction 3.......until finished.

kindly give me the details of the command because it is very dangerous to edit this HDD PARTITION it may coz a lost of data to me. Hope you understand.

try to be complete pls.
 
  


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
how to increase /var space arshzia Linux - Software 1 05-18-2008 05:31 AM
Missing 200megs of space in /var - where is it?? epoh Linux - Server 5 03-29-2008 03:44 PM
There is not enough space in folder var jorge_ivan Linux - General 3 07-21-2006 09:43 PM
no space left on /var BUT THERE IS!! branden_burger Linux - Software 5 05-31-2005 01:44 AM
Not enough space in /var/lib/mysql/ mtmacedo Linux - Software 1 10-22-2004 03:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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