|
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
|