LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-25-2011, 09:22 AM   #1
musiqdefunk
LQ Newbie
 
Registered: Mar 2011
Posts: 22

Rep: Reputation: 0
Extend a partition


Hello

I am a jr linux administrator, that manages a linux enviroment that was built before I got here so most of the management procedures are already established, I just follow them. The problem is now, I was given the task to establish a working linux enviroment for our developers.

So I'm running red hat linux kernel 2.6.18 and LVM2. They have asked me to extend the home directory from 2GB to 10GB.

I used the following command
LVEXTEND -L8G /dev/rootvg/home, with success

My LVdisplay now shows 10G for /dev/rootvg/home but when I do a df -h it still shows /home as 2G.

Is something else I should of done, thanks.
 
Old 03-25-2011, 09:38 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,373

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
yes, lvm is not a file system, you have a filesystem inside it, presumably ext3. unmount the filesystem and run "resize2fs /dev/rootvg/home" and it should expand the filesystem to fill the LV. See the resize2fs manpage for further details.
 
Old 03-25-2011, 10:45 AM   #3
musiqdefunk
LQ Newbie
 
Registered: Mar 2011
Posts: 22

Original Poster
Rep: Reputation: 0
I umount /home which is an ext3 and ran the resize2fs;I get the following error:

device or resource is busy while trying to open /dev/rootvg/home couldn't find valid filesystem superblock.
 
Old 03-25-2011, 11:07 AM   #4
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7
Posts: 865

Rep: Reputation: 110Reputation: 110
I think you have to unmount the whole lvm

maybe this might help out
http://www.practicalweb.co.uk/blog/1...filesystem-lvm

Last edited by jmc1987; 03-25-2011 at 11:12 AM.
 
Old 03-25-2011, 11:13 AM   #5
sicinthemind
LQ Newbie
 
Registered: Nov 2010
Location: Zephyrhills, FL
Distribution: Fed - 9/13/14, RHEL 5.3/4 & 6, Server 2008 R2 - Win7.
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by musiqdefunk View Post
I umount /home which is an ext3 and ran the resize2fs;I get the following error:

device or resource is busy while trying to open /dev/rootvg/home couldn't find valid filesystem superblock.
Revising...

Have you already run the partprobe command?
Code:
AS ROOT
[root@server ~]# partprobe
AS SUDO USER
[user@server ~]$ sudo /sbin/partprobe

Last edited by sicinthemind; 03-25-2011 at 11:19 AM.
 
Old 03-25-2011, 12:23 PM   #6
musiqdefunk
LQ Newbie
 
Registered: Mar 2011
Posts: 22

Original Poster
Rep: Reputation: 0
I ran the partprobe, but I don't see what that really did for me, and unmount the whole lvm. I think would defeat the purpose of lvextend.
 
Old 03-25-2011, 12:48 PM   #7
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
You can resize2fs a mounted file system as long as it is increasing in size. (If you are shrinking it it has to be unmounted.)

Do a 'mount -a' to remount it,

then 'resize2fs /dev/mapper/rootvg-home' again.

It should work.

Here I do a 'resize2fs' against a mounted file system. Nothing to do as it was already the size of the Logical Volume, but just as an example.
Code:
[root@athlonz ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vgz00-lvz01
                       23G   20G  1.8G  92% /
/dev/mapper/vgz01-lvz00
                      493G  163G  306G  35% /bkup
/dev/sda1              99M   14M   80M  15% /boot
/dev/sdb1              99M   43M   51M  46% /boot2
tmpfs                 2.0G   80K  2.0G   1% /dev/shm
/dev/mapper/vgz01-tommy
                       20G   11G  7.9G  59% /home/tommy
[root@athlonz ~]# resize2fs /dev/mapper/vgz01-tommy
resize2fs 1.41.4 (27-Jan-2009)
The filesystem is already 5242880 blocks long.  Nothing to do!

[root@athlonz ~]# resize2fs /dev/vgz01/tommy
resize2fs 1.41.4 (27-Jan-2009)
The filesystem is already 5242880 blocks long.  Nothing to do!

[root@athlonz ~]#
ps. when you did the umount, did it succeed. If anyone is in that directory or has a file open there umount will fail.

Last edited by tommylovell; 03-25-2011 at 12:52 PM.
 
Old 03-25-2011, 02:12 PM   #8
musiqdefunk
LQ Newbie
 
Registered: Mar 2011
Posts: 22

Original Poster
Rep: Reputation: 0
Keeping it mounted worked, thanks guys, you made me look like a genius.
 
  


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 extend partition of a device stmas Linux - Virtualization and Cloud 14 09-27-2010 12:04 PM
to extend installed partition varunvv Linux - Newbie 3 08-06-2009 09:36 AM
how to extend linux partition? hariharan.83 Linux - Newbie 3 05-05-2009 11:58 AM
Extend/Grow a partition dsrm Linux - Newbie 5 10-18-2007 11:26 PM
how to extend partition? Sushy *BSD 2 01-25-2007 12:29 PM


All times are GMT -5. The time now is 09:38 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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration