显示标签为“Solaris”的博文。显示所有博文
显示标签为“Solaris”的博文。显示所有博文

2010年2月2日

Solaris 10 SVM root mirror steps

Environment: solaris 10 with two disks, c1t0d0 and c1t1d0, c1t0d0 is original / file system, c1t0d0 is new attached disk. now we try to make c1t0d0 and c1t1d0 as Raid1 root mirror.

be care that: for SVM volume, there must be a free slice in each disk to contain meta db. in this environment, slice s6 with 170M space is used for this.

1. fdisk new disk c1t0d0 to create solaris patition.

2. copy the original volume table to the second disk:

bash-3.00# prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
fmthard:  New volume table of contents now in place.

3. create meta db for the two disks:
bash-3.00# metadb -af -c 3 /dev/dsk/c1t0d0s6 /dev/dsk/c1t1d0s6

4. create meta devices. Remember at this time, just attach one way mirror, the left half will be attached after rebooting:


bash-3.00# metainit -f d11 1 1 /dev/dsk/c1t0d0s0
d11: Concat/Stripe is setup
bash-3.00# metainit -f d21 1 1 /dev/dsk/c1t1d0s0
d21: Concat/Stripe is setup
bash-3.00# metainit -f d12 1 1 /dev/dsk/c1t0d0s1
d12: Concat/Stripe is setup
bash-3.00# metainit -f d22 1 1 /dev/dsk/c1t1d0s1
d22: Concat/Stripe is setup
bash-3.00# metainit -f d13 1 1 /dev/dsk/c1t0d0s7
d13: Concat/Stripe is setup
bash-3.00# metainit -f d23 1 1 /dev/dsk/c1t1d0s7
d23: Concat/Stripe is setup
bash-3.00# metainit -f d1 -m d11
d1: Mirror is setup
bash-3.00# metainit -f d2 -m d12
d2: Mirror is setup
bash-3.00# metainit -f d3 -m d13
d3: Mirror is setup

5. use metaroot to modify vfstab, also manually modify vfstab to use new created meta devices:


bash-3.00# metaroot d1
bash-3.00# vi /etc/vfstab
"/etc/vfstab" 13 lines, 461 characters
#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
/dev/md/dsk/d2  -       -       swap    -       no      -
/dev/md/dsk/d1  /dev/md/rdsk/d1 /       ufs     1       no      -
/dev/md/dsk/d3  /dev/md/rdsk/d3 /export/home    ufs     2       yes     -
/devices        -       /devices        devfs   -       no      -
sharefs -       /etc/dfs/sharetab       sharefs -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
swap    -       /tmp    tmpfs   -       yes     -
~
"/etc/vfstab" 13 lines, 452 characters

6. lock file system for sync, then reboot:

bash-3.00# lockfs -fa
bash-3.00# init 6

7. after reboot, now we may attach the left half to the mirror. the metattach command may return soon, but the really sync work may take a long time depend on the size of the underlying file system.

bash-3.00# metattach  d1 d21
d1: submirror d21 is attached
bash-3.00# metattach d2 d22
d2: submirror d22 is attached
bash-3.00# metattach d3 d23
d3: submirror d23 is attached
bash-3.00#

8. use “metastat –i” to check each sub mirror sync status until all are stated as “Ok”, such as:

d11: Submirror of d1
    State: Okay

9. install grub boot sector(if in Sparc, use installboot instead):

bash-3.00# installgrub  -fm /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t0d0s0
stage1 written to partition 0 sector 0 (abs 4096)
stage2 written to partition 0, 265 sectors starting at 50 (abs 4146)
stage1 written to master boot sector
bash-3.00#

10. Now you may boot from both hd0 and hd1 to test if the mirror is working well, manually modify the grub menu.lst to use “root (hd0,0,a)” and “root(hd1,0,a)” to test, do not use the “findroot(rootfs0,0,a)” item, since the findroot command need an entry under /boot/grub, we directly define hd0 and hd1 will be more easy to test.

11. in many documents, there is boot-device and altbootpath paramenter needed, they may be define by eeprom command. but in my test, you may switch the boot disk in bios and this is not absolutely needed. if you want this, just check some other doc for this, the command is like following, it’s actually stored at /boot/solaris/bootenv.rc

bash-3.00# eeprom altbootpath=/pci@0,0/pci15ad,1976@10/sd@1,0:a

12. now everything is ok. you may destroy one of your root disk and try to boot from another disk. select in grub list, edit the boot line to set it correct:

root(hd0,0,a)  or

root(hd1,0,a)


Full Text

2009年3月31日

Solaris补丁错误码详解

在安装Solaris补丁的过程中,经常出现一些错误提示。例如:

Installation of 123456-11 failed. Return code 2

通过Return code我们可以知道错误类型。需要注意的是,Return code 2说明此补丁已被安装,Return code 8说明此补丁要修复的软件没有被系统安装。因此,2和8是完全可以被忽略的错误提示。下面的列说明了各个Return code对应的错误类型。

Exit code Meaning

0:没错;

1:使用错误;

2:补丁已经存在;

3:非root权限;

4:存原始文件失败;

5:pkgadd失败;

6:补丁已经作废;

7:非法包路径;

8:试图安装补丁的软件尚未安装;

9:不能使用/usr/sbin/pkgadd;

10:软件错误;

11:错误添加补丁到root模板;

12:通信时补丁脚本终止;

13:补丁目录中有软链接;

14:不可用;

15:前面补丁脚本不对;

16:后面的补丁脚本不对;

17:-d属性不匹配;

18:系统空间不足;

19:$SOFTINFO/INST_RELEASE文件没有找到;

20:一个领导实例的补丁没有找到;

21:需要的补丁没有找到;

22:需要以前的补丁但没有找到;

23:一个受限制的补丁已经在软件中;

24:一个不兼容的补丁正在应用;

25:一个需要的补丁没有找到;

26:备份路径没有找到;

27:关联路径没有找到;

28:文件信息丢失;

29:错误的补丁号码;

30:运行失败;

31:-C属性错误;

32:必须运行Solaris2.6及以后版本;

33:错误的补丁形式或补丁没有找到;

34:需要安装内核的补丁;

35:更高的版本已经安装。


Full Text