在许多条件下我们必须吧操作系统从T Veritas Volume Manager 管理下释放出来。几年来 Veritas i通过命令vxunroot来完成这个任务; 然而它,有一些限制,比如:并不能够处理rootdisk 上的一些分区比如: (/, /var, swap, and /opt). 但是,这些限制在版本VxVM 3.5上已经不在有这些限制。下面的这些步骤主要是针对VXVM的早期版本来描述的。
下面来分步介绍解除Veritas Volume Manager管理的步骤
这个例子中有2个内部磁盘 (c0t0d0和 c0t1d0) 在Veritas Volume Manager管理中. 这2个盘之间做了镜像。
在 "ok" 方式下,从cdrom启动到单用户状态。:
ok boot cdrom -s
Boot device: /pci@1f,4000/scsi@3/disk@6,0:f File and args: -s
SunOS Release 5.8 Version Generic_108528-07 64-bit
Copyright 1983-2001 Sun Microsystems, Inc. All rights reserved.
Configuring /dev and /devices
Using RPC Bootparams for network configuration information.
/
INIT: SINGLE USER MODE
# TERM=vt100; export TERM
#
通过format检查一下文件系统:
# format Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@1f,4000/scsi@3/sd@0,0
1. c0t1d0
/pci@1f,4000/scsi@3/sd@1,0
Specify disk (enter its number):
# fsck -y /dev/rdsk/c0t0d0s0
** /dev/rdsk/c0t0d0s0
** Last Mounted on /
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
41356 files, 1047059 used, 5553722 free (4802 frags, 693615 blocks, 0.0% fragmentation)
# mount /dev/dsk/c0t0d0s0 /a
修改 /a/etc/system , 删除VxVM root device:
# cp /a/etc/system /a/etc/system.orig
# vi /a/etc/system
文件系统不在从Veritas volumes启动。你可以按照下面的方式屏蔽:
rootdev:/pseudo/vxio@0:0
set vxio:vol_rootdev_is_volume=1
改为:
* rootdev:/pseudo/vxio@0:0
* set vxio:vol_rootdev_is_volume=1
恢复无VxVM管理的vfstab . vxinstall能够备份原始的 vfstab 并改名为 vfstab.prevm:
# cp /a/etc/vfstab /a/etc/vfstab.vm
# cp /a/etc/vfstab.prevm /a/etc/vfstab
# cat /a/etc/vfstab
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes -
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/dsk/c0t0d0s1 - - swap - no -
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no logging
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4 /var ufs 1 no logging
swap - /tmp tmpfs - yes -
建立 install-db文件, 则VxVM进程不在启动的时候运行:
# touch /a/etc/vx/reconfig.d/state.d/install-db
root-done文件表示root 磁盘是被封装的,需要删除它:
# rm /a/etc/vx/reconfig.d/state.d/root-done
最后, unmount 文件系统并且重新启动:
# cd /; umount /a
# stop-a
重新启动
ok boot
Resetting ...
screen not found.
Can't open input device.
Keyboard not present. Using ttya for input and output.
Sun Ultra 30 UPA/PCI (UltraSPARC-II 296MHz), No Keyboard
OpenBoot 3.27, 512 MB memory installed, Serial #9377973.
Ethernet address 8:0:20:8f:18:b5, Host ID: 808f18b5.
Initializing Memory
Rebooting with command: boot
Boot device: disk File and args:
SunOS Release 5.8 Version Generic_108528-16 64-bit
Copyright 1983-2001 Sun Microsystems, Inc. All rights reserved.
NOTICE: VxVM not started
configuring IPv4 interfaces: hme0.
Hostname: pegasus
NOTICE: VxVM not started
NOTICE: VxVM not started
The system is coming up. Please wait.
starting rpc services: rpcbind done.
Setting netmask of hme0 to 255.255.255.0
Setting default IPv4 interface for multicast: add net 224.0/4: gateway pegasus
Starting sshd...
This platform does not support both privilege separation and compression
Compression disabled
syslog service starting.
VxVM Provider initialization warning: vxinstall has not been run.
Print services started.
/dev/bd.off: not a serial device.
volume management starting.
No VVR license installed on the system; vradmind not started.
No VVR license installed on the system; in.vxrsyncd not started.
The system is ready.
pegasus console login: root
Password:
Oct 23 17:41:55 pegasus login: ROOT LOGIN /dev/console
Sun Microsystems Inc. SunOS 5.8 Generic February 2000
# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 6607349 1053634 5487642 17% /
/proc 0 0 0 0% /proc
fd 0 0 0 0% /dev/fd
mnttab 0 0 0 0% /etc/mnttab
/dev/dsk/c0t0d0s4 1016863 239898 715954 26% /var
swap 1401536 16 1401520 1% /var/run
swap 1401536 16 1401520 1% /tmp
到这里操作系统已经不在Veritas Volume Manager 管理下了。现在虽然操作系统不在被VXVM管理了,但是,现在还必须为非操作系统卷来重新启动VXVM,因为还需要处理以下一些步骤。
手工启动VXVM:
# rm /etc/vx/reconfig.d/state.d/install-db
# vxiod set 10
# vxconfigd -m disable
# vxdctl enable
确认以前的卷是可以访问的:
# vxprint -ht
Disk group: rootdg
DG NAME NCONFIG NLOG MINORS GROUP-ID
DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE
RV NAME RLINK_CNT KSTATE STATE PRIMARY DATAVOLS SRL
RL NAME RVG KSTATE STATE REM_HOST REM_DG REM_RLNK
V NAME RVG KSTATE STATE LENGTH READPOL PREFPLEX UTYPE
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
DC NAME PARENTVOL LOGVOL
SP NAME SNAPVOL DCO
dg rootdg default default 0 1035409531.1025.pegasus
dm rootdisk c0t0d0s2 sliced 3359 17690400 -
dm rootmirror c0t1d0s2 sliced 3359 17690400 -
v rootvol - DISABLED ACTIVE 13423200 ROUND - root
pl rootvol-01 rootvol DISABLED ACTIVE 13423200 CONCAT - RW
sd rootdisk-B0 rootvol-01 rootdisk 17690399 1 0 c0t0d0 ENA
sd rootdisk-02 rootvol-01 rootdisk 0 13423199 1 c0t0d0 ENA
pl rootvol-02 rootvol DISABLED ACTIVE 13423200 CONCAT - RW
sd rootmirror-01 rootvol-02 rootmirror 0 13423200 0 c0t1d0 ENA
v swapvol - DISABLED ACTIVE 2096640 ROUND - swap
pl swapvol-01 swapvol DISABLED ACTIVE 2096640 CONCAT - RW
sd rootdisk-01 swapvol-01 rootdisk 13426559 2096640 0 c0t0d0 ENA
pl swapvol-02 swapvol DISABLED ACTIVE 2096640 CONCAT - RW
sd rootmirror-02 swapvol-02 rootmirror 13423200 2096640 0 c0t1d0 ENA
v var - DISABLED ACTIVE 2100000 ROUND - fsgen
pl var-01 var DISABLED ACTIVE 2100000 CONCAT - RW
sd rootdisk-03 var-01 rootdisk 15523199 2100000 0 c0t0d0 ENA
pl var-02 var DISABLED ACTIVE 2100000 CONCAT - RW
sd rootmirror-03 var-02 rootmirror 15519840 2100000 0 c0t1d0 ENA
从VXVM中删除root卷:
# vxedit -rf rm rootvol swapvol var
从VXVM中删除root磁盘:
# vxdg rmdisk rootdisk
最后,恢复c0t0d0原始的vtoc:
/etc/vx/bin/vxedvtoc -f /etc/vx/reconfig.d/disk.d/c0t0d0/vtoc /dev/rdsk/c0t0d0s2
# THE ORIGINAL PARTITIONING IS AS FOLLOWS :
#SLICE TAG FLAGS START SIZE
0 0x2 0x200 0 13423200
1 0x3 0x201 13426560 2096640
2 0x5 0x200 0 17693760
3 0xe 0x201 0 17693760
4 0x7 0x200 15523200 2100000
5 0x0 0x200 0 0
6 0x0 0x200 0 0
7 0xf 0x201 17690400 3360
# THE NEW PARTITIONING WILL BE AS FOLLOWS :
#SLICE TAG FLAGS START SIZE
0 0x2 0x200 0 13423200
1 0x3 0x201 13426560 2096640
2 0x5 0x200 0 17693760
3 0x0 0x200 0 0
4 0x7 0x200 15523200 2100000
5 0x0 0x200 0 0
6 0x0 0x200 0 0
7 0x0 0x200 0 0
DO YOU WANT TO WRITE THIS TO THE DISK ? [Y/N] :y
WRITING THE NEW VTOC TO THE DISK
到这里c0t0d0完全从VXVM管理中释放出来。其他的Veritas volumes 还可以继续使用。
阅读(3027) | 评论(1) | 转发(0) |