LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-21-2011, 07:02 AM   #1
unix1adm
Member
 
Registered: Oct 2008
Posts: 624

Rep: Reputation: 30
not able to extend a fs using lvm


I know I have done this command on out Red Hat systems. But for some reason in CentOS its giving me problems.

I am trying to add more space to / as its at 100% full. Not sure what filled up the 4G is assigned to it but I did load Virtualbox and a widowsxp system.

Here is what i have:


df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hdc3 4061572 4050416 0 100% /
/dev/mapper/rootvg-rvg_datalv
253934980 313572 240514208 1% /data
/dev/mapper/rootvg-rvg_tmplv
4062912 139500 3713700 4% /tmp
/dev/mapper/rootvg-rvg_optlv
4062912 139396 3713804 4% /opt
/dev/mapper/rootvg-rvg_varlv
4062912 379252 3473948 10% /var
/dev/mapper/rootvg-rvg_homelv
4062912 378176 3475024 10% /home
/dev/mapper/rootvg-rvg_usrlv
4062912 3256216 596984 85% /usr
/dev/mapper/rootvg-rvg_usrlocallv
2063164 68872 1887796 4% /usr/local
/dev/hdc1 505604 28835 450665 7% /boot
tmpfs 253392 0 253392 0% /dev/shm

[root@mysystem ~]# lvextend -L +5G /dev/hdc3
Path required for Logical Volume "hdc3"
Please provide a volume group name
Run `lvextend --help' for more information.

[root@mysystem ~]# vgdisplay
/dev/cdrom-hda: open failed: No medium found
--- Volume group ---
VG Name rootvg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 7
Open LV 7
Max PV 0
Cur PV 1
Act PV 1
VG Size 291.56 GB
PE Size 32.00 MB
Total PE 9330
Alloc PE / Size 8705 / 272.03 GB
Free PE / Size 625 / 19.53 GB
VG UUID M2yVzU-p1kp-N1Ys-PFuH-SZgv-MCxS-6Mk2fT


Notice I have 19G available to rootvg.

Am I missing something simple in centOS? (I know centOS is "similar" to RH)
I did this the other day on a RH system and it worked fine.

Why does it not find the /dev/hdc3 Keeps asking for the path and I do give the path that's what is confusing to me.

the only thing I can think of is that maybe hdc3 is not under lvm control when it was built? If so that will really suck.
If that is the case is there anything I can do to grow the / fs?

---------- Post added 04-21-11 at 08:02 AM ----------

I just did this on another system and I believe my assumption to be correct:


df /opt
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-rvg_opt
2031440 2031228 0 100% /opt
[root@jbx ~]# lvresize -L +256M /dev/mapper/VolGroup00-rvg_opt
/dev/cdrom: open failed: Read-only file system
Extending logical volume rvg_opt to 2.25 GB
Logical volume rvg_opt successfully resized
[root@jbxs~]# resize2fs /dev/mapper/VolGroup00-rvg_opt
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/mapper/VolGroup00-rvg_opt is mounted on /opt; on-line resizing required
Performing an on-line resize of /dev/mapper/VolGroup00-rvg_opt to 589824 (4k) blocks.
The filesystem on /dev/mapper/VolGroup00-rvg_opt is now 589824 blocks long.

[root@jbx ~]# df /opt
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-rvg_opt
2285376 2031252 136164 94% /opt


So my question is what can I do to get more space into rootvg /dev/hdc3 without rebuilding the box.

Last edited by unix1adm; 04-21-2011 at 07:05 AM.
 
Old 04-21-2011, 07:13 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,630

Rep: Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518
Looks like /dev/hdc3 isn't a logical volume. So you can't grow it, unless it's a 4GB SAN LUN and you can grow it on the SAN, then reboot the server, then resize2fs it. But I doubt that's the case.
 
Old 04-21-2011, 07:43 AM   #3
unix1adm
Member
 
Registered: Oct 2008
Posts: 624

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by AlucardZero View Post
Looks like /dev/hdc3 isn't a logical volume. So you can't grow it, unless it's a 4GB SAN LUN and you can grow it on the SAN, then reboot the server, then resize2fs it. But I doubt that's the case.

Correct local disk. So any options for me without a system rebuild?
I would have thought 4G would have been fine for / but guess not.
Can I backup the / and rebuild it as an lvm then reload the data from the backup?
Convert it to an lvm????
I really dont want to do that. Just wondering if its an option.

This is my home system and my gateway to my home network. Would suck if I have to rebuild it.

Last edited by unix1adm; 04-21-2011 at 07:44 AM.
 
Old 04-21-2011, 07:59 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,223

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
Quote:
Originally Posted by AlucardZero View Post
Looks like /dev/hdc3 isn't a logical volume. So you can't grow it
????.
Non-LVM and primary (i.e. not logical) physical partitions can certainly be "grown" depending on available disk space. Probably not likely given RH normal practices - let's see the output of "fdisk -l" as root.
"du" should tell you what's eating the space.
 
1 members found this post helpful.
Old 04-21-2011, 08:08 AM   #5
unix1adm
Member
 
Registered: Oct 2008
Posts: 624

Original Poster
Rep: Reputation: 30
fdisk -l

Disk /dev/hdc: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 65 522081 83 Linux
/dev/hdc2 66 38130 305757112+ 8e Linux LVM
/dev/hdc3 38131 38652 4192965 83 Linux
/dev/hdc4 38653 38913 2096482+ 5 Extended
/dev/hdc5 38653 38913 2096451 82 Linux swap / Solaris


I was looking at du too. That is more of a rhetorical statement. I would rather grown the fs if I can.
 
Old 04-21-2011, 08:14 AM   #6
unix1adm
Member
 
Registered: Oct 2008
Posts: 624

Original Poster
Rep: Reputation: 30
Any chance I can shrink my data partition and then create a new temporary one root_tmp and move everything from / to that then rename the new partition to /?

then i could remove the original "/"

I am guessing since its / thats risky to do.
 
Old 04-21-2011, 08:30 AM   #7
unix1adm
Member
 
Registered: Oct 2008
Posts: 624

Original Poster
Rep: Reputation: 30
So I think I found what filed up the / fs. When I installed virtual box it put the winxp system in /VirtualBox VMS/winxpsrv

When I built that is was a 20G disk I used.

Maybe I need a new posting/research to see if I can move this file out of the "/" partition and either link it or have VB look at a different location for the file.

That would solve my immediate problem.
 
Old 04-21-2011, 08:34 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,223

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
If 'twas me, I'd just delete the swap and the extended partition, and use that space to expand - KISS.
Run the swap in a lv.

Go grab a gparted liveCD and do the resizing from there. Fix up the swap (and fstab) from there or the CentOS install disk.
 
Old 04-21-2011, 08:48 AM   #9
unix1adm
Member
 
Registered: Oct 2008
Posts: 624

Original Poster
Rep: Reputation: 30
Ok I will have to look into that option. Never even considered removing swap.

For now I moved the VB system out of the root dir and linked it over to the /data/VirtualBox dir I created. Not sure if it will work or not as I am remote to the system without gui access.

Ill try it and see what happens when I am back at the console.
 
Old 04-21-2011, 09:01 AM   #10
unix1adm
Member
 
Registered: Oct 2008
Posts: 624

Original Poster
Rep: Reputation: 30
did a bunch of google searches but maybe I am not using the correct terms. Get everything back including the kitchen sink but what I want to know

edit: I just found this link so when i get back to the system Ill see if the options are there to change the location:

http://forums.virtualbox.org/viewtopic.php?f=7&t=32706

Last edited by unix1adm; 04-22-2011 at 05:57 AM.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extend LVM partition rconan Linux - Software 5 08-31-2010 02:32 AM
extend crypted lvm volume imitis Linux - General 4 06-12-2010 06:55 AM
Redhat LVM Extend Fails linuxaddict7 Linux - Software 3 03-15-2010 09:48 AM
LVM extend size bravored Linux - General 7 01-21-2009 01:13 PM
How to extend an existing partition without LVM james.reid Linux - Software 14 06-02-2006 12:48 AM


All times are GMT -5. The time now is 06:42 AM.

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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration