LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   not able to extend a fs using lvm (https://www.linuxquestions.org/questions/linux-general-1/not-able-to-extend-a-fs-using-lvm-876321/)

unix1adm 04-21-2011 07:02 AM

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.

AlucardZero 04-21-2011 07:13 AM

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.

unix1adm 04-21-2011 07:43 AM

Quote:

Originally Posted by AlucardZero (Post 4331521)
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.

syg00 04-21-2011 07:59 AM

Quote:

Originally Posted by AlucardZero (Post 4331521)
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.

unix1adm 04-21-2011 08:08 AM

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.

unix1adm 04-21-2011 08:14 AM

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.

unix1adm 04-21-2011 08:30 AM

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.

syg00 04-21-2011 08:34 AM

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.

unix1adm 04-21-2011 08:48 AM

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.

unix1adm 04-21-2011 09:01 AM

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


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