天天看点

[HPUX] HP Unix pv,vg,lv操作

[root@testdb:/#] pvcreate /dev/rdsk/c2t1d4                  #使用的字符设备

Physical volume "/dev/rdsk/c2t1d4" has been successfully created.

[ro[email protected]:/#] vgcreate vgora /dev/dsk/c2t1d4             #使用块设备

Increased the number of physical extents per physical volume to 50431.

vgcreate: Volume group "/dev/vgora" could not be created:

VGRA for the disk is too big for the specified parameters. Increase the

extent size or decrease max_PVs/max_LVs and try again.

[[email protected]:/#] diskinfo /dev/rdsk/c2t1d4

SCSI describe of /dev/rdsk/c2t1d4:

             vendor: HITACHI

         product id: DF600F

               type: direct access

               size: 206569472 Kbytes

   bytes per sector: 512

一个PE Size 默认大小是4M,so...4M*50431=201724M < 201728M (206569472/1024) 所以要增加PE的大小,设置PE Size=32M.

[[email protected]:/#] vgcreate -s 32 vgora /dev/dsk/c2t1d4

Increased the number of physical extents per physical volume to 6303.

Volume group "/dev/vgora" has been successfully created.

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

[[email protected]:/#] lvcreate -L 40G -n lvoracle vgora        #不能识别G.so..delete

[[email protected]:/#] lvcreate -L 80G -n lvoradata vgora

[[email protected]:/#] lvremove /dev/vgora/lvoracle

[[email protected]:/#] lvremove /dev/vgora/lvoradata

[[email protected]:/#] lvcreate -L 40960M -n lvoracle vgora

[[email protected]:/#] lvcreate -L 81920M -n lvoradata vgora

[ro[email protected]:/#] vgdisplay -v vgora                       #重新查看信息.

[[email protected]:/#] newfs -F vxfs /dev/vgora/lvoracle        #需要使用字符设备的,就是一个字母带r的.(带r裸设备使用,不带是文件系统使用的)

UX:vxfs newfs: ERROR: V-3-21623: /dev/vgora/lvoracle is not a character device

[[email protected]:/#] newfs -F vxfs /dev/vgora/rlvoracle

[[email protected]:/#] newfs -F vxfs /dev/vgora/rlvoradata

[[email protected]:/#] mkdir -p /oracle/testdb/oracle

[[email protected]:/#] mkdir -p /oracle/testdb/oradata

[[email protected]:/#] mount /dev/vgora/lvoracle /oracle/testdb/oracle

[ro[email protected]:/#] mount /dev/vgora/lvoradata /oracle/testdb/oradata

这个时候可以通过bdf查看是否挂载.

如果想要系统系统挂载filesystem,需要在/etc/fstab中添加记录.

[roo[email protected]:/#] vi /etc/fstab                             #添加如下内容.

/dev/vgora/lvoracle /oracle/testdb/oracle       vxfs delaylog 0 2

/dev/vgora/lvoradata /oracle/testdb/oradata     vxfs delaylog 0 2

[[email protected]:/#] mount -a

[root@testdb:/#] lvextend -L 92160M /dev/vgora/lvoradata     #增加lv大小

[[email protected]:/#] extendfs -F vxfs /dev/vgora/lvoradata       #filesystem不能在线操作.需要umount操作

UX:vxfs extendfs: ERROR: V-3-20144: /dev/vgora/lvoradata is mounted, cannot extend.

[[email protected]:/#] fsadm -F vxfs -b 92160M /oracle/testdb/oradata     #使用fsadm 在线操作.

UX:vxfs fsadm: INFO: V-3-25942: /dev/vgora/rlvoradata size increased from 83886080 sectors to 94371840 sectors

[[email protected]:/#] umount /oracle/testdb/oradata

[[email protected]:/#] lvreduce -L 81920M /dev/vgora/lvoradata

ro[email protected]:/#] mount /dev/vgora/lvoradata /oracle/testdb/oradata

UX:vxfs mount: ERROR: V-3-24706: /dev/vgora/lvoradata no such device or filesystem on it missing one or more devices

[[email protected]:/#] newfs -F vxfs /dev/vgora/rlvoradata        #只能这样了.但是这样里面的数据都没有了.

[[email protected]:/#] newfs -o largefiles -F vxfs /dev/vgora/rlvoradata        #不加-o 最大支持2G,加了之后支持128G.

[[email protected]:/#] mount -a

[[email protected]:/dev/vgasm#] pvcreate /dev/rdsk/c2t1d3

pvcreate: Could not perform LVM operation on VxVM disk "/dev/rdsk/c2t1d3".

[[email protected]:/dev/vgasm#] pvcreate -f /dev/rdsk/c2t1d3    #加上-f参数,强制执行

Physical volume "/dev/rdsk/c2t1d3" has been successfully created.

[[email protected]:/dev/vgasm#] vgextend vgora /dev/dsk/c2t1d3

[[email protected]:/dev/vgasm#] vgreduce vgora /dev/dsk/c2t1d3

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24237320/viewspace-2147135/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/24237320/viewspace-2147135/