首页 > 硬件 > solaris下制作raid1+0,raid5

solaris下制作raid1+0,raid5

2005年2月5日 1,898 views 发表评论 阅读评论

solaris下制作raid1+0

推荐使用Raid 1+0 比Raid0+1更安全。

以下示范如何操作,

***********************RAID 1 *******************************************

root@msl118 # format

Searching for disks…done

 

 

AVAILABLE DISK SELECTIONS:

0. c0t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>

/pci@1c,600000/scsi@2/sd@0,0

1. c0t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>

/pci@1c,600000/scsi@2/sd@1,0

2. c0t2d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>

/pci@1c,600000/scsi@2/sd@2,0

3. c0t3d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>

/pci@1c,600000/scsi@2/sd@3,0

Specify disk (enter its number): ^D

root@msl118 # prtvtoc /dev/rdsk/c0t0d0s2|fmthard -s – /dev/rdsk/c0t1d0s2

fmthard:  New volume table of contents now in place.

root@msl118 # metadb -a -f -c 3 c0t0d0s7 c0t1d0s7

root@msl118 # metadb

flags           first blk       block count

a        u         16              8192            /dev/dsk/c0t0d0s7

a        u         8208            8192            /dev/dsk/c0t0d0s7

a        u         16400           8192            /dev/dsk/c0t0d0s7

a        u         16              8192            /dev/dsk/c0t1d0s7

a        u         8208            8192            /dev/dsk/c0t1d0s7

a        u         16400           8192            /dev/dsk/c0t1d0s7

root@msl118 # metainit -f d11 1 1 c0t0d0s1

d11: Concat/Stripe is setup

root@msl118 # metainit d21 1 1 c0t1d0s1

d21: Concat/Stripe is setup

root@msl118 # metainit d1 -m d11

d1: Mirror is setup

root@msl118 # metaattach d1 d21

-bash: metaattach: command not found

root@msl118 # metattach d1 d21

d1: submirror d21 is attached

root@msl118 # df -k

Filesystem            kbytes    used   avail capacity  Mounted on

/dev/dsk/c0t0d0s0    11094316 5185833 5797540    48%    /

/devices                   0       0       0     0%    /devices

ctfs                       0       0       0     0%    /system/contract

proc                       0       0       0     0%    /proc

mnttab                     0       0       0     0%    /etc/mnttab

swap                 3572448    1024 3571424     1%    /etc/svc/volatile

objfs                      0       0       0     0%    /system/object

fd                         0       0       0     0%    /dev/fd

/dev/dsk/c0t0d0s5    6053358 1184802 4808023    20%    /var

swap                 3571424       0 3571424     0%    /tmp

swap                 3571472      48 3571424     1%    /var/run

/dev/dsk/c0t0d0s6    20395561   20242 20171364     1%    /apps

/dev/dsk/c0t0d0s3    30983686   30745 30643105     1%    /u01

root@msl118 # metainit -f d13 1 1 c0t0d0s3

d13: Concat/Stripe is setup

root@msl118 # metainit d23 1 1 c0t1d0s3

d23: Concat/Stripe is setup

root@msl118 # metainit d3 -m d13

d3: Mirror is setup

root@msl118 # metattach d3 d23

d3: submirror d23 is attached

root@msl118 # metainit -f d15 1 1 c0t0d0s5

d15: Concat/Stripe is setup

root@msl118 # metainit d25 1 1 c0t1d0s5

d25: Concat/Stripe is setup

root@msl118 # metainit d5 -m d15

d5: Mirror is setup

root@msl118 # metattach d5 d25

d5: submirror d25 is attached

root@msl118 # metainit -f d16 c0t0d0s6

metainit: msl118: d16: “c0t0d0s6”: syntax error

 

root@msl118 # metainit -f d16 1 1 c0t0d0s6

d16: Concat/Stripe is setup

root@msl118 # metainit d26 1 1 c0t1d0s6

d26: Concat/Stripe is setup

root@msl118 # metainit d6 -m d16

d6: Mirror is setup

root@msl118 # metattach d6 d26

d6: submirror d26 is attached

root@msl118 # metainit -f d10 c0t0d0s0

metainit: msl118: d10: “c0t0d0s0”: syntax error

 

root@msl118 # metainit -f d10 1 1 c0t0d0s0

d10: Concat/Stripe is setup

root@msl118 # metainit d20 1 1 c0t1d0s0

d20: Concat/Stripe is setup

root@msl118 # metainit d0 -m d10

d0: Mirror is setup

root@msl118 # cat /etc/vfstab

#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/dsk/c0t0d0s1       –       –       swap    –       no      –

/dev/dsk/c0t0d0s0       /dev/rdsk/c0t0d0s0      /       ufs     1       no      logging

/dev/dsk/c0t0d0s5       /dev/rdsk/c0t0d0s5      /var    ufs     1       no      logging

/devices        –       /devices        devfs   –       no      –

ctfs    –       /system/contract        ctfs    –       no      –

objfs   –       /system/object  objfs   –       no      –

swap    –       /tmp    tmpfs   –       yes     –

#

# Spare space

#

/dev/dsk/c0t0d0s6       /dev/rdsk/c0t0d0s6      /apps   ufs     3       yes     –

/dev/dsk/c0t0d0s3       /dev/rdsk/c0t0d0s3      /u01    ufs     3       yes     –

#/dev/dsk/c0t2d0s2      /dev/rdsk/c0t2d0s2      /u02    ufs     3       yes     –

#/dev/dsk/c0t3d0s2      /dev/rdsk/c0t3d0s2      /u03    ufs     3       yes     –

 

root@msl118 # metaroot d0

root@msl118 # cat /etc/vfstab

#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/dsk/c0t0d0s1       –       –       swap    –       no      –

/dev/md/dsk/d0  /dev/md/rdsk/d0 /       ufs     1       no      logging

/dev/dsk/c0t0d0s5       /dev/rdsk/c0t0d0s5      /var    ufs     1       no      logging

/devices        –       /devices        devfs   –       no      –

ctfs    –       /system/contract        ctfs    –       no      –

objfs   –       /system/object  objfs   –       no      –

swap    –       /tmp    tmpfs   –       yes     –

#

# Spare space

#

/dev/dsk/c0t0d0s6       /dev/rdsk/c0t0d0s6      /apps   ufs     3       yes     –

/dev/dsk/c0t0d0s3       /dev/rdsk/c0t0d0s3      /u01    ufs     3       yes     –

#/dev/dsk/c0t2d0s2      /dev/rdsk/c0t2d0s2      /u02    ufs     3       yes     –

#/dev/dsk/c0t3d0s2      /dev/rdsk/c0t3d0s2      /u03    ufs     3       yes     –

 

root@msl118 # cat /etc/system 

*ident  “@(#)system     1.18    97/06/27 SMI” /* SVR4 1.5 */

 

 

set shmsys:shminfo_shmmax=6294967295

set shmsys:shminfo_shmmin=1

set shmsys:shminfo_shmseg=10

set shmsys:shminfo_shmmni=100

set semsys:seminfo_semmns=1000

set semsys:seminfo_semmni=100

set semsys:seminfo_semmsl=250

*set semsys:seminfo_semopm=100

*set semsys:seminfo_semvmx=65536

 

* Begin MDD root info (do not edit)

rootdev:/pseudo/md@0:0,0,blk

* End MDD root info (do not edit)

 

 

root@msl118 # lockfs -fa 

 

root@msl118 # cat /etc/vfstab

#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/dsk/c0t0d0s1       –       –       swap    –       no      –

/dev/md/dsk/d0  /dev/md/rdsk/d0 /       ufs     1       no      logging

/dev/dsk/c0t0d0s5       /dev/rdsk/c0t0d0s5      /var    ufs     1       no      logging

/devices        –       /devices        devfs   –       no      –

ctfs    –       /system/contract        ctfs    –       no      –

objfs   –       /system/object  objfs   –       no      –

swap    –       /tmp    tmpfs   –       yes     –

#

# Spare space

#

/dev/dsk/c0t0d0s6       /dev/rdsk/c0t0d0s6      /apps   ufs     3       yes     –

/dev/dsk/c0t0d0s3       /dev/rdsk/c0t0d0s3      /u01    ufs     3       yes     –

#/dev/dsk/c0t2d0s2      /dev/rdsk/c0t2d0s2      /u02    ufs     3       yes     –

#/dev/dsk/c0t3d0s2      /dev/rdsk/c0t3d0s2      /u03    ufs     3       yes     –

 

root@msl118 # vi /etc/vfstab

#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/dsk/c0t0d0s1       –       –       swap    –       no      –

/dev/md/dsk/d0  /dev/md/rdsk/d0 /       ufs     1       no      logging

/dev/dsk/c0t0d0s5       /dev/rdsk/c0t0d0s5      /var    ufs     1       no

logging

/devices        –       /devices        devfs   –       no      –

ctfs    –       /system/contract        ctfs    –       no      –

objfs   –       /system/object  objfs   –       no      –

swap    –       /tmp    tmpfs   –       yes     –

#

# Spare space

#

/dev/dsk/c0t0d0s6       /dev/rdsk/c0t0d0s6      /apps   ufs     3       yes

/dev/dsk/c0t0d0s3       /dev/rdsk/c0t0d0s3      /u01    ufs     3       yes

#/dev/dsk/c0t2d0s2      /dev/rdsk/c0t2d0s2      /u02    ufs     3       yes

#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/dsk/c0t0d0s1       –       –       swap    –       no      –

/dev/md/dsk/d0  /dev/md/rdsk/d0 /       ufs     1       no      logging

/dev/dsk/c0t0d0s5       /dev/rdsk/c0t0d0s5      /var    ufs     1       no

logging

/devices        –       /devices        devfs   –       no      –

ctfs    –       /system/contract        ctfs    –       no      –

objfs   –       /system/object  objfs   –       no      –

swap    –       /tmp    tmpfs   –       yes     –

#

# Spare space

#

/dev/md/dsk/0s6 /dev/rdsk/c0t0d0s6      /apps   ufs     3       yes     –

“/etc/vfstab” 20 lines, 659 characters

/dev/dsk/c0t0d0s3       /dev/rdsk/c0t0d0s3      /u01    ufs     3       yes

#/dev/dsk/c0t2d0s2      /dev/rdsk/c0t2d0s2      /u02    ufs     3       yes

#/dev/dsk/c0t3d0s2      /dev/rdsk/c0t3d0s2      /u03    ufs     3       yes

/dev/md/dsk/d6  /dev/md/rdsk/d6 /apps   ufs     3       yes     –

/dev/md/dsk/ds3 /dev/rdsk/c0t0d0s3      /u01    ufs     3       yes     –

 

/dev/md/dsk/d0  /dev/md/rdsk/d0 /       ufs     1       no      logging

/dev/md/dsk/ds5 /dev/rdsk/c0t0d0s5      /var    ufs     1       no      logging

 

“/etc/vfstab” 20 lines, 641 characters

root@msl118 # grep swap /etc/vfstab

/dev/dsk/c0t0d0s1       –       –       swap    –       no      –

swap    –       /tmp    tmpfs   –       yes     –

root@msl118 # vi /etc/vfstab

#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/dsk/c0t0d0s1       –       –       swap    –       no      –

/dev/md/dsk/d0  /dev/md/rdsk/d0 /       ufs     1       no      logging

/dev/md/dsk/d5  /dev/md/rdsk/d5 /var    ufs     1       no      logging

/devices        –       /devices        devfs   –       no      –

ctfs    –       /system/contract        ctfs    –       no      –

objfs   –       /system/object  objfs   –       no      –

swap    –       /tmp    tmpfs   –       yes     –

#

# Spare space

#

/dev/md/dsk/d6  /dev/md/rdsk/d6 /apps   ufs     3       yes     –

/dev/md/dsk/d3  /dev/md/rdsk/d3 /u01    ufs     3       yes     –

#/dev/dsk/c0t2d0s2      /dev/rdsk/c0t2d0s2      /u02    ufs     3       yes

#/dev/dsk/c0t3d0s2      /dev/rdsk/c0t3d0s2      /u03    ufs     3       yes

 

#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      –

“/etc/vfstab” 20 lines, 638 characters

root@msl118 # cat /etc/vfstab

#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/d1  –       –       swap    –       no      –

/dev/md/dsk/d0  /dev/md/rdsk/d0 /       ufs     1       no      logging

/dev/md/dsk/d5  /dev/md/rdsk/d5 /var    ufs     1       no      logging

/devices        –       /devices        devfs   –       no      –

ctfs    –       /system/contract        ctfs    –       no      –

objfs   –       /system/object  objfs   –       no      –

swap    –       /tmp    tmpfs   –       yes     –

#

# Spare space

#

/dev/md/dsk/d6  /dev/md/rdsk/d6 /apps   ufs     3       yes     –

/dev/md/dsk/d3  /dev/md/rdsk/d3 /u01    ufs     3       yes     –

#/dev/dsk/c0t2d0s2      /dev/rdsk/c0t2d0s2      /u02    ufs     3       yes     –

#/dev/dsk/c0t3d0s2      /dev/rdsk/c0t3d0s2      /u03    ufs     3       yes     –

 

root@msl118 # metastat     

d0: Mirror

Submirror 0: d10

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 22529664 blocks (10 GB)

 

d10: Submirror of d0

State: Okay

Size: 22529664 blocks (10 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s0          0     No            Okay   Yes

 

 

d6: Mirror

Submirror 0: d16

State: Okay

Submirror 1: d26

State: Resyncing

Resync in progress: 3 % done

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 41416320 blocks (19 GB)

 

d16: Submirror of d6

State: Okay

Size: 41416320 blocks (19 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s6          0     No            Okay   Yes

 

 

d26: Submirror of d6

State: Resyncing

Size: 41416320 blocks (19 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s6          0     No            Okay   Yes

 

 

d5: Mirror

Submirror 0: d15

State: Okay

Submirror 1: d25

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 12292608 blocks (5.9 GB)

 

d15: Submirror of d5

State: Okay

Size: 12292608 blocks (5.9 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s5          0     No            Okay   Yes

 

 

d25: Submirror of d5

State: Okay

Size: 12292608 blocks (5.9 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s5          0     No            Okay   Yes

 

 

d3: Mirror

Submirror 0: d13

State: Okay

Submirror 1: d23

State: Resyncing

Resync in progress: 21 % done

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 62918208 blocks (30 GB)

 

d13: Submirror of d3

State: Okay

Size: 62918208 blocks (30 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s3          0     No            Okay   Yes

 

 

d23: Submirror of d3

State: Resyncing

Size: 62918208 blocks (30 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s3          0     No            Okay   Yes

 

 

d1: Mirror

Submirror 0: d11

State: Okay

Submirror 1: d21

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 4100928 blocks (2.0 GB)

 

d11: Submirror of d1

State: Okay

Size: 4100928 blocks (2.0 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s1          0     No            Okay   Yes

 

 

d21: Submirror of d1

State: Okay

Size: 4100928 blocks (2.0 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s1          0     No            Okay   Yes

 

 

d20: Concat/Stripe

Size: 22529664 blocks (10 GB)

Stripe 0:

Device     Start Block  Dbase   Reloc

c0t1d0s0          0     No      Yes

 

Device Relocation Information:

Device   Reloc  Device ID

c0t1d0   Yes    id1,sd@SFUJITSU_MAT3073N_SUN72G_000515B03CSH____AAN0P5403CSH

c0t0d0   Yes    id1,sd@SFUJITSU_MAW3073NCSUN72G_000726B0MU7H____DAN0P760MU7H

root@msl118 # df -k | grep s6

/dev/dsk/c0t0d0s6    20395561   20242 20171364     1%    /apps

reboot之後才可以做

root@msl118 # metattach d0 d20

metattach: msl118: c0t0d0s0: is mounted on /

 

root@msl118 # sync

root@msl118 # lockfs -fa

root@msl118 # reboot

Jan 27 13:52:39 msl118 reboot: rebooted by root

Jan 27 13:52:39 msl118 syslogd: going down on signal 15

Jan 27 13:52:40 /usr/lib/snmp/snmpdx: received signal 15

Jan 27 13:52:40 rpc.metad: Terminated

syncing file systems… done

rebooting…

……………….

msl118 console login: root

Password:

Last login: Sun Jan 27 12:47:24 on console

Jan 27 14:09:25 msl118 login: ROOT LOGIN /dev/console

this is a private computer facility in MSL.  Access for any reason must be specifically authorized by the owner.

Sourcing //.profile-EIS…..

root@msl118 # pwd

/

root@msl118 # df -k

Filesystem            kbytes    used   avail capacity  Mounted on

/dev/md/dsk/d0       11094316 5185857 5797516    48%    /

/devices                   0       0       0     0%    /devices

ctfs                       0       0       0     0%    /system/contract

proc                       0       0       0     0%    /proc

mnttab                     0       0       0     0%    /etc/mnttab

swap                 3673144    1024 3672120     1%    /etc/svc/volatile

objfs                      0       0       0     0%    /system/object

fd                         0       0       0     0%    /dev/fd

/dev/md/dsk/d5       6053358 1184856 4807969    20%    /var

swap                 3672120       0 3672120     0%    /tmp

swap                 3672168      48 3672120     1%    /var/run

/dev/md/dsk/d3       30983686   30745 30643105     1%    /u01

/dev/md/dsk/d6       20395561   20242 20171364     1%    /apps

root@msl118 # metastat

d0: Mirror

Submirror 0: d10

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 22529664 blocks (10 GB)

 

d10: Submirror of d0

State: Okay

Size: 22529664 blocks (10 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s0          0     No            Okay   Yes

 

 

d5: Mirror

Submirror 0: d15

State: Okay

Submirror 1: d25

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 12292608 blocks (5.9 GB)

 

d15: Submirror of d5

State: Okay

Size: 12292608 blocks (5.9 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s5          0     No            Okay   Yes

 

 

d25: Submirror of d5

State: Okay

Size: 12292608 blocks (5.9 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s5          0     No            Okay   Yes

 

 

d3: Mirror

Submirror 0: d13

State: Okay

Submirror 1: d23

State: Resyncing

Resync in progress: 0 % done

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 62918208 blocks (30 GB)

 

d13: Submirror of d3

State: Okay

Size: 62918208 blocks (30 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s3          0     No            Okay   Yes

 

 

d23: Submirror of d3

State: Resyncing

Size: 62918208 blocks (30 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s3          0     No            Okay   Yes

 

 

d1: Mirror

Submirror 0: d11

State: Okay

Submirror 1: d21

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 4100928 blocks (2.0 GB)

 

d11: Submirror of d1

State: Okay

Size: 4100928 blocks (2.0 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s1          0     No            Okay   Yes

 

 

d21: Submirror of d1

State: Okay

Size: 4100928 blocks (2.0 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s1          0     No            Okay   Yes

 

 

d6: Mirror

Submirror 0: d16

State: Okay

Submirror 1: d26

State: Resyncing

Resync in progress: 0 % done

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 41416320 blocks (19 GB)

 

d16: Submirror of d6

State: Okay

Size: 41416320 blocks (19 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s6          0     No            Okay   Yes

 

 

d26: Submirror of d6

State: Resyncing

Size: 41416320 blocks (19 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s6          0     No            Okay   Yes

 

 

d20: Concat/Stripe

Size: 22529664 blocks (10 GB)

Stripe 0:

Device     Start Block  Dbase   Reloc

c0t1d0s0          0     No      Yes

 

Device Relocation Information:

Device   Reloc  Device ID

c0t1d0   Yes    id1,sd@SFUJITSU_MAT3073N_SUN72G_000515B03CSH____AAN0P5403CSH

c0t0d0   Yes    id1,sd@SFUJITSU_MAW3073NCSUN72G_000726B0MU7H____DAN0P760MU7H

root@msl118 #

root@msl118 #

root@msl118 # fsck -y /var

 

………….

 

 

root@msl118 # metattach d0 d20

d0: submirror d20 is attached

root@msl118 # metastat

d0: Mirror

Submirror 0: d10

State: Okay

Submirror 1: d20

State: Resyncing

Resync in progress: 0 % done

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 22529664 blocks (10 GB)

 

d10: Submirror of d0

State: Okay

Size: 22529664 blocks (10 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s0          0     No            Okay   Yes

 

 

d20: Submirror of d0

State: Resyncing

Size: 22529664 blocks (10 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s0          0     No            Okay   Yes

 

 

d5: Mirror

Submirror 0: d15

State: Okay

Submirror 1: d25

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 12292608 blocks (5.9 GB)

 

d15: Submirror of d5

State: Okay

Size: 12292608 blocks (5.9 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s5          0     No            Okay   Yes

 

 

d25: Submirror of d5

State: Okay

Size: 12292608 blocks (5.9 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s5          0     No            Okay   Yes

 

 

d3: Mirror

Submirror 0: d13

State: Okay

Submirror 1: d23

State: Resyncing

Resync in progress: 37 % done

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 62918208 blocks (30 GB)

 

d13: Submirror of d3

State: Okay

Size: 62918208 blocks (30 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s3          0     No            Okay   Yes

 

 

d23: Submirror of d3

State: Resyncing

Size: 62918208 blocks (30 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s3          0     No            Okay   Yes

 

 

d1: Mirror

Submirror 0: d11

State: Okay

Submirror 1: d21

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 4100928 blocks (2.0 GB)

 

d11: Submirror of d1

State: Okay

Size: 4100928 blocks (2.0 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s1          0     No            Okay   Yes

 

 

d21: Submirror of d1

State: Okay

Size: 4100928 blocks (2.0 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s1          0     No            Okay   Yes

 

 

d6: Mirror

Submirror 0: d16

State: Okay

Submirror 1: d26

State: Resyncing

Resync in progress: 45 % done

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 41416320 blocks (19 GB)

 

d16: Submirror of d6

State: Okay

Size: 41416320 blocks (19 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s6          0     No            Okay   Yes

 

 

d26: Submirror of d6

State: Resyncing

Size: 41416320 blocks (19 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s6          0     No            Okay   Yes

 

 

Device Relocation Information:

Device   Reloc  Device ID

c0t1d0   Yes    id1,sd@SFUJITSU_MAT3073N_SUN72G_000515B03CSH____AAN0P5403CSH

c0t0d0   Yes    id1,sd@SFUJITSU_MAW3073NCSUN72G_000726B0MU7H____DAN0P760MU7H

 

 

root@msl118 # cd /dev/dsk

root@msl118 # ls -l c0t0d0s0

lrwxrwxrwx   1 root     root          43 Mar  9  2005 c0t0d0s0 -> ../../devices/pci@1c,600000/scsi@2/sd@0,0:a

root@msl118 # ls -l c0t1d0s0

lrwxrwxrwx   1 root     root          43 Mar  9  2005 c0t1d0s0 -> ../../devices/pci@1c,600000/scsi@2/sd@1,0:a

 

 

root@msl118 # init 0

{1} ok devalias

xnet2                    /pci@1d,700000/pci@1/SUNW,hme@0,1:dhcp,

xnet1                    /pci@1e,600000/pci@3/SUNW,hme@0,1:dhcp,

xnet                     /pci@1e,600000/pci@2/SUNW,hme@0,1:dhcp,

net3                     /pci@1d,700000/network@2,1

net2                     /pci@1d,700000/network@2

net1                     /pci@1f,700000/network@2,1

net                      /pci@1f,700000/network@2

cdrom                    /pci@1e,600000/ide@d/cdrom@0,0:f

ide                      /pci@1e,600000/ide@d

disk3                    /pci@1c,600000/scsi@2/disk@3,0

disk2                    /pci@1c,600000/scsi@2/disk@2,0

disk1                    /pci@1c,600000/scsi@2/disk@1,0

disk0                    /pci@1c,600000/scsi@2/disk@0,0

disk                     /pci@1c,600000/scsi@2/disk@0,0

scsi                     /pci@1c,600000/scsi@2

sc-control               /pci@1e,600000/isa@7/rmc-comm@0,3e8

ttyb                     /pci@1e,600000/isa@7/serial@0,2e8

ttya                     /pci@1e,600000/isa@7/serial@0,3f8

name                     aliases

 

{1} ok nvalias rootdisk /pci@1c,600000/scsi@2/disk@0,0

{1} ok nvalias mirrdisk /pci@1c,600000/scsi@2/disk@1,0

{1} ok setenv boot-device rootdisk mirrdisk

boot-device =         rootdisk mirrdisk

 

 

 

/*可以不退到ok狀態,使用eeprom完成以上操作,未做測試

eeprom命令:

boot-device=rootdisk mirrdisk

boot-device=rootdisk mirrdisk

use-nvramrc?=true

nvramrc=devalias mirrdisk /pci@8,600000/SUNW,qlc@4/fp@0,0/disk@1,0

devalias rootdisk /pci@8,600000/SUNW,qlc@4/fp@0,0/disk@0,0

*/

 

 

 

 

root@msl118 # prtconf -pv | grep bootpath

bootpath:  ‘/pci@1c,600000/scsi@2/disk@0,0:a’

 

—————————————————-

 

維護測試: pulled a disk out the bay to simulate a disk problem

恢复工作,如下;

ok boot mirrordisk -s

#metadb -d c0t0d0s7

#prtvtoc /dev/rdsk/c0t1d0s2|fmthard –s – /dev/rdsk/c0t0d0s2

#metadb –a –f –c 3 c0t0d0s7

#halt

ok boot mirrordisk

#metareplace -e d0 c0t0d0s0

d0: device c0t0d0s0 is enabled

#metareplace -e d1 c0t0d0s1

d1: device c0t0d0s1 is enabled

#metareplace -e d3 c0t0d0s3

d3: device c0t0d0s3 is enabled

 

#metareplace -e d5 c0t0d0s5

d5: device c0t0d0s5 is enabled

#metareplace -e d6 c0t0d0s6

d6: device c0t0d0s6 is enabled

 

#metastat

 

 

root@msl118 # format

Searching for disks…done

 

 

AVAILABLE DISK SELECTIONS:

  1. c0t0d0 <drive not available>

/pci@1c,600000/scsi@2/sd@0,0

1. c0t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>

/pci@1c,600000/scsi@2/sd@1,0

2. c0t2d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>

/pci@1c,600000/scsi@2/sd@2,0

3. c0t3d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>

/pci@1c,600000/scsi@2/sd@3,

 

root@msl118 # metastat

d0: Mirror

Submirror 0: d10

State: Needs maintenance

Submirror 1: d20

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 22529664 blocks (10 GB)

 

d10: Submirror of d0

State: Needs maintenance

Invoke: metareplace d0 c0t0d0s0 <new device>

Size: 22529664 blocks (10 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s0          0     No     Maintenance   Yes

 

 

d20: Submirror of d0

State: Okay

Size: 22529664 blocks (10 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s0          0     No            Okay   Yes

 

…………………………

手?置入c0t0d0?

自???

root@msl118 # format

Searching for disks…done

 

 

AVAILABLE DISK SELECTIONS:

0. c0t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>

/pci@1c,600000/scsi@2/sd@0,0

1. c0t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>

/pci@1c,600000/scsi@2/sd@1,0

2. c0t2d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>

/pci@1c,600000/scsi@2/sd@2,0

3. c0t3d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>

/pci@1c,600000/scsi@2/sd@3,0

root@msl118 # metastat  | more

d0: Mirror

Submirror 0: d10

State: Needs maintenance

Submirror 1: d20

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 22529664 blocks (10 GB)

 

d10: Submirror of d0

State: Needs maintenance

Invoke: metareplace d0 c0t0d0s0 <new device>

Size: 22529664 blocks (10 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s0          0     No     Maintenance   Yes

 

 

d20: Submirror of d0

State: Okay

Size: 22529664 blocks (10 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s0          0     No            Okay   Yes

 

 

d5: Mirror

Submirror 0: d15

State: Needs maintenance

Submirror 1: d25

State: Okay

Pass: 1

Read option: roundrobin (default)

Write option: parallel (default)

Size: 12292608 blocks (5.9 GB)

 

d15: Submirror of d5

State: Needs maintenance

Invoke: metareplace d5 c0t0d0s5 <new device>

Size: 12292608 blocks (5.9 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t0d0s5          0     No     Maintenance   Yes

 

 

d25: Submirror of d5

State: Okay

Size: 12292608 blocks (5.9 GB)

Stripe 0:

Device     Start Block  Dbase        State Reloc Hot Spare

c0t1d0s5          0     No            Okay   Yes

 

…………

—————————–

root@msl118 # metadb

flags           first blk       block count

Wm  p  l          16              8192            /dev/dsk/c0t0d0s7

W   p  l          8208            8192            /dev/dsk/c0t0d0s7

W   p  l          16400           8192            /dev/dsk/c0t0d0s7

a    p  luo        16              8192            /dev/dsk/c0t1d0s7

a    p  luo        8208            8192            /dev/dsk/c0t1d0s7

a    p  luo        16400           8192            /dev/dsk/c0t1d0s7

 

 

root@msl118 # metadb

flags           first blk       block count

Wm  p  l          16              8192            /dev/dsk/c0t0d0s7

W   p  l          8208            8192            /dev/dsk/c0t0d0s7

W   p  l          16400           8192            /dev/dsk/c0t0d0s7

a    p  luo        16              8192            /dev/dsk/c0t1d0s7

a    p  luo        8208            8192            /dev/dsk/c0t1d0s7

a    p  luo        16400           8192            /dev/dsk/c0t1d0s7

root@msl118 # metadb -d c0t0d0s7

root@msl118 # metadb

flags           first blk       block count

a    p  luo        16              8192            /dev/dsk/c0t1d0s7

a    p  luo        8208            8192            /dev/dsk/c0t1d0s7

a    p  luo        16400           8192            /dev/dsk/c0t1d0s7

root@msl118 # prtvtoc /dev/rdsk/c0t1d0s2 | fmthard -s – /dev/rdsk/c0t0d0s2

fmthard:  New volume table of contents now in place.

root@msl118 # metadb -a -f -c 3 c0t0d0s7

root@msl118 # metadb

flags           first blk       block count

a        u         16              8192            /dev/dsk/c0t0d0s7

a        u         8208            8192            /dev/dsk/c0t0d0s7

a        u         16400           8192            /dev/dsk/c0t0d0s7

a    p  luo        16              8192            /dev/dsk/c0t1d0s7

a    p  luo        8208            8192            /dev/dsk/c0t1d0s7

a    p  luo        16400           8192            /dev/dsk/c0t1d0s7

 

——–

root@msl118 # prtconf -pv | grep bootpath

bootpath:  ‘/pci@1c,600000/scsi@2/disk@0,0:a’

 

 

root@msl118 # metareplace -e d0 c0t0d0s0

d0: device c0t0d0s0 is enabled

root@msl118 # metareplace -e d1 c0t0d0s1   出?

metareplace: msl118: c0t0d0s1: is a dump device

 

root@msl118 # metareplace -e d3 c0t0d0s3

d3: device c0t0d0s3 is enabled

root@msl118 # metareplace -e d5 c0t0d0s5

d5: device c0t0d0s5 is enabled

root@msl118 # metareplace -e d6 c0t0d0s6

d6: device c0t0d0s6 is enabled

 

 

http://forum.java.sun.com/thread.jspa?threadID=5251002

what is output of dumpadm ?

If it’s pointing to c0t0d0s1 , point to some other device as dedicated dump while you work on replacing swap. See the man page for dumpadm Don’t forget to point back to swap device – if that’s how you want it set up – for dedicated dump device

dumpadm -d /dev/md/dsk/d1

*/

root@msl118 # dumpadm

Dump content: kernel pages

Dump device: /dev/dsk/c0t0d0s1 (dedicated)

Savecore directory: /var/crash/msl118

Savecore enabled: yes

 

root@msl118 # dumpadm -d /dev/dsk/c0t1d0s1

dumpadm: /dev/dsk/c0t1d0s1 is part of SVM volume stripe:d21. Please see metaclear(1M).

 

root@msl118 # dumpadm -d /dev/md/dsk/d1  

Dump content: kernel pages

Dump device: /dev/md/dsk/d1 (swap)

Savecore directory: /var/crash/msl118

Savecore enabled: yes

root@msl118 # dumpadm

Dump content: kernel pages

Dump device: /dev/md/dsk/d1 (swap)

Savecore directory: /var/crash/msl118

Savecore enabled: yes

 

root@msl118 # metareplace -e d1 c0t0d0s1

d1: device c0t0d0s1 is enabled

 

 

 

———————————————————————————–

what’s the sc’s user/password???????????/

Invalid login.

Please login:

SC Alert: SC Login Failure for user root.

SC Alert: Failed to send email alert for recent event.

Serial line login timeout, returns to console stream.

Enter #. to return to ALOM.

 

http://docs.sun.com/source/819-7981-11/EventMessage.html

————————————————————————————-

 

 

 

 

***********************************RAID 5********************************************

二、RAID5

#metadb -afc 3 c1t1d0s7

#metainit d55 –r c1t2d0s2 c1t3d0s2 c1t4d0s2 c1t5d0s2

#metastat d55 (?查RAID5的?度)

作完后reboot

#newfs /dev/md/rdsk/d55

#mkdir /raid5

#vi /etc/vfstab

添加一行:

/dev/md/dsk/d55 /dev/md/rdsk/d55 /raid5 ufs 2 yes –

#reboot

 

 

RAID5坏掉的恢复方法:

例c1t4d0?坏掉

ok boot -r

#metareplace –e d55 c1t4d0s2

#metastat d55

 

卸去RAID5的方法:

#umount /raid5

#metaclear d55

#vi /etc/vfstab

注?此行:

#/dev/md/dsk/d55 /dev/md/rdsk/d55 /raid5 ufs 2 yes –

 

 RAID 5 

root@msl117 # metadb -afc 3 c0t0d0s7
root@msl117 # metadb
flags           first blk       block count
a        u         16              8192            /dev/dsk/c0t0d0s7
a        u         8208            8192            /dev/dsk/c0t0d0s7
a        u         16400           8192            /dev/dsk/c0t0d0s7
root@msl117 # metainit d55 -r c0t1d0s2 c0t2d0s2 c0t3d0s2
d55: RAID is setup
root@msl117 # metastat d55
d55: RAID
State: Initializing
Initialization in progress:  0.5% done
Interlace: 32 blocks
Size: 286675536 blocks (136 GB)
Original device:
Size: 286677568 blocks (136 GB)
Device     Start Block  Dbase        State Reloc  Hot Spare
c0t1d0s2       3154        No Initializing   Yes
c0t2d0s2       3154        No Initializing   Yes
c0t3d0s2      10506        No Initializing   Yes

Device Relocation Information:
Device   Reloc  Device ID
c0t1d0   Yes    id1,sd@SSEAGATE_ST373454LC______3KP21M32000076228GGV
c0t2d0   Yes    id1,sd@SSEAGATE_ST373454LC______3KP1A1K8000076095TRK
c0t3d0   Yes    id1,sd@SFUJITSU_MAT3073N_SUN72G_000515B03EM0____AAN0P5403EM0

 

test故障

root@msl117 # root@msl117 # metastat
d55: RAID
State: Needs Maintenance
Invoke: metareplace d55 c0t1d0s2 <new device>
Interlace: 32 blocks
Size: 286675536 blocks (136 GB)
Original device:
Size: 286677568 blocks (136 GB)
Device     Start Block  Dbase        State Reloc  Hot Spare
c0t1d0s2       3154        No  Maintenance   Yes
c0t2d0s2       3154        No         Okay   Yes
c0t3d0s2      10506        No         Okay   Yes

Device Relocation Information:
Device   Reloc  Device ID
c0t1d0   Yes    id1,sd@SSEAGATE_ST373454LC______3KP21M32000076228GGV
c0t2d0   Yes    id1,sd@SSEAGATE_ST373454LC______3KP1A1K8000076095TRK
c0t3d0   Yes    id1,sd@SFUJITSU_MAT3073N_SUN72G_000515B03EM0____AAN0P5403EM0
root@msl117 # cfgadm -al
Ap_Id                          Type         Receptacle   Occupant     Condition
c0                             scsi-bus     connected    configured   unknown
c0::dsk/c0t0d0                 disk         connected    configured   unknown
c0::dsk/c0t1d0                 disk         connected    configured   unknown
c0::dsk/c0t2d0                 disk         connected    configured   unknown
c0::dsk/c0t3d0                 disk         connected    configured   unknown
c1                             scsi-bus     connected    unconfigured unknown
usb0/1                         unknown      empty        unconfigured ok
usb0/2                         unknown      empty        unconfigured ok

更换盘
root@msl117 # Feb 18 02:50:50 msl117 rmclomv: DISK @ HDD1 has been removed.

SC Alert: DISK @ HDD1 has been removed.
Feb 18 02:57:26 msl117 rmclomv: DISK @ HDD1 has been inserted.

SC Alert: DISK @ HDD1 has been inserted.

oot@msl117 # prtvtoc /dev/rdsk/c0t2d0s2 |fmthard -s – /dev/rdsk/c0t1d0s2
fmthard:  New volume table of contents now in place.
root@msl117 # metastat
d55: RAID
State: Needs Maintenance
Invoke: metareplace d55 c0t1d0s2 <new device>
Interlace: 32 blocks
Size: 286675536 blocks (136 GB)
Original device:
Size: 286677568 blocks (136 GB)
Device     Start Block  Dbase        State Reloc  Hot Spare
c0t1d0s2       3154        No  Maintenance   Yes
c0t2d0s2       3154        No         Okay   Yes
c0t3d0s2      10506        No         Okay   Yes

Device Relocation Information:
Device   Reloc  Device ID
c0t1d0   Yes    id1,sd@SSEAGATE_ST373454LC______3KP21M32000076228GGV
c0t2d0   Yes    id1,sd@SSEAGATE_ST373454LC______3KP1A1K8000076095TRK
c0t3d0   Yes    id1,sd@SFUJITSU_MAT3073N_SUN72G_000515B03EM0____AAN0P5403EM0

 

root@msl117 # metareplace -e d55 c0t1d0s2
d55: device c0t1d0s2 is enabled

 

 

root@msl117 # metastat
d55: RAID
State: Resyncing
Resync in progress:  0.8% done
Interlace: 32 blocks
Size: 286675536 blocks (136 GB)
Original device:
Size: 286677568 blocks (136 GB)
Device     Start Block  Dbase        State Reloc  Hot Spare
c0t1d0s2       3154        No    Resyncing   Yes
c0t2d0s2       3154        No         Okay   Yes
c0t3d0s2      10506        No         Okay   Yes

Device Relocation Information:
Device   Reloc  Device ID
c0t1d0   Yes    id1,sd@SSEAGATE_ST373454LC______3KP21M32000076228GGV
c0t2d0   Yes    id1,sd@SSEAGATE_ST373454LC______3KP1A1K8000076095TRK
c0t3d0   Yes    id1,sd@SFUJITSU_MAT3073N_SUN72G_000515B03EM0____AAN0P5403EM0

 

root@msl117 # df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/md/dsk/d55      141104267   65572 139627653     1%    /u02

 

root@msl117 # umount /u02

root@msl117 # df -k

root@msl117 # metaclear d55

root@msl117 # metastat

root@msl117 # vi /etc/vfstab

 

root@msl117 # metadb -d /dev/dsk/c0t0d0s7
metadb: msl117: must have at least 1 database (-f overrides)

root@msl117 # metadb -df /dev/dsk/c0t0d0s7
root@msl117 # Feb 19 18:19:57 msl117 rpc.metad: Terminated

root@msl117 # metadb
root@msl117 # metadb

 

*************************************************************************************

————————————————————————————————–

msl118 …10.86.20.118
d0: Mirror
Submirror 0: d10
State: Needs maintenance
Submirror 1: d20
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 22529664 blocks (10 GB)

d10: Submirror of d0
State: Needs maintenance
Invoke: metareplace d0 c0t0d0s0 <new device>
Size: 22529664 blocks (10 GB)
Stripe 0:
Device     Start Block  Dbase        State Reloc Hot Spare
c0t0d0s0          0     No     Maintenance   Yes
d20: Submirror of d0
State: Okay
Size: 22529664 blocks (10 GB)
Stripe 0:
Device     Start Block  Dbase        State Reloc Hot Spare
c0t1d0s0          0     No

——–

root@msl118 # metareplace -e d0 c0t0d0s0
metareplace: msl118: stale databases

 

reboot — mirrdisk

 

root@msl118 # metareplace -e d0 c0t0d0s0
d0: device c0t0d0s0 is enabled

 

……………

 

……………

{1} ok boot rootdisk

Use is subject to license terms.
WARNING: forceload of misc/md_trans failed
WARNING: forceload of misc/md_raid failed
WARNING: forceload of misc/md_hotspares failed
WARNING: forceload of misc/md_sp failed
Hardware watchdog enabled

。。。。。

bash-2.05# prtconf -pv | grep bootpath
bootpath:  ‘/pci@1c,600000/scsi@2/disk@0,0:a’

 

 

boot mirrdisk

bash-2.05# prtconf -pv | grep bootpath
bootpath:  ‘/pci@1c,600000/scsi@2/disk@1,0:a’

 

 

 » 转载保留版权:老陈 » 《solaris下制作raid1+0,raid5》
 » 如果喜欢可以: 点此订阅本站
分类: 硬件 标签: ,
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.