Results 1 to 7 of 7
Hi,
I want to know the procedure to extend the root file system in Linux .
How to extend the root file system?
Can we use lvextend command directly online ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-22-2012 #1Linux Newbie
- Join Date
- May 2012
- Posts
- 110
Increase root filesytem using "lvextend " ?
Hi,
I want to know the procedure to extend the root file system in Linux .
How to extend the root file system?
Can we use lvextend command directly online to increase the root file system?
Will their be any effect on the server, if we increase the file system online using lvextend command?
What does resize2fs command do?
Please help me with the info.
Regards,
Aparna.
- 10-22-2012 #2Linux Enthusiast
- Join Date
- Apr 2012
- Location
- Virginia, USA
- Posts
- 573
It's not generally a good idea to play with the root fs while the system online, but according to this article it can be done: Resize a root filesystem on the fly - Robert's Blog
If you're using logical volumes / lvm, then you can try. If you're not using logical volumes, lvextend won't help you.
lvextend is used to extend the size of your logical volume. In order to do this, the volume group must have free space.
resize2fs resizes your ext3/ext4 (or whatever) file system to the size of the disk/partition/logical volume that it resides on.
- 10-23-2012 #3Linux Newbie
- Join Date
- May 2012
- Posts
- 110
is it possible to make the file system as it was before after using lvextend command ?
we use lvextend command to increase the filesystem,similarly is it possible to decrease the file system as it was earlier ?
- 10-23-2012 #4Linux Enthusiast
- Join Date
- Apr 2012
- Location
- Virginia, USA
- Posts
- 573
You would want lvreduce, not lvextend for that operation. It will take longer, because the system will have to move everything that's outside the smaller lvm's disk footprint inside of that footprint.
So, if you have a 10gb file system, there may be some data written in the first 20% of the blocks, some in the next 50% of blocks, and some data written at the very last blocks of the file system. It has to move all that data into just those blocks. If your grow a file system with lvextend, you're adding blocks only, so data doesn't have to be moved.
I'm not too sure how much of a concern this is, but I know shrinking a live logical volume is to be avoided.
- 10-23-2012 #5Linux Newbie
- Join Date
- May 2012
- Posts
- 110
is it possible to make the file system as it was before after using lvextend command ?
we use lvextend command to increase the filesystem,similarly is it possible to decrease the file system as it was earlier ?
For examply,if my root filesystem was 10 GB earlier.
After increasing it using lvextend, it is increased to 15 GB. that means 5GB added.But now, i want to make it back to 10 GB only. Is this possible ?
- 10-23-2012 #6Linux Newbie
- Join Date
- Apr 2012
- Posts
- 112
- 10-24-2012 #7Just Joined!
- Join Date
- Sep 2012
- Location
- India
- Posts
- 29
Increase /root file system using lvm
----------------------------------------------------------------------------------------
EXTEND ROOT PARTITION - LVEXTEND
Is root partition an LVM partition?? If Yes follow the below step
Step1:
Get detailed description about LVM
Identify volume group on which root partition is located
Volgroup
Free Space
PE Size
You can find this information using following commands
vgdisplay
vgs -v
Step2: Resize your root partition
Once you have these details you can extend your partition if space is available.
Lvextend -L|-l size root-partition
* Note there is difference between -L exact size; -l is PE size
Step3:
resize2fs -p partition
----------------------------------------------------------------------------------------
REDUCE PARTITION USING LVREDUCE
* IMPORTANT
CHANCES OF DATA LOSS ARE HIGH WHEN YOU LVREDUCE ON ONLINE FILESYSTEM.
STEP1:
resize2fs /partition size
lvreduce -L|-l size partition
* be cautious while performing lvreduce ; it can lead to loss of data
Best Regards
Nikhil Shinde


Reply With Quote

