Chinaunix首页 | 论坛 | 博客
  • 博客访问: 98720
  • 博文数量: 65
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2015-08-04 09:08
文章分类
文章存档

2019年(65)

我的朋友

分类:

2019-07-23 16:18:21

希望对要学习这个的朋友有一些帮助吧.最后一部分把常用命令给大家希望可以有一个帮助吧.(前面的一部分内容是我转贴过来的)做了一个组合吧.刚写好的,可能有些乱,还请大家不要介意.谢谢大家的支持!!!
二、添加License的命令  
#vxlicense -c  
三、查看License的命令  
# vxlicense -p  
四、名词解析  
VRTSvxvm VxVM软件  
VRTSlic VxVM licensing utilities  
VRTSvmdoc VxVM电子文档  
VRTSvmman VxVM帮助手册  
VRTSvmdev VxVM developer’s package  
VRTSvxsa VxVM图形管理界面  
VRTSvxfs VxFS软件  
VRTSfsdoc VxFS文档  
五、添加VxVM和VxFS包  
#mount -F hsfs -o ro /dev/dsk/c0t6d0s2 /mnt  
# pkgadd -d path_name product_packages  
注意:要以超级用户权限登录系统,完了后还要重启系统。  
六、安装VxFS后,修改/etc/system ,在里面添加一行:  
set lwp_default_stksize=0x4000  
并将原始的文件拷贝一份。  
七、检查安装包:  
#pkginfo 列出所有安装的包  
#pkginfo | grep VRTS 列出安装的VERITAS的包  
#pkginfo -l pkckage 列出某个安装包的详细信息  
八、用vxinstall来创建rootdg 。  
选择Custom安装。  
九、显示执行过的命令:  
#tail -f /var/opt/vmsa/logs/command  
十、命令行  
在如下几个目录中,可以找到在命令行中使用的命令:  
/etc/vx/bin  
/usr/sbin  
/usr/lib/vxvm/bin  
注:把这些目录加入到PATH环境变量中去。  
十一、几条常用命令:  
vxassist 、vxprint 、vxdg 、vxdisk  、vxinfo 、vxdiskadm
十二、检查是否有别的VMSA版本存在:  
#pkginfo -l | grep vmsa  
如果有则删除:  
#pkgrm VRTSvmsa  
十三、启动VMSA  
1.以root用户登录;  
2.#./vmsa_server &  
3.xhost + system_name (这一步有时需要做)  
4.DISPLAY=’uname -n ‘:0.0 ;export DISPLAY(这一步有时需要做)  
十四、启动VMSA客户端  
1.本地启动:# vmsa  
2.远程启动:# vmsa remote_machine_name  
十五、几个命令  
1.确定VMSA是否运行:# vmsa_server -q  
2.停止VMSA服务: # vmsa_server -k  
3.显示VMSA运行版本:# vmsa_server -v  
4.启动自动模式:# autostart on  
5.显示当前运行模式:# netstat -a | grep vmsa  
6.改变自动模式:# autostart off  
7.运行在只读模式下:# vmsa_server -r & 和# vmsa -r &  
十六、添加磁盘的方法:(行命令)  
1.vxdisksetup :configures a disk for VxVM  
2.vxdg addisk :add a disk to a disk group  
3.# /etc/vx/bin/vxdisksetup -i disk_address [attributes]  
注:The disk_address defines the controller , target , and SCSI logical unit number of the disk to be set up and takes the form c # t # d # . The -i option writes a disk header to the disk , making the disk derectly usable .  
4.# vxdg -g diskgroup adddisk disk_name=device_name  
十七、查看磁盘信息(命令行)  
1.vxdisk list :list disk information  
2.prtvtoc :Display VTOC configuration  
3.vxdisk -o alldgs list :show all disk groups in the output .  
4.# vxdisk list disk_name :显示某个磁盘的信息。  
5.# prtvtoc physical_disk_path  
6.# prtvtoc /dev/rdsk/c1t10d0s2  
注:注意磁盘在卷中和不在卷中,prtvtoc命令结果显示的不同。  
十八、Evacuating a disk // remove a disk(命令行)  
1.vxevac -g diskgroup from_diskname to_diskname  
2.例子:# vxevac -g datadg datadg02 datadg03  
3.vxdg rmdisk :returns a disk to the free disk pool  
4.vxdiskunsetup :returning a disk to an uninitialized state  
5.vxdg -g diskgroup rmdisk disk_name  
6.例子:# vxdg -g newdg rmdisk newdg02  
7./etc/vx/bin/vxdiskunsetup -[C] disk_address  
8.例子:# vxdiskunsetup c1t0d0  
十九、给磁盘重命名(命令行)  
1.# vxedit -g diskgroup rename old_diskname new_diskname  
2.Using vxdg deport and vxdg import rename a disk group  
二十、The rootdg disk group cannot be destroyed and must exist on every system , because it is an essential part of the VxVM boot process .  
二十一、创建磁盘组(命令行)  
1.vxdg init diskgroup disk_name=device_name  
2.# vxdg init newdg newdg01=c1t1d0s2  
二十二、创建备用磁盘  
# vxdg -g diskgroup set spare=on|off disk_media_name  
二十三、Deporting a disk group(命令行)  
1.# unmount /filesystem(先卸载磁盘组上的文件系统)  
2.# vxdg deport diskgroup  
3.# vxdg -n new_name deport old_name(deport and rename a disk group)  
4.# vxdg -h hostname deport diskgroup(deport to a new host)  
二十四、Importing a disk group(命令行)  
1.# vxdg import diskgroup  
2.# vxdg -n new_name import old_name(import and rename a disk group)  
3.# vxdg -t -n temp_name import old_name(import and rename temporaily)  
4.# vxdg -tC -n newerdg import newdg(clear import locks,add the -C option)  
5.# vxdg -f import newdg(force an import)  
二十五、Rename a disk group:CLI  
1.# vxdg -n new_name deport old_name  
2.# vxdg import new_name  
以上是第一种方式  
3.# vxdg deport old_name  
4.# vxdg -n new_name import old_name  
5.# vxvol -g diskgroup_newname startall(在命令行中重命名磁盘组后要重启volume)  
二十六、Destroying a disk group  
# vxdg destroy diskgroup  
二十七、查看磁盘组信息  
1.vxdisk -s list 显示磁盘组名和ID  
2.vxdisk -o alldg list 显示所有磁盘组的信息,包括已经destroy的。  
3.vxdg -g diskgroup free 显示磁盘组中的free space 。  
4.vxdg free  
二十八、显示磁盘组的版本  
1.# vxdg list diskgroup  
2.# vxprint -l  
二十九、升级磁盘组版本  
1.vxdg [-T version] upgrade diskgroup  
2.# vxdg -T 40 upgrade datadg(把datadg从20升级到40)  
3.# vxdg upgrade datadg(把datadg升级到当前的版本90)  
4.# vxdg -T 50 init newdg newdg01=c0t3d0s2(创建版本为50的磁盘组)
vxrootmir doesn't join the secondary boot disk into rootdg disk group and it only mirrors rootvol. The correct procedure to mirror your boot disk is:

1. install Veritas volume manager and license
2. vxinstall
3. choose "custom install"
4. answer yes to "encapsulate your boot disk" and supply rootdisk01 as your boot disk name
5. leave all the other disks alone
6. reboot your system
7. export PATH=$PATH:/etc/vx/bin
8. select a disk on a different controler as your secondary boot disk, for instance, c1t0d0
9. vxdisksetup -i c1t0d0
10. vxdg -g rootdg adddisk rootdisk02=c1t0d0
11. vxprint -hg rootdg | grep ^v and note down the volume names other than rootvol
12. nohup vxrootmir rootdisk02 &
13. nohup vxassist -g rootdg mirror volume_name rootdisk02 &
14. vxtask list to monitor the progress
15. eeprom | grep boot-device, normally it should be vx-rootdisk01 vx-rootdisk02
16. init 0
17. boot vx-rootdisk02 to verify
If you want to break the mirror, you'll have to detach and deassociate the mirrored plexes, and then remove them. Below is the example of how to remove the second plex for rootvol:

1> vxprint -g rootdg -ht rootvol | grep ^pl (the plex name should be rootvol-02)
2> vxplex -g rootdg det rootvol-02
3> vxplex -g rootdg dis rootvol-02
4> vxedit -g rootdg -rf rm rootvol-02 (this removes plex and the subdisk)
5> do 1-4 for other volumes in rootdg
6> vxprint -hg rootdg, you should see no subdisk nor plex should resides on rootdisk02
7> If you want to remove the second boot disk out of rootdg, do "vxdg -g rootdg rmdisk rootdisk02"
8> vxdisk list (you should see the disk is online but not belong to any disk group)
我们可以从根盘(假设它是c0t0d0s2)“偷”出一点空间来,再做出一个slice,比如是c0t0d0s7,最好从swap的尾部分出,假设swap slice从柱面1000到3000,那么你可以把2900到3000分给slice7,具体要根据你的硬盘情况,但要保证slice7至少有10M的大小。用format命令完成这一步。

然后用以下步骤重新做一个rootdg:

1.首先建立一个文件:
#touch /etc/vx/reconfig.d/state.d/install-db

2. reboot system

3. input following commands:
#vxconfigd -m disable
#vxdctl init
#vxdg init rootdg
#vxdctl add disk c0t0d0s7 type=simple
#vxdisk -f init c0t0d0s7 type=simple
#vxdg -g rootdg adddisk c0t0d0s7
#vxdctl enable
4. 删除文件install-db
# rm /etc/vx/reconfig.d/state.d/install-db

5.reboot system again

管理磁盘
vxdiskadm
使用基于菜单的界面管理 VxVM 磁盘。
vxdiskadd [devicename] 添加由设备名指定的磁盘。
vxedit rename olddisk newdisk 重命名由 VxVM 控制的磁盘。
vxedit set reserve=on|off diskname
留出/ 不留出磁盘组中的某个磁盘。
vxedit set nohotuse=on|off diskname
不允许/ 允许将磁盘的上空闲空间用于热重定位。
vxedit set spare=on|off diskname
在热重定位备用磁盘池中添加/ 删除磁盘。
vxdisk offline devicename
使磁盘脱机。
vxdg -g diskgroup rmdisk diskname 将磁盘从其磁盘组中删除。
vxdisk rm diskname 从 VxVM 的控制中删除磁盘。
创建和管理磁盘组
vxdg init diskgroup [diskname=]devicename
vxdg -s init diskgroup [diskname=]devicename
vxdg [-n newname] deport diskgroup
vxdg [-n newname] import diskgroup
vxdg [-n newname] -s import diskgroup
vxdg [-o expand] listmove sourcedg targetdg object ...
vxdg [-o expand] move sourcedg targetdg object ...
vxdg [-o expand] split sourcedg targetdg object ...
vxdg [-o expand] join sourcedg targetdg
vxdg -g diskgroup set activation=ew|ro|sw|off
vxrecover -g diskgroup -sb
vxdg destroy diskgroup
创建和管理子磁盘
vxmake sd subdisk diskname,offset,length
创建子磁盘。
vxsd assoc plex subdisk ... 将子磁盘与现有的 plex 关联。
vxsd assoc plex subdisk1:0 ... subdiskM:N-
将子磁盘添加到条带卷或 RAID-5 卷的列尾。
vxsd aslog plex subdisk
将日志子磁盘与现有的 plex 关联
vxsd mv oldsubdisk newsubdisk
替换子磁盘。
vxsd -s size split subdisk sd1 sd2
将一个子磁盘分割为两个子磁盘。
vxsd join sd1 sd2 subdisk
结合两个子磁盘。
vxassist [-g diskgroup] move volume !olddisk newdisk
vxunreloc [-g diskgroup] original_disk 将子磁盘重定位到原始磁盘。
vxsd dis subdisk
从 plex 中分离子磁盘。
vxedit rm subdisk
删除子磁盘。
vxsd -o rm dis subdisk 从 plex 中分离并删除子磁盘。
创建和管理 Plex

vxmake plex plex sd=subdisk1[,subdisk2,...]
vxmake plex plex layout=stripe|raid5stwidth=W ncolumn=N \ sd=subdisk1[,subdisk2,...]
vxplex att volume plex
vxplex det plex
vxmend on plex
vxplex mv oldplex newplex
vxplex cp volume newplex
vxplex fix clean plex
vxplex -o rm dis plex
创建卷
vxassist [-g diskgroup] maxsize layout=layout [attributes]
vxassist make volume length [layout=layout ] [attributes]
vxassist make volume length layout=mirror[nmirror=N] [attributes]
vxassist make volume length layout=layout exclusive=on [attributes]
vxassist make volume length layout=stripe|raid5 [stripeunit=W] [ncol=N] [attributes]
vxassist make volume length layout=layout mirror=ctlr [attributes]
vxmake -Uusage_type vol volume [len=length] plex=plex,...
vxvol start volume
vxvol init zero volume
管理卷
vxassist mirror volume [attributes]
将镜像添加到卷。
vxassist remove mirror volume [attributes]
从卷中删除镜像。
vxassist addlog volume [attributes]
将日志添加到卷。
vxassist remove log volume [attributes]
从卷中删除日志。
vxvol set fastresync=on|off volume
打开或关闭卷的快速重同步。
vxassist growto volume length
将卷放大到指定大小。
vxassist growby volume length
以指定大小放大卷。
vxassist shrinkto volume length
将卷缩小到指定大小。
vxassist shrinkby volume length
以指定大小缩小卷。
vxresize -b -F xvfs volume length diskname
vxassist snapstart volume
准备卷的快照镜像。
vxassist snapshot volume snapshot
制作卷的快照。
vxassist snapback volume snapshot
将快照与其原始卷合并。
vxassist snapclear snapshot
使快照卷独立。
vxassist [-g diskgroup] relayout volume [layout=layout] [relayout_options]
执行卷的联机重新布局。
vxassist relayout volume layout=raid5 stripeunit=W ncol=N
将卷重新布局为条带宽为W 和N 列的RAID-5 卷。
vxrelayout -o bg reverse volume
逆转暂停的卷重新布局的方向。
vxassist convert volume [layout=layout] [convert_options]
在分层卷与非分层卷布局之间转换。
vxassist convert volume layout=mirror-stripe
将条带镜像卷转换为镜像条带卷。
vxvol stop volume
停止卷。
vxassist remove volume volume
删除卷。
监视和控制任务
vxcommand -t tasktag [options] [arguments]
指定命令的任务标记。
vxtask [-h] list
列出正在系统上运行的任务。
vxtask monitor task
监视任务的执行进度。
vxtask pause task
挂起任务的操作。
vxtask -p list
列出所有暂停的任务。
vxtask resume task
恢复执行暂停的任务。
vxtask abort task
取消任务并尝试撤消其效果。
阅读(1154) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~