Fedora Linux Support Community & Resources Center
  #1  
Old 10th July 2012, 11:00 AM
sluge Offline
Registered User
 
Join Date: Jun 2009
Location: Russia,52
Posts: 93
windows_7ie
Question Resize LVM VG

Hello
I have two volume groups on my HDD: vg_root and vg_apps. So, I need to reduce size of vg_apps and give more free space to vg_root. Is any way to do it?
Reply With Quote
  #2  
Old 11th July 2012, 09:12 AM
SlowJet Offline
Registered User
 
Join Date: Jan 2005
Posts: 5,048
linuxfirefox
Re: Resize LVM VG

The default install is one VG with LV's for / and swap.

Did you use custome partitioning to make LVM parts?

Here is how to manage LVM parts but some planning is always needed before the install.
Most beginneres don't know and try to change the world backwards to the big bang spot rather then learn and reinstall a few time to get fimiluar with the anaconda installer, First things first, step by step, lesson #1, #2, ...

Resizing Logical Volumes EXT4 using e2fsprogs 1.41.2-1
Mission:
Phase I
reduce LogVol14var by 1GB (to get space for above)
increase LogVol14root by 224MB (less then 1 extent remaining)
Phase II not shown
increase LogVol14usr by 400MB (85%+ used)
reduce LogVol14var by 1GB (to get space for above)
reduce ogVol14home by 4GB (to make snapshot space)
VG-LV must be active but not mounted (LiveCD, rescue or second system)
# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol10home VolGroup10 -wi-ao 7.81G
LogVol10slash VolGroup10 -wi-ao 3.12G
LogVol10swap VolGroup10 -wi-ao 2.00G
LogVol10tmp VolGroup10 -wi-ao 960.00M
LogVol10usr VolGroup10 -wi-ao 4.69G
LogVol10var VolGroup10 -wi-ao 2.34G
LogVol10x4 VolGroup10 -wi-a- 9.00G
LogVol14home VolGroup14 -wi-a- 97.88G
LogVol14root VolGroup14 -wi-a- 480.00M
LogVol14swap VolGroup14 -wi-ao 4.00G
LogVol14tmp VolGroup14 -wi-a- 2.00G
LogVol14usr VolGroup14 -wi-a- 4.09G
LogVol14var VolGroup14 -wi-a- 3.00G


# e2fsck -f /dev/VolGroup14/LogVol14var
e2fsck 1.41.2 (02-Oct-2008)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/VolGroup14/LogVol14var: 809/196608 files (9.6% non-contiguous), 71592/786432 blocks
[root@Tasha-19 ~]# resize2fs -p /dev/VolGroup14/LogVol14var 2G
resize2fs 1.41.2 (02-Oct-2008)
Resizing the filesystem on /dev/VolGroup14/LogVol14var to 524288 (4k) blocks.
Begin pass 3 (max = 24)
Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/VolGroup14/LogVol14var is now 524288 blocks long.

[root@Tasha-19 ~]# man lvresize
[root@Tasha-19 ~]# man lvreduce
Formatting page, please wait...
###test it
[root@Tasha-19 ~]# lvreduce --size 2G VolGroup14/LogVol14var --test
Test mode: Metadata will NOT be updated.
WARNING: Reducing active logical volume to 2.00 GB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce LogVol14var? [y/n]: y
Reducing logical volume LogVol14var to 2.00 GB
Logical volume LogVol14var successfully resized

### do it
[root@Tasha-19 ~]# lvreduce --size 2G VolGroup14/LogVol14var
WARNING: Reducing active logical volume to 2.00 GB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce LogVol14var? [y/n]: y
Reducing logical volume LogVol14var to 2.00 GB
Logical volume LogVol14var successfully resized
### results
LogVol14var VolGroup14 -wi-a- 2.00G

### increase lv root test it
# lvresize --size +200M VolGroup14/LogVol14root --test
Test mode: Metadata will NOT be updated.
Rounding up size to full physical extent 224.00 MB
Extending logical volume LogVol14root to 704.00 MB
Logical volume LogVol14root successfully resized
### size different test again
[root@Tasha-19 ~]# lvresize --size +224M VolGroup14/LogVol14root --test
Test mode: Metadata will NOT be updated.
Extending logical volume LogVol14root to 704.00 MB
Logical volume LogVol14root successfully resized
### do it
[root@Tasha-19 ~]# lvresize --size +224M VolGroup14/LogVol14root
Extending logical volume LogVol14root to 704.00 MB
Logical volume LogVol14root successfully resized

### resize fs to fill lv
[root@Tasha-19 ~]# resize2fs /dev/VolGroup14/LogVol14root
resize2fs 1.41.2 (02-Oct-2008)
Please run 'e2fsck -f /dev/VolGroup14/LogVol14root' first.

### run ck
[root@Tasha-19 ~]# e2fsck -f /dev/VolGroup14/LogVol14root
e2fsck 1.41.2 (02-Oct-2008)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/VolGroup14/LogVol14root: 12711/122880 files (2.5% non-contiguous), 437964/491520 blocks
### do it
[root@Tasha-19 ~]# resize2fs /dev/VolGroup14/LogVol14root
resize2fs 1.41.2 (02-Oct-2008)
Resizing the filesystem on /dev/VolGroup14/LogVol14root to 720896 (1k) blocks.
The filesystem on /dev/VolGroup14/LogVol14root is now 720896 blocks long.
### results
LogVol14root VolGroup14 -wi-a- 704.00M

g/l SJ
__________________
Do the Math
Reply With Quote
Reply

Tags
lvm, resize

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't resize windows tech291083 Using Fedora 10 20th March 2009 02:09 PM
resize partition anafshalom Using Fedora 7 28th December 2007 06:30 AM
WTK How to resize a GIF Bill Z Guides & Solutions (No Questions) 4 19th December 2006 10:33 PM
FC5 lvm resize Deady Using Fedora 1 7th April 2006 08:26 AM
Help with png resize Shadow Skill Wibble 11 23rd July 2005 02:17 AM


Current GMT-time: 15:57 (Friday, 01-08-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat