Wednesday, March 18, 2009

Using free space to create logical volume on LVM partition

[root@igloo ~]# vgdisplay

--- Volume group ---

VG Name VolGroup00

System ID

Format lvm2

Metadata Areas 1

Metadata Sequence No 5

VG Access read/write

VG Status resizable

MAX LV 0

Cur LV 2

Open LV 2

Max PV 0

Cur PV 1

Act PV 1

VG Size 74.41 GB

PE Size 32.00 MB

Total PE 2381

Alloc PE / Size 193 / 6.03 GB

Free PE / Size 2188 / 68.38 GB

VG UUID JoY5DH-S0HV-Q5Dw-b2wC-Rpe0-XeaR-QFbG75



[root@igloo ~]# lvscan

ACTIVE '/dev/VolGroup00/LogVol00' [5.03 GB] inherit

ACTIVE '/dev/VolGroup00/LogVol01' [1.00 GB] inherit



[root@igloo ~]# lvcreate -l 2188 VolGroup00 -n LogVol02

Logical volume "LogVol02" created



[root@igloo ~]# lvscan

ACTIVE '/dev/VolGroup00/LogVol00' [5.03 GB] inherit

ACTIVE '/dev/VolGroup00/LogVol01' [1.00 GB] inherit

ACTIVE '/dev/VolGroup00/LogVol02' [68.38 GB] inherit



[root@igloo ~]# mkfs -t ext3 /dev/VolGroup00/LogVol02

mke2fs 1.36 (05-Feb-2005)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

8962048 inodes, 17924096 blocks

896204 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=20971520

547 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424



Writing inode tables: done

Creating journal (8192 blocks): done

Writing superblocks and filesystem accounting information: done



This filesystem will be automatically checked every 21 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.



[root@igloo ~]# e2label /dev/VolGroup00/LogVol02 /oracle



[root@igloo ~]# cat /etc/fstab

# This file is edited by fstab-sync - see 'man fstab-sync' for details

/dev/VolGroup00/LogVol00 / ext3 defaults 1 1

LABEL=/boot /boot ext3 defaults 1 2

LABEL=/realvar /realvar ext3 defaults 1 2

none /dev/pts devpts gid=5,mode=620 0 0

none /dev/shm tmpfs defaults 0 0

none /proc proc defaults 0 0

none /sys sysfs defaults 0 0

/dev/VolGroup00/LogVol01 swap swap defaults 0 0

/dev/VolGroup00/LogVol02 /oracle ext3 defaults 1 2

/dev/hdc /media/cdrom auto pamconsole,exec,noauto,managed 0 0

/dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0



Create the partition name with required name in / and mount it:-

[root@igloo ~]#mkdir /oracle

[root@igloo ~]#mount /oracle

Check with the df –h command .