Lvm: Difference between revisions

From Halfface
Jump to navigation Jump to search
No edit summary
No edit summary
Line 22: Line 22:


  umount /data # umount /data
  umount /data # umount /data
  resize2fs /dev/my_vol_grp/my_logical_vol  1G # Resize file system to 1GB.
  resize2fs /dev/VolGroup00/LogVol00 10G # Resize file system to 10GB.
  lvreduce -L 1G  /dev/my_vol_grp/my_logical_vol # Resize logical volume to 1GB.
  lvreduce -L 10G /dev/VolGroup00/LogVol00 # Resize logical volume to 1GB.
  e2fsck -f /dev/my_vol_grp/my_logical_vol # Check filesystem.
  e2fsck -f /dev/VolGroup00/LogVol00 # Check filesystem.
  mount /data # mount /data
  mount /data # mount /data
resize2fs /dev/volGroup00/LogVol00 150000
lvreduce -L150M /dev/VolGroup00/LogVol00
e2fsck -f /dev/VolGroup00/LogVol00


Shrink reizerfs volume.
Shrink reizerfs volume.

Revision as of 10:45, 23 October 2007

Create partition.

fdisk /dev/sda1

Create physiscal volume.

pvcreate /dev/sda3
pvdisplay

Create volume group.

vgcreate VolGroup00 /dev/sda1
vgdisplay

Create logical volume. Create a logic volume spanning 3 disks, each stripe 256kb, 1,5TB, called home, in Volume Group 00 The logical volume is being created under /dev/VolGroup00/LogVol00

lvcreate i3 -I 256 L1500000 -n LOgVol00 VolGroup00
lvdisplay

Extend a resizerfs logical volume.

lvextend -L+70G /dev/VolGroup00/LogVol00
resize_reiserfs -f /dev/VolGroup00/LogVol00

Shrink ext2/3 partition.

umount /data # umount /data
resize2fs /dev/VolGroup00/LogVol00 10G # Resize file system to 10GB.
lvreduce -L 10G /dev/VolGroup00/LogVol00 # Resize logical volume to 1GB.
e2fsck -f /dev/VolGroup00/LogVol00 # Check filesystem.
mount /data # mount /data

Shrink reizerfs volume.

resize_reiserfs -s-150M /dev/VolGroup/LogVol00
lvreduce -L-150M /dev/VolGroup00/LogVol00

Create device-mapper in /proc/misc

modprobe dm-mod

Activate Volume Group.

lvm vgchange -a y VolGroup00