加载中…
正文 字体大小:

RHEL LVM 命令参考

(2012-04-06 15:46:44)
标签:

rhel

lvm

命令参考

杂谈

分类: oracle资料转载
RHEL LVM 命令参考
  • pvscan
  • pvdisplay
  • pvcreate
  • pvremove
[root@billhist ~]# pvcreate /dev/sd{b,c,d,e,f,g}1
Physical volume "/dev/sdb1" successfully created
Physical volume
"/dev/sdc1" successfully created
Physical volume
"/dev/sdd1" successfully created
Physical volume
"/dev/sde1" successfully created
Physical volume
"/dev/sdf1" successfully created
Physical volume
"/dev/sdg1" successfully created
[root
@billhist ~]# pvscan
PV /dev/sdb1 lvm2 [1.76 TB]
PV
/dev/sdc1 lvm2 [1.76 TB]
PV
/dev/sdd1 lvm2 [1.76 TB]
PV
/dev/sde1 lvm2 [1.76 TB]
PV
/dev/sdf1 lvm2 [1.76 TB]
PV
/dev/sdg1 lvm2 [1.21 TB]
Total:
6 [10.00 TB] / in use: 0 [0 ] / in no VG: 6 [10.00 TB]
[root
@billhist ~]# pvdisplay
"/dev/sdb1" is a new physical volume of "1.76 TB"
--- NEW Physical volume ---
PV Name
/dev/sdb1
VG Name
PV Size
1.76 TB
Allocatable NO
PE Size (KByte)
0
Total PE
0
Free PE
0
Allocated PE
0
PV UUID BZbbTK
-SgUK-0t9N-tJxk-Xp7f-mYhk-Q7e3DR
 
  • vgcreate
  • vgscan
  • vgdisplay
  • vgextend
  • vgreduce
  • vgchange
  • vgremove
[root@billhist ~]# vgcreate -s 16m vg00 /dev/sd{b,c,d,e,f,g}1
Volume group "vg00" successfully created
[root
@billhist ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group
"vg00" using metadata type lvm2
[root
@billhist ~]# pvscan
PV /dev/sdb1 VG vg00 lvm2 [1.76 TB / 1.76 TB free]
PV
/dev/sdc1 VG vg00 lvm2 [1.76 TB / 1.76 TB free]
PV
/dev/sdd1 VG vg00 lvm2 [1.76 TB / 1.76 TB free]
PV
/dev/sde1 VG vg00 lvm2 [1.76 TB / 1.76 TB free]
PV
/dev/sdf1 VG vg00 lvm2 [1.76 TB / 1.76 TB free]
PV
/dev/sdg1 VG vg00 lvm2 [1.21 TB / 1.21 TB free]
Total:
6 [10.00 TB] / in use: 6 [10.00 TB] / in no VG: 0 [0 ]
[root
@billhist ~]# vgdisplay
--- Volume group ---
VG Name vg00
System ID
Format lvm2
Metadata Areas
6
Metadata Sequence No
1
VG Access read
/write
VG Status resizable
MAX LV
0
Cur LV
0
Open LV
0
Max PV
0
Cur PV
6
Act PV
6
VG Size
10.00 TB
PE Size
16.00 MB
Total PE
655418
Alloc PE
/ Size 0 / 0
Free PE
/ Size 655418 / 10.00 TB
VG UUID JsadXt
-mOfG-5r0i-UgVx-fF97-RBnu-eqg70k
 
  • lvcreate
  • lvscan
  • lvdisplay
  • lvextend
  • lvreduce
  • lvremove
  • lvresize
[root@billhist ~]# lvcreate -L 10T -n datalv vg00
Logical volume "datalv" created
[root
@billhist ~]# ll /dev/vg00/datalv
lrwxrwxrwx 1 root root 23 Mar 14 13:25 /dev/vg00/datalv -> /dev/mapper/vg00-datalv
[root
@billhist ~]# lvdisplay
--- Logical volume ---
LV Name
/dev/vg00/datalv
VG Name vg00
LV UUID 9rKxZH
-pHjl-Atpm-l1mC-KzQ0-sCNV-KHCbwc
LV Write Access read
/write
LV Status available
# open 0
LV Size 10.00 TB
Current LE
655360
Segments
6
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device
253:0
[root@billhist oracle]# mkfs -t ext4 /dev/vg00/datalv
mke2fs 1.41.13 (13-Dec-2010)

Warning: the fs_type
default is not defined in /etc/mke2fs.conf

Filesystem label
=
OS type: Linux
Block size
=4096 (log=2)
Fragment size
=4096 (log=2)
Stride
=0 blocks, Stripe width=0 blocks
671088640 inodes, 2684354560 blocks
134217728 blocks (5.00%) reserved for the super user
First data block
=0
Maximum filesystem blocks
=4294967296
81920 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848, 512000000, 550731776, 644972544, 1934917632,
2560000000

Writing inode tables: done
Creating journal (
32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every
34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root
@billhist oracle]# mkdir /u02
[root@billhist oracle]# mount /dev/vg00/datalv /u02

----------------------------------------

[root@rdgp ~]# pvcreate /dev/sddlmba1
Physical volume "/dev/sddlmba1" successfully created
[root
@rdgp ~]# pvcreate /dev/sddlmbb1
Physical volume "/dev/sddlmbb1" successfully created
[root
@rdgp ~]# vgscan
Found volume group "lvmdata2" using metadata type lvm2
Found volume group
"lvmdata" using metadata type lvm2
[root
@rdgp ~]# vgextend lvmdata2 /dev/sddlmb{a,b}1
Volume group "lvmdata2" successfully extended
[root
@rdgp ~]# vgdisplay lvmdata2
--- Volume group ---
VG Name lvmdata2
System ID
Format lvm2
Metadata Areas
13
Metadata Sequence No
3
VG Access read
/write
VG Status resizable
MAX LV
0
Cur LV
1
Open LV
1
Max PV
0
Cur PV
13
Act PV
13
VG Size
2.54 TB
PE Size
16.00 MB
Total PE
166387
Alloc PE
/ Size 140789 / 2.15 TB
Free PE
/ Size 25598 / 399.97 GB
VG UUID 3ZBggo
-OMY7-Ltqp-nKaz-0NJs-096O-t4szKI

[root
@rdgp ~]# lvresize -l +25598 /dev/lvmdata2/lv_lvmdata2
Extending logical volume lv_lvmdata2 to 2.54 TB
Logical volume lv_lvmdata2 successfully resized
[root@rdgp ~]# resize2fs /dev/lvmdata2/lv_lvmdata2
resize2fs 1.41.13 (13-Dec-2010)
Filesystem at /dev/lvmdata2/lv_lvmdata2 is mounted on /u04; on-line resizing required
old desc_blocks = 138, new_desc_blocks = 163
Performing an on-line resize of /dev/lvmdata2/lv_lvmdata2 to 681521152 (4k) blocks.
The filesystem on /dev/lvmdata2/lv_lvmdata2 is now 681521152 blocks long.
 

0

阅读 评论 收藏 禁止转载 喜欢 打印举报
已投稿到:
  • 评论加载中,请稍候...
发评论

       

    验证码: 请点击后输入验证码 收听验证码

    发评论

    以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

      

    新浪BLOG意见反馈留言板 不良信息反馈 电话:4006900000 提示音后按1键(按当地市话标准计费) 欢迎批评指正

    新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

    新浪公司 版权所有