LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-17-2012, 09:31 AM   #31
whizzit
Member
 
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65

Rep: Reputation: 24

Actually, I just had a thought that LogVol01 could be the swap volume for your CentOS system. It's possible that the LiveCD you are using has automatically started using it as swap and could explain why it wasn't able to be removed. This might be shown by:

Code:
blkid -t TYPE=swap         # show volumes/partitions of type swap
cat /proc/swaps            # show swap volumes/partitions in use
For now, I'd say forget about LogVol01 and simply carry on with extending the main volume LogVol00 as Kustom42 previously described. Unless you have already extended LogVol01 (lvs will show LVM volume sizes).

Last edited by whizzit; 07-17-2012 at 09:42 AM. Reason: Fix grammar
 
1 members found this post helpful.
Old 07-17-2012, 10:28 AM   #32
jbennett
Member
 
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by whizzit View Post
Code:
blkid -t TYPE=swap         # show volumes/partitions of type swap
Code:
/dev/mapper/VolGroup00-LogVol01: UUID="............" TYPE="swap"
Quote:
Code:
cat /proc/swaps            # show swap volumes/partitions in use
Code:
Filename  Type      Size    Used Priority
/dev/dm-1 partition 262136  0    -1
Quote:
For now, I'd say forget about LogVol01 and simply carry on with extending the main volume LogVol00 as Kustom42 previously described. Unless you have already extended LogVol01 (lvs will show LVM volume sizes).
If I do a 'lvdisplay', I see where LogVol01 has a LV size of 100.24 GB while LogVol00 has a LV size of 9.65 GB. Is this showing that the LogVol01 has already been extended?


If all looks ok, at this point, I need to stay in recovery and do the following:

Code:
lvextend -L +100G /dev/VolGroup00/LogVol00
resize2fs /dev/VolGroup00/LogVol00
?
 
Old 07-17-2012, 10:59 AM   #33
whizzit
Member
 
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65

Rep: Reputation: 24
Quote:
Originally Posted by jbennett View Post
If I do a 'lvdisplay', I see where LogVol01 has a LV size of 100.24 GB while LogVol00 has a LV size of 9.65 GB. Is this showing that the LogVol01 has already been extended?
So this will need to be undone first with lvreduce to reclaim the space. To be thorough I propose the following commands, checking progress as you go ( at a pinch just the lvreduce would suffice for now ):

Code:
/sbin/swapoff    /dev/VolGroup00/LogVol01       # stop using this volume as swap.
lvreduce -L 256M /dev/VolGroup00/LogVol01       # reduce LogVol01 to 256M
/sbin/mkswap     /dev/VolGroup00/LogVol01       # initialise the swap space, to be on the safe side
/sbin/swapon     /dev/VolGroup00/LogVol01       # start using LogVol01 as swap again (not strictly necessary in this environment but good practice)
( Note: that it is not '-L -100G' because the original lvextend must have been executed as '-L 100G'. Subtle, but important if using other commands like lvresize, for example )

You can check progress with vgs (or vgdisplay) to ensure that the volume group has enough free storage.

Quote:
Originally Posted by jbennett View Post
If all looks ok, at this point, I need to stay in recovery and do the following:

Code:
lvextend -L +100G /dev/VolGroup00/LogVol00
resize2fs /dev/VolGroup00/LogVol00
?
That looks correct.
 
Old 07-17-2012, 11:12 AM   #34
jbennett
Member
 
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
Code:
/sbin/swapoff    /dev/VolGroup00/LogVol01       # stop using this volume as swap.
bash: /sbin/swapoff: No such file or directory
lvreduce -L 256M /dev/VolGroup00/LogVol01       # reduce LogVol01 to 256M
WARNING: Reducing active and open logical volume to 256.00 MiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
I'm assuming I want to hit yes, but the fact that it couldn't find swapoff makes me want to verify before I go through with this.
 
Old 07-17-2012, 11:20 AM   #35
whizzit
Member
 
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65

Rep: Reputation: 24
Can you try just swapoff on it's own (in case the path is different in your evironment) ?

The warning is great (!) since the command is a sure way to kill a system if typos are ever made in the volume name . In this case we will be ok since we know there isn't anything important on LogVol01 ( /proc/swaps show Used = 0 ) but I would prefer swapoff to work first.

Last edited by whizzit; 07-17-2012 at 11:27 AM. Reason: Speaking of typos - fixing my own
 
1 members found this post helpful.
Old 07-17-2012, 11:24 AM   #36
jbennett
Member
 
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
that seems to have worked (no errors).

I have successfully extended the LV to 109.65 GB and am now able to see that /VolGroup00-LogVol00 has a size of 108G with only 9.6G used!

Now I get to see if I can restore a Nagios install to this VM.

THANK YOU!!! This forum has been invaluable!!
 
Old 07-17-2012, 12:36 PM   #37
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Glad to see you go there, thanks for your eyes whizzit I was hitting the wall on this one. didn't think about it being set up as swap by the rescue CD, I'll have to keep that in mind.
 
Old 07-17-2012, 12:43 PM   #38
jbennett
Member
 
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
Thanks for all of your help as well Kustom!
 
  


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
[SOLVED] How to expand disk in Linux JALITE Linux - Newbie 6 04-15-2014 05:19 PM
[SOLVED] Expand WinXP Disk Size tronayne Linux - Virtualization and Cloud 4 12-15-2011 08:38 AM
I created my VM machine with to little disk space HOW DO YOU EXPAND bigcape Linux - Virtualization and Cloud 1 03-16-2011 12:30 AM
How to expand disk space cghcgh Linux - Newbie 7 07-08-2008 10:09 AM
expand root partition to occupy whole disk JohnGalt007 Linux - Software 4 01-09-2007 07:03 PM

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

All times are GMT -5. The time now is 01:02 AM.

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