data vg00 -wi-ao---- 5.85g
swap vg00 -wi-ao---- 1.95g
lvzx01 vgzx -wi-a----- 2.00g
lvzx02 vgzx -wi-a----- 2.00g
5)使用刚创建的LV创建文件系统并挂载到操作系统
[root@localhost ~]# mkfs.ext4 /dev/vgzx/lvzx01
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
131072 inodes, 524288 blocks
26214 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=536870912
16 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@localhost ~]# mkfs.ext4 /dev/vgzx/lvzx02
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
131072 inodes, 524288 blocks
26214 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=536870912
16 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@localhost ~]# mkdir /orasoft
[root@localhost ~]# mkdir /oradata
[root@localhost ~]# mount /dev/mapper/vgzx-lvzx01
mount: can't find /dev/mapper/vgzx-lvzx01 in /etc/fstab or /etc/mtab
[root@localhost ~]# mount /dev/mapper/vgzx-lvzx01 /oradata/
[root@localhost ~]# mount /dev/mapper/vgzx-lvzx02 /orasoft/
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg00-data
5.7G 1.9G 3.6G 34% /
tmpfs 499M 0 499M 0% /dev/shm
/dev/sda1 190M 36M 145M 20% /boot
/dev/mapper/vgzx-lvzx01
2.0G 3.0M 1.9G 1% /oradata
/dev/mapper/vgzx-lvzx02
2.0G 3.0M 1.9G 1% /orasoft
如果想挂载随机启动需要修改/etc/fastab文件。
6)扩展LV
[root@localhost ~]# lvextend -L +2G /dev/mapper/vgzx-lvzx01
Size of logical volume vgzx/lvzx01 changed from 2.00 GiB (512 extents) to 4.00 GiB (1024 extents).
Logical volume lvzx01 successfully resized
[root@localhost ~]# lvextend -L +3G /dev/mapper/vgzx-lvzx02
Size of logical volume vgzx/lvzx02 changed from 2.00 GiB (512 extents) to 5.00 GiB (1280 extents).
Logical volume lvzx02 successfully resized
[root@localhost ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert