LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-11-2014, 03:58 AM   #1
blackRonin
Member
 
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68

Rep: Reputation: Disabled
extend lvm size to max available size


Hello

I want to extend size of my lv /var/ partition.
But first i had to resize (shrink) root lv partition.

While in live CD i did:
lvreduce -L 25G -r /dev/vg_centos/lv_root

Now i want extend lv_var with lvextend -L -r .
But i don't know how to extend to maximum available size.

Before mu lv_root partition was 31G and some megs, but i don't remember how much exactly.

I don't want left free unused space in pvs.

Please help
 
Old 07-11-2014, 04:44 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
That's what manpages are for.
 
Old 07-11-2014, 09:21 AM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by blackRonin View Post
While in live CD i did:
lvreduce -L 25G -r /dev/vg_centos/lv_root
It sounds like you might be new to LVM. Hopefully you resized (shrunk) the filesystem before running the lvreduce. Man pages would have mentioned that part too.

Google "tutorial LVM" or "howto LVM" and you should find lots of information and examples. It doesn't serve much use to try to repost all the steps, wisdom, and examples here when it's already readily available elsewhere on the net.
 
Old 07-11-2014, 11:20 AM   #4
blackRonin
Member
 
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68

Original Poster
Rep: Reputation: Disabled
option -r also resize filesystem.

Solved. I get max value from pvs command.
 
Old 07-11-2014, 12:52 PM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by blackRonin View Post
option -r also resize filesystem
Ahhh, I had forgotten about that option. I remember it now. I also remember in the past that I had chosen not to use it because I prefer to resize the filesystem manually, run a file system check manually to verify integrity, and only then reduce the LV. It is quite possible that the -r option will trigger an automatic file system check between the resize and reduce steps. I didn't know that at the time (and still don't know if it does or doesn't trigger fsck automatically), so I do the steps manually to make sure. That may be overkill on my part. But until you mentioned -r, I had forgotten about that option. Thanks for reminding me about it.
 
Old 07-11-2014, 03:56 PM   #6
blackRonin
Member
 
Registered: Jun 2014
Distribution: Debian 9.6
Posts: 68

Original Poster
Rep: Reputation: Disabled
Yes, it does uses fsck during the reduce/extend.
 
  


Reply



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
LXer: Extend LVM partition size when there is no free space in the Volume Group LXer Syndicated Linux News 0 06-23-2014 07:00 PM
how to extend the xen vm disk size using LVM anis123 Linux - Server 0 04-06-2012 11:35 AM
How to add new hard disk to extend the LVM size .............. Senthilv Linux - Server 1 10-09-2011 06:23 PM
LVM extend size bravored Linux - General 7 01-21-2009 01:13 PM
Max size limitations of LVM and software RAID petcherd Linux - Server 1 12-20-2007 01:41 AM

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

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

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