How To Configure LVM on Linux / CentOS / Redhat

0

 

Page index:
Overview
Setup Physical Volumes
Setup Volume Groups
Setup Logical Volume Group
Extending Volume Group
Extending Logical Volume
Reducing Logical Volume

Page 6 of 7

Extending Logical Volume:

One problem solved by extending the volume group (smbserver), but i have another problem I have very less space on particular LV (data). So i want to increase the particular LV. we can achieve by the following steps of work.

Use the following command to extend LV (data) to 48GB from 45 GB. I am extending only 3 GB because i don’t have more space to extend. You can extend your LV according to your requirement.

[root@SRV01 ~]# lvextend -L 48G /dev/smbserver/data

Extending logical volume data to 48.00 GB

Logical volume data successfully resized

Scanning the LV’s.

[root@SRV01 ~]# lvscan

ACTIVE ‘/dev/smbserver/data’ [48.00 GB] inherit

ACTIVE ‘/dev/smbserver/backup’ [10.00 GB] inherit

ACTIVE ‘/dev/smbserver/videos’ [20.00 GB] inherit

The above will only extend LV; we have to manually resize the file system also.

[root@SRV01 ~]# e2fsck -f /dev/smbserver/data

e2fsck 1.39 (29-May-2006)

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/smbserver/data: 12/2621440 files (8.3% non-contiguous), 382574/5242880 blocks

Use the following command to resize the file system.

[root@SRV01 ~]# resize2fs /dev/smbserver/data

resize2fs 1.39 (29-May-2006)

Resizing the filesystem on /dev/smbserver/data to 12582912 (4k) blocks.

The filesystem on /dev/smbserver/data is now 12582912 blocks long.

Check it, use the following steps.

[root@SRV01 ~]# mount /dev/smbserver/data /smbserver/data/

[root@SRV01 ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/sda3 965M 467M 449M 51% /

/dev/sda8 5.5G 144M 5.1G 3% /tmp

/dev/sdb5 9.2G 276M 8.5G 4% /opt

/dev/sda7 4.8G 398M 4.1G 9% /home

/dev/sda6 6.2G 1.4G 4.5G 24% /var

/dev/sda5 9.5G 3.3G 5.7G 37% /usr

/dev/sda1 487M 30M 432M 7% /boot

tmpfs 217M 0 217M 0% /dev/shm

/dev/sdb6 11G 155M 9.9G 2% /vm

none 217M 104K 217M 1% /var/lib/xenstored

/dev/hdc 3.7G 3.7G 0 100% /media/CentOS_5.3_Final

/dev/mapper/smbserver-backup

9.9G 1.2G 8.3G 13% /smbserver/backup

/dev/mapper/smbserver-videos

20G 173M 19G 1% /smbserver/videos

/dev/mapper/smbserver-data

48G 1.2G 44G 3% /smbserver/data

Page 5: Extending Volume Group

Page 7: Reducing Logical Volume

You might also like