Saturday, August 22, 2009

CREATING A LOGICAL VOLUME AND FILESYSTEM

CREATING A LOGICAL VOLUME AND FILESYSTEM

Step 1: Identify whether the Volume group has sufficient space to create a logical volume

#vgdisplay -v vg01

--- Volume groups ---

VG Name /dev/vg01

VG Write Access read/write

VG Status available

Max LV 255

Cur LV 0

Open LV 0

Max PV 16

Cur PV 1

Act PV 1

Max PE per PV 1016

VGDA 4

PE Size (Mbytes) 4

Total PE 508

Alloc PE 0

Free PE 508

Total PVG 0

Total Spare PVs 0

Total Spare PVs in use 0


#lvcreate -L 100 -n lvol01 /dev/vg01

Logical volume "/dev/vg01/lvol01" has been successfully created with

character device "/dev/vg01/rlvol01".

Logical volume "/dev/vg01/lvol01" has been successfully extended.

Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

#newfs -F vxfs /dev/vg01/rlvol01

version 3 layout

102400 sectors, 102400 blocks of size 1024, log size 1024 blocks

unlimited inodes, 102400 data blocks, 101280 free data blocks

4 allocation units of 32768 blocks, 32768 data blocks

last allocation unit has 4096 data blocks

first allocation unit starts at block 0

overhead per allocation unit is 0 blocks

#cp -p /etc/fstab /etc/fstab.$(date +%d%h%y)

[Note : Make a backup copy of /etc/fstab file before modifying it]

# ll /etc/fstab*

-rw-r--r-- 1 root sys 412 Nov 5 12:05 /etc/fstab

-rw-r--r-- 1 root sys 412 Nov 5 12:05 /etc/fstab.05Nov08

# echo "/dev/vg01/lvol01 /opt/test vxfs delaylog 0 2" >> /etc/fstab

#mount /opt/test

#bdf /opt/test

Filesystem kbytes used avail %used Mounted on

/dev/vg01/lvol01 102400 1133 94945 1% /opt/test

No comments:

Post a Comment