LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This 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
 
Thread Tools
Old 11-19-2008, 11:44 PM   #1
RMLinux
Member
 
Registered: Jul 2006
Posts: 209
Thanked: 1
I am out of /var space?


[Log in to get rid of this advertisement]
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]#
RMLinux is offline     Reply With Quote
Old 11-19-2008, 11:51 PM   #2
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Thanked: 126
You could add another partition into that logvol as one solution. Perhaps shrink the home logvol a bit and use that.
billymayday is offline     Reply With Quote
Old 11-19-2008, 11:57 PM   #3
n03x3c
Member
 
Registered: Aug 2008
Location: India
Distribution: Slackware 13.0
Posts: 85
Thanked: 4
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.
n03x3c is offline     Reply With Quote
Old 11-20-2008, 12:11 AM   #4
RMLinux
Member
 
Registered: Jul 2006
Posts: 209
Thanked: 1

Original Poster
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-20-2008 at 12:34 AM..
RMLinux is offline     Reply With Quote
Old 11-20-2008, 12:45 AM   #5
n03x3c
Member
 
Registered: Aug 2008
Location: India
Distribution: Slackware 13.0
Posts: 85
Thanked: 4
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.
n03x3c is offline     Reply With Quote
Old 11-20-2008, 10:02 AM   #6
dickgregory
Member
 
Registered: Oct 2002
Location: Houston
Distribution: Arch
Posts: 229
Thanked: 7
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.
dickgregory is offline     Reply With Quote
Old 11-20-2008, 04:07 PM   #7
williebens
Member
 
Registered: Jan 2008
Posts: 47
Thanked: 0
I canceled this post.
I will post it again.
Thanks.
--Willie

Last edited by williebens; 11-20-2008 at 04:43 PM..
williebens is offline     Reply With Quote
Old 11-21-2008, 04:19 AM   #8
RMLinux
Member
 
Registered: Jul 2006
Posts: 209
Thanked: 1

Original Poster
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 09:59 PM..
RMLinux is offline     Reply With Quote
Old 11-21-2008, 09:07 PM   #9
RMLinux
Member
 
Registered: Jul 2006
Posts: 209
Thanked: 1

Original Poster
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 09:47 PM..
RMLinux is offline     Reply With Quote
Old 11-21-2008, 09:15 PM   #10
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Thanked: 126
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?
billymayday is offline     Reply With Quote
Old 11-21-2008, 09:44 PM   #11
n03x3c
Member
 
Registered: Aug 2008
Location: India
Distribution: Slackware 13.0
Posts: 85
Thanked: 4
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
n03x3c is offline     Reply With Quote
Old 11-23-2008, 02:11 AM   #12
williebens
Member
 
Registered: Jan 2008
Posts: 47
Thanked: 0
Hello Guys:

Most likely I will be repeating some of the steps you guys already mentioned. Please, pardon me for that, but I really need to. The following is the process I just did to add a second hard drive on my Centos 5 box.

Steps to add space to the /var directory via LVM.

CAUTION: Creating partitions is irrevocably destructive to the data already
on the disk. Therefore, before removing, changing, and/or creating partitions
on a disk, you must know what you are doing and its possible results.
ADVICE: Backup all your important data before taking the steps below. Thanks.

I am using Centos 5.0 with a 2.6.188.el5 kernel.

1) Begin by running fdisk l to list the current partition table.
Quote:
[root@localhost ~]# fdisk l
Disk /dev/hda: 40.0 GB, 40060403712 bytes
255 heads, 63 sectors/track, 4870 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 4870 39013852+ 8e Linux LVM

Disk /dev/hdb: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
[root@localhost ~]#
Disk /dev/hda is already partitioned, and it is where the Linux operating system is
currently installed. Disk /dev/hdb is the new disk we want to add. We will create a partition out of this disk to add it to the /var directory. You can create one partition or more than one. It is up to you. We will be creating only one partition in this case.
Disk /dev/hdb does not have a partition table. Creating it is the next step.

Quote:
[root@localhost ~]# fdisk /dev/hdb
The number of cylinders for this disk is set to 77545.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4):
1
First cylinder (177545,
default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (177545,default 77545):
Using default value 77545
Type p to verify that the partition table has been created.

Command (m for help): p
Disk /dev/hdb: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 77545 39082648+ 83 Linux

Change to partition Id from 83 to 8e to create a partition of type
"Linux LVM":

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Verify the changes by typing p:
Command (m for help): p
Disk /dev/hdb: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 77545 39082648+ 8e Linux LVM

Once you are satisfy with the changes, write the changes to the disk's partition table by typing the letter w:
Command (m for help): w
The partition table has been altered!
Calling ioctl() to reread
partition table.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
[root@localhost ~]#
2)Typing fdisk again, we now see that /dev/hdb has a partition table:
Quote:
[root@localhost ~]# fdisk -l
Disk /dev/hda: 40.0 GB, 40060403712 bytes
255 heads, 63 sectors/track, 4870 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 4870 39013852+ 8e Linux LVM

Disk /dev/hdb: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 77545 39082648+ 8e Linux LVM
3)Now reboot the system to allow the Linux kernel to properly recognize the new partition table. Type:
Quote:
[root@localhost ~]# reboot
4)Next, create the physical volume. Remember you have to be root.
Note: Using the whole disk (/dev/hdb) as a physical volume, instead of a partition spanning the whole disk (/dev/hdb1) is not recommended. This is because any other operating system that looks at the disk will not recognize the LVM metadata and display the disk as being free. Therefore, it is possibly it will be overwritten. However, LVM itself will work fine with whole disk physical volumes.

Quote:
[root@localhost ~]# pvcreate /dev/hdb1
Physical volume "/dev/hdb1" successfully created
[root@localhost ~]#
5) Use the pvdisplay command to verify step 4.
Quote:
[root@localhost ~]# pvdisplay
Physical
volume PV
Name /dev/hda2
VG Name VolGroup00
PV Size 37.21 GB / not usable 19.46 MB
Allocatable yes
PE Size (KByte) 32768
Total PE 1190
Free PE 59
Allocated PE 1131
PV UUID 8iXatK0ULJBdMJeFuxzhfA38AZDB8mBO
NEW
Physical volume PV
Name /dev/hdb1
VG Name
PV Size 37.27 GB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID YP01nVuh4jvlpDM5fPNOjOQQ8iSVEzCx
[root@localhost ~]#
A new physical volume has been created. Now, we will assign the /dev/hdb1 physical volume to a volume group. The space of the new physical volume is 37.27GB as indicated by:
PV Size 37.27 GB Since VG Name is empty, this PV has not been assigned to any VG.

6) Use the vgdisplay command to view the current volume groups that possibly exist on your system:
Quote:
[root@localhost ~]# vgdisplay
Volume
group VG
Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size 37.19 GB
PE Size 32.00 MB
Total PE 1190
Alloc PE / Size 1131 / 35.34 GB
Free PE / Size 59 / 1.84 GB
VG UUID Zd19ReqYxC9wX3bDfUUtdLWEVC3LEWay
[root@localhost ~]#
From the output, we see that:
The volume group (VG) name is VolGroup00.
The current size of the VG is 37.19 GB (This size should increase after adding the new hard drive).
The physical extend (PE) size is 32.00 MB, with a total of 1190 PEs.
There are only 59 physical extents that are free in the VG. They are equivalent to 1.84 GB of free space.
The previous information is just for the original hard drive where the operating system is. The goal now
is to add the new hard drive so we have more Free PE / Size in order to add space to the /var directory.
We just do not want to add the 1.84GB that this VG has available. We want to add at least 20GB.

7) Assign the PV to the VG using the vgextend command:
Quote:
[root@localhost ~]# vgextend VolGroup00 /dev/hdb1
Volume group "VolGroup00" successfully extended
[root@localhost ~]#

Verifying previous step:
[root@localhost ~]# vgdisplay
Volume
group VG
Name VolGroup00
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 2
Act PV 2
VG Size 74.44 GB
PE Size 32.00 MB
Total PE 2382
Alloc PE / Size 1131 / 35.34 GB
Free PE / Size 1251 / 39.09 GB
VG UUID Zd19ReqYxC9wX3bDfUUtdLWEVC3LEWay
[root@localhost ~]#
After adding the PV to the VG, VG Size is now 74.44GB and Free PE / Size is 1251/39.09 and Total PE is 2382. All these values have increased.

8) Now that we have more space in the VG, we extend the /var directory's logical volume (LG) with the command lvextend. First, I run the lvdisplay command to view the current LVs:
Quote:
[root@localhost ~]# lvdisplay
Logical volume
LV Name /dev/VolGroup00/LogVolfs
VG Name VolGroup00
LV UUID nQ2tzGfYh2NLRwpZOAX2SfqfE7SqfL3f
LV Write Access read/write
LV Status available
# open 1
LV Size 19.53 GB
Current LE 625
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:0

Logical volume
LV Name /dev/VolGroup00/LogVolvar
VG Name VolGroup00
LV UUID xHDAE4118M6stjh2gpuHhd0gF9j9oB2v
LV Write Access read/write
LV Status available
# open 1
LV Size 14.62 GB
Current LE 468
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1

Logicalvolume
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID Oz8CvMZaomjdctTRlVbeTRn3p30OD8Et
LV Write Access read/write
LV Status available
# open 1
LV Size 1.19 GB
Current LE 38
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:2
[root@localhost ~]#
9)I now extend the LV of the /var directory by 20GB. I can extend it by 39.09GB more, but I will leave some room left just in case another directory runs out of room as well.
Quote:
[root@localhost ~]# lvextend L+20G /dev/VolGroup00/LogVolvar
Extending logical volume LogVolvar to 34.62 GB
Logical volume LogVolvar successfully resized
[root@localhost ~]#
10) Verify that the /var directory has increased by 20GB:
Quote:
[root@localhost ~]# lvdisplay
Logical volume
LV Name /dev/VolGroup00/LogVolfs
VG Name VolGroup00
LV UUID nQ2tzGfYh2NLRwpZOAX2SfqfE7SqfL3f
LV Write Access read/write
LV Status available
# open 1
LV Size 19.53 GB
Current LE 625
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:0

Logical volume
LV Name /dev/VolGroup00/LogVolvar
VG Name VolGroup00
LV UUID xHDAE4118M6stjh2gpuHhd0gF9j9oB2v
LV Write Access read/write
LV Status available
# open 1
LV Size 34.62 GB
Current LE 1108
Segments 3
Allocation inherit
Read ahead sectors 0
Block device 253:1

Logical volume
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID Oz8CvMZaomjdctTRlVbeTRn3p30OD8Et
LV Write Access read/write
LV Status available
# open 1
LV Size 1.19 GB
Current LE 38
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:2
[root@localhost ~]#
11)Run df -h to check:
Quote:
[root@localhost var]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00LogVolfs
19G 2.5G 16G 14% /
/dev/hda1 99M 11M 84M 12% /boot
tmpfs 300M 0 300M 0% /dev/shm
/dev/mapper/VolGroup00LogVolvar
15G 219M 14G 2% /var
/dev/sda1 964M 136M 828M 15% /media/usb
[root@localhost var]#
Note that /var is still 14G.

Now unmount the logical volume regarding the /var directory:
Quote:
[root@localhost ~]# umount /dev/mapper/VolGroup00LogVolvar
umount: /var: device is busy
umount: /var: device is busy
Before extending the LV, it would be safer, you do not really have to do this with an ext3 and lvm2, to unmount the /var directory and its LV. However, unmounting the /var directory is more difficult than having a work around it. This is the one I have.

12) Run:
Quote:
[root@localhost var]# resize2fs /dev/mapper/VolGroup00LogVolvar

resize2fs 1.39 (29May2006)
Filesystem at /dev/mapper/VolGroup00LogVolvar is mounted on /var; online resizing required
Performing an online resize of /dev/mapper/VolGroup00LogVolvar to 9076736 (4k) blocks.
The filesystem on /dev/mapper/VolGroup00LogVolvar is now 9076736 blocks long.
[root@localhost var]#
Rung df -h again:
Quote:
[root@localhost var]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00LogVolfs 19G 2.5G 16G 14% /
/dev/hda1 99M 11M 84M 12% /boot
tmpfs 300M 0 300M 0% /dev/shm
/dev/mapper/VolGroup00LogVolvar 34G 226M 32G 1% /var
[root@localhost var]#
I hope this helps.
Thanks.
--Willie

Last edited by williebens; 11-23-2008 at 02:37 AM..
williebens is offline     Reply With Quote
Old 11-24-2008, 01:15 PM   #13
salter
Member
 
Registered: Oct 2008
Posts: 100
Thanked: 0
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.

Linux Archive

Last edited by salter; 12-20-2008 at 12:54 PM..
salter is offline     Reply With Quote
Old 11-26-2008, 03:16 AM   #14
RMLinux
Member
 
Registered: Jul 2006
Posts: 209
Thanked: 1

Original Poster
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?
RMLinux is offline     Reply With Quote
Old 11-26-2008, 03:20 AM   #15
RMLinux
Member
 
Registered: Jul 2006
Posts: 209
Thanked: 1

Original Poster
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.
RMLinux is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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


All times are GMT -5. The time now is 02:52 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration