LinuxQuestions.org
Help answer threads with 0 replies.
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-19-2014, 08:31 AM   #1
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Rep: Reputation: Disabled
LVM resizing


Hi,

Is it necessary to run mkfs.ext4 after unmounting partition and after increasing the size of logical volume. If we will do it then all the data will be lost. What can be done in this case.

Actually i want to increase the size of /home partition which is a logical volume and that logical volumen already has some free space.
 
Old 03-19-2014, 10:18 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,319

Rep: Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470
Quote:
Originally Posted by sachin.davra View Post
Hi,
Is it necessary to run mkfs.ext4 after unmounting partition and after increasing the size of logical volume. If we will do it then all the data will be lost. What can be done in this case.

Actually i want to increase the size of /home partition which is a logical volume and that logical volumen already has some free space.
You don't provide any details, but have you tried to look this up?? There are MANY tutorials you can find for managing logical volumes, like this one:
http://www.tldp.org/HOWTO/LVM-HOWTO/extendlv.html

You don't say what version/distro of Linux, or give us any details about your current configuration, but extending logical volumes is easily done, and shouldn't require formatting. And even if it does...you DO have backups, don't you??
 
Old 03-19-2014, 10:39 AM   #3
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
If the logical volume contains a filesystem then you will probably now want to extend it to fill the newly available space.

use lvresize :

lvresize --size 120G /dev/vg0/foo
 
Old 03-20-2014, 03:03 AM   #4
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
i have one logical volume and it is mounted as /home and i want to increase the size of that volume. i want to know is it necessary to unmount /home first then increase the size of logical volume then mounte /home back.

I am using centos6.5
 
Old 03-20-2014, 06:29 AM   #5
krishnakishorerhce
LQ Newbie
 
Registered: Jun 2013
Posts: 16

Rep: Reputation: Disabled
lvextend -L +<size>M or +<size>G /dev/vgname/lvname
resize2fs /dev/vgname/lvname

These commands will work if you have enough space to resize in your VG.
 
Old 03-20-2014, 09:32 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,319

Rep: Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470Reputation: 4470
Quote:
Originally Posted by sachin.davra View Post
i have one logical volume and it is mounted as /home and i want to increase the size of that volume. i want to know is it necessary to unmount /home first then increase the size of logical volume then mounte /home back.

I am using centos6.5
And we will again point you to the documentation, that was looked up and given to you, along with command names. Did you not read/understand what you were given??? The lvextend and lvresize commands are well documented.
 
Old 03-20-2014, 09:40 AM   #7
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
And we will again point you to the documentation, that was looked up and given to you, along with command names. Did you not read/understand what you were given??? The lvextend and lvresize commands are well documented.
I got those points but i actually did this using lvextend command which was not allowing me to increase the size of that LVM, after unmounting that particular LVM only i could increase the size of that lvm then i got message regarding to make a filesystem. then i had to run mkfs.ext4 command. Though it did not have any data otherwise i would have lost every thing.
 
Old 03-20-2014, 11:40 AM   #8
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,210

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
Some file system types can be resized while they are mounted, other filesystem types must be unmounted first. After resizeing the LV, you don't want to do a "mkfs". But you may need to do things like "fsck" and "resize2fs" (again, the specifics depend on filesystem type).
 
Old 03-21-2014, 02:15 AM   #9
sachin.davra
Member
 
Registered: Jul 2013
Posts: 213

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by haertig View Post
Some file system types can be resized while they are mounted, other filesystem types must be unmounted first. After resizeing the LV, you don't want to do a "mkfs". But you may need to do things like "fsck" and "resize2fs" (again, the specifics depend on filesystem type).
Thanks, it is better clear now.

P.S. Thanks for ignoring typo error in LVM. it should be LV.
 
  


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
Resizing LVM prasanta.82 Linux - Server 1 06-16-2011 12:56 AM
resizing PV does not work (lvm) after resizing partition deadeyes Red Hat 5 03-11-2011 12:19 PM
LVM and Resizing with VMWare jeg1972 Linux - Enterprise 11 01-01-2010 10:11 PM
Resizing the LVM g_kapoor85 Linux - Software 3 03-21-2009 02:27 AM
Resizing / with LVM zivota Red Hat 2 07-12-2006 04:30 PM

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

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