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 01-18-2019, 01:08 PM   #1
volcblack
Member
 
Registered: Apr 2018
Posts: 36

Rep: Reputation: Disabled
lvextend


Hello Community,
OS: centos 5.5
I had a vg with 392 GB

After running lvextend -l +20G -r /dev/VolGroup00/lv_logs (did not work)
lvextend -l +5G -r /dev/VolGroup00/lv_logs (failed due to argument +5gb)
lvextend -l +4096 /dev/VolGroup00/lv_logs tried 4 GB
lvextend -l +4096 /dev/VolGroup00/lv_logs tried 4 GB more
lvextend -l +5120 /dev/VolGroup00/lv_logs something more cause I wanted to give 20GB

But I realize that I ran out of my space I took 370 GB. leaving just 72GB free in my VG

Space still not reflect in my LV (maybe if I run resize2fs but I don't want before try to recover), it is a possibility to recover the space back?
MY lv is 150 GB I wanted 170, but now lvdisplay shows 470.

Can I recover that back without unmounting my lv?
What should be the right command to expand with logical extends I think I used PE instead of MB or GB.

lvresize could help?
 
Old 01-18-2019, 01:44 PM   #2
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,536

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
I find that a % increase works OK for me:-

lvextend --extents +10%LV -r /dev/vg-name/lv-name # for a 10% increase

there is a similar lvreduce command for shrinking spaces in a similar way; the -r parameter is vital.

It might be worth reducing the size by a moderate trial percentage (after taking a backup first).
 
Old 01-18-2019, 08:30 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,277

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
Yes, the argument to the "-l" option is in units of "extents", which are typically 4MB, so "-l +5G" would be trying to add about 20 petabytes.

As long as you didn't make any other LVM changes after the commands you showed, the safest way to revert to the old configuration is to use vgcfgrestore. Look in /etc/lvm/archive/ for the files (they are ASCII) with the line
Code:
description = "Created *before* executing 'lvextend -l +4096 /dev/VolGroup00/lv_logs'"
There will be two such files, since you ran that same command twice. You want the earlier of those files. Then you can run
Code:
vgcfgrestore -v -f /etc/lvm/archive/VolGroup00_xxxxx-xxxxxxxxx.vg VolGroup00
You can include the "-t" (--test) option if you just want to see what it's going to do. Since none of your resize commands that actually worked included the "-r" (--resizefs) option, your filesystem should be right there unchanged.

Last edited by rknichols; 01-18-2019 at 08:31 PM.
 
1 members found this post helpful.
Old 01-18-2019, 08:44 PM   #4
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,536

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Quote:
Originally Posted by volcblack View Post
After running lvextend -l +20G -r /dev/VolGroup00/lv_logs (did not work)
lvextend -l +5G -r /dev/VolGroup00/lv_logs (failed due to argument +5gb)
The first two attempts did include the -r (resize filesystem) parameter.
 
Old 01-19-2019, 09:00 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,277

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
Quote:
Originally Posted by volcblack View Post
After running lvextend -l +20G -r /dev/VolGroup00/lv_logs (did not work)
lvextend -l +5G -r /dev/VolGroup00/lv_logs (failed due to argument +5gb)
Quote:
Originally Posted by JeremyBoden View Post
The first two attempts did include the -r (resize filesystem) parameter.
Those were failed attempts that did nothing.
 
Old 01-19-2019, 09:13 AM   #6
dc.901
Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS 6-7; SuSE 8-12
Posts: 599

Rep: Reputation: 173Reputation: 173
Quote:
Originally Posted by rknichols View Post
Those were failed attempts that did nothing.
Could you post output of:

Code:
pvdisplay
vgdisplay
lvdisplay
And, did you have anything in syslog when you ran lvextend command?
 
Old 01-19-2019, 10:04 AM   #7
volcblack
Member
 
Registered: Apr 2018
Posts: 36

Original Poster
Rep: Reputation: Disabled
Thanks all, what I did was to revert my changes back , with lvreduce I wasn't able to revert back, next time I will run --test flag
 
  


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
lvextend? sachinh Linux - General 3 09-22-2009 07:25 AM
Not enough PE when running lvextend!? Chikne Slackware 6 02-04-2007 10:24 AM
After lvextend wrong free space epiphiny Fedora 4 11-19-2006 03:09 PM
lvextend - where's my data? zdenisl Linux - Software 4 05-13-2006 08:36 AM
LVM and lvextend mirroring smkamene Linux - Software 0 02-26-2005 08:48 PM

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

All times are GMT -5. The time now is 06:27 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration