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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
07-17-2012, 09:31 AM
|
#31
|
Member
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65
Rep:
|
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.
|
07-17-2012, 10:28 AM
|
#32
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep:
|
Quote:
Originally Posted by whizzit
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
?
|
|
|
07-17-2012, 10:59 AM
|
#33
|
Member
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65
Rep:
|
Quote:
Originally Posted by jbennett
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
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.
|
|
|
07-17-2012, 11:12 AM
|
#34
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep:
|
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.
|
|
|
07-17-2012, 11:20 AM
|
#35
|
Member
Registered: Aug 2004
Location: UK
Distribution: Gentoo, OpenBSD, Debian, FreeBSD, RHEL, CentOS
Posts: 65
Rep:
|
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.
|
07-17-2012, 11:24 AM
|
#36
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep:
|
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!!
|
|
|
07-17-2012, 12:36 PM
|
#37
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
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.
|
|
|
07-17-2012, 12:43 PM
|
#38
|
Member
Registered: Apr 2012
Distribution: CentOS 6.2
Posts: 45
Original Poster
Rep:
|
Thanks for all of your help as well Kustom!
|
|
|
All times are GMT -5. The time now is 01:02 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|