本人刚学会的,就在一台机器上试验了一把,把步骤贴出来,与大家共享,如果有不足的地方,希望能够提出来,其实我是个菜鸟!
注意:用红色标出的是需要输入的命令
Sun Blade 150 (UltraSPARC-IIe 650MHz), No Keyboard
Copyright 1998-2003 Sun Microsystems, Inc. All rights reserved.
OpenBoot 4.10.6, 512 MB memory installed, Serial #69468658.
Ethernet address 0:14:4f:24:1:f2, Host ID: 842401f2.
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@1f,0/ide@d/dad@0,0
1. c0t2d0
/pci@1f,0/ide@d/dad@2,0
Specify disk (enter its number): 0
selecting c0t0d0
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 10280 20.00GB (10281/0/0) 41946480
1 swap wu 10281 - 10795 1.00GB (515/0/0) 2101200
2 backup wm 0 - 38306 74.53GB (38307/0/0) 156292560
3 unassigned wm 10796 - 10896 201.21MB (101/0/0) 412080
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 home wm 10897 - 38002 52.73GB (27106/0/0) 110592480
# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t2d0s2
fmthard: New volume table of contents now in place.
# metadb -a -f -c 3 c0t0d0s3 c0t2d0s3
# metadb
flags first blk block count
a u 16 8192 /dev/dsk/c0t0d0s3
a u 8208 8192 /dev/dsk/c0t0d0s3
a u 16400 8192 /dev/dsk/c0t0d0s3
a u 16 8192 /dev/dsk/c0t2d0s3
a u 8208 8192 /dev/dsk/c0t2d0s3
a u 16400 8192 /dev/dsk/c0t2d0s3
# metainit -f d10 1 1 c0t0d0s0
d10: Concat/Stripe is setup
# metainit -f d20 1 1 c0t2d0s0
d20: Concat/Stripe is setup
# metainit d30 -m d10
d30: Mirror is setup
# metaroot d30
# metainit -f d11 1 1 c0t0d0s1
d11: Concat/Stripe is setup
# metainit -f d21 1 1 c0t2d0s1
d21: Concat/Stripe is setup
# metainit d31 -m d11
d31: Mirror is setup
# metainit -f d17 1 1 c0t0d0s7
d17: Concat/Stripe is setup
# metainit -f d27 1 1 c0t2d0s7
d27: Concat/Stripe is setup
# metainit d37 -m d17
d37: Mirror is setup
# vi /etc/vfstab
这个文件修改之前的样子是 :
/dev/dsk/c0t0d0s1 - - swap - no -
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
/dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /export/home ufs 2 yes -
swap - /tmp tmpfs - yes -
更改为::
/dev/md/dsk/d31 - - swap - no -
/dev/md/dsk/d30 /dev/md/rdsk/d30 / ufs 1 no -
/dev/md/dsk/d37 /dev/md/rdsk/d37 /export/home ufs 2 yes -
swap - /tmp tmpfs - yes -
# lockfs -fa
# reboot
.
.
.
.
.
# metattach d30 d20
d30: submirror d20 is attached
# metattach d31 d21
d31: submirror d21 is attached
# metattach d37 d27
d37: submirror d27 is attached
# metastat
# metastat
d37: Mirror
Submirror 0: d17
State: Okay
Submirror 1: d27
State: Resyncing
Resync in progress: 0 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 110592480 blocks (52 GB)
d17: Submirror of d37
State: Okay
Size: 110592480 blocks (52 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s7 0 No Okay Yes
d27: Submirror of d37
State: Resyncing
Size: 110592480 blocks (52 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t2d0s7 0 No Okay Yes
d31: Mirror
Submirror 0: d11
State: Okay
Submirror 1: d21
State: Resyncing
Resync in progress: 13 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2101200 blocks (1.0 GB)
d11: Submirror of d31
State: Okay
Size: 2101200 blocks (1.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s1 0 No Okay Yes
d21: Submirror of d31
State: Resyncing
Size: 2101200 blocks (1.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t2d0s1 0 No Okay Yes
d30: Mirror
Submirror 0: d10
State: Okay
Submirror 1: d20
State: Resyncing
Resync in progress: 1 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 41946480 blocks (20 GB)
d10: Submirror of d30
State: Okay
Size: 41946480 blocks (20 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s0 0 No Okay Yes
d20: Submirror of d30
State: Resyncing
Size: 41946480 blocks (20 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t2d0s0 0 No Okay Yes
Device Relocation Information:
Device Reloc Device ID
c0t2d0 Yes id1,dad@AST380215A=____________5QZ02LAZ
c0t0d0 Yes id1,dad@AHDS728080PLAT20=______PFD215S6UVJEYN
出去吃个饭 ,估计这个镜像就做得差不多了,用命令查看一下是否做完:
# metastat
d37: Mirror
Submirror 0: d17
State: Okay
Submirror 1: d27
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 110592480 blocks (52 GB)
d17: Submirror of d37
State: Okay
Size: 110592480 blocks (52 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s7 0 No Okay Yes
d27: Submirror of d37
State: Okay
Size: 110592480 blocks (52 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t2d0s7 0 No Okay Yes
d31: Mirror
Submirror 0: d11
State: Okay
Submirror 1: d21
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2101200 blocks (1.0 GB)
d11: Submirror of d31
State: Okay
Size: 2101200 blocks (1.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s1 0 No Okay Yes
d21: Submirror of d31
State: Okay
Size: 2101200 blocks (1.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t2d0s1 0 No Okay Yes
d30: Mirror
Submirror 0: d10
State: Okay
Submirror 1: d20
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 41946480 blocks (20 GB)
d10: Submirror of d30
State: Okay
Size: 41946480 blocks (20 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s0 0 No Okay Yes
d20: Submirror of d30
State: Okay
Size: 41946480 blocks (20 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t2d0s0 0 No Okay Yes
Device Relocation Information:
Device Reloc Device ID
c0t2d0 Yes id1,dad@AST380215A=____________5QZ02LAZ
c0t0d0 Yes id1,dad@AHDS728080PLAT20=______PFD215S6UVJEYN
------系统信息,metastat后,会输出系统信息;
------disksuit为每个硬盘生成的id号,唯一标志一个设备。
# installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t2d0s0
回到ok提示符下(用笔记本,或PC上的终端仿真软件请按Ctrl+Break从solaris操做系统状态可回到ok提示符下,如用sun 工作站或键盘可用stop+A回到OK装态)修改启动值,把被镜像磁盘列入备用启动中:
# Type 'go' to resume
ok
ok
ok
ok
ok printenv
Variable Name Value Default Value
test-args
diag-passes 1 1
pci-probe-list c,8,d,5,13 c,8,d,5,13
local-mac-address? false false
fcode-debug? false false
silent-mode? false false
scsi-initiator-id 7 7
oem-logo No default
oem-logo? false false
oem-banner No default
oem-banner? false false
ansi-terminal? true true
screen-#columns 80 80
screen-#rows 34 34
ttyb-rts-dtr-off false false
ttyb-ignore-cd true true
ttya-rts-dtr-off false false
ttya-ignore-cd true true
ttyb-mode 9600,8,n,1,- 9600,8,n,1,-
ttya-mode 9600,8,n,1,- 9600,8,n,1,-
output-device screen screen
input-device keyboard keyboard
load-base 16384 16384
auto-boot? true true
boot-command boot boot
diag-file
diag-device net net
boot-file
boot-device disk net disk net
use-nvramrc? false false
nvramrc
security-mode none No default
security-password No default
security-#badlogins 0 No default
diag-script none none
diag-level max max
diag-switch? false false
error-reset-recovery boot boot
ok devalias
screen /pci@1f,0/SUNW,m64B@13
net /pci@1f,0/network@c,1
cdrom2 /pci@1f,0/ide@d/cdrom@2,0:f
cdrom1 /pci@1f,0/ide@d/cdrom@1,0:f
cdrom /pci@1f,0/ide@d/cdrom@1,0:f
disk /pci@1f,0/ide@d/disk@0,0
disk3 /pci@1f,0/ide@d/disk@3,0
disk2 /pci@1f,0/ide@d/disk@2,0
disk1 /pci@1f,0/ide@d/disk@1,0
disk0 /pci@1f,0/ide@d/disk@0,0
ide /pci@1f,0/ide@d
floppy /pci@1f,0/isa@7/dma/floppy
ttyb /pci@1f,0/isa@7/serial@0,2e8
ttya /pci@1f,0/isa@7/serial@0,3f8
name aliases
ok setenv boot-device disk disk2boot-device = disk disk2
ok reset-all
Resetting ...
------------------------------- ------------------------------------
类似的帖子很多啊,楼主肯定没有认真看!
1、用SDS作的镜像,不用单独建bootblk。
2、楼主到ok提示符下的方法太野蛮了吧,还是用"shutdown -y -g0 -i0"或者"sync;sync;init 0"比较好些吧,再说了如果只是想改boot-device,在操作系统下用eeprom改也可以啊。
3、metadb大家都习惯建在s7上。
阅读(1586) | 评论(0) | 转发(0) |