Chinaunix首页 | 论坛 | 博客
  • 博客访问: 669755
  • 博文数量: 128
  • 博客积分: 265
  • 博客等级: 二等列兵
  • 技术积分: 1464
  • 用 户 组: 普通用户
  • 注册时间: 2011-09-27 20:44
个人简介

just do it

文章分类

全部博文(128)

文章存档

2023年(1)

2020年(1)

2019年(1)

2018年(3)

2017年(6)

2016年(17)

2015年(16)

2014年(39)

2013年(34)

2012年(10)

分类: 系统运维

2012-07-23 08:40:23

添加阵列:

如果机器支持 hard swap ,直接将第二块硬盘接上去,然后依次执行如下命令,不用重新启动机器。  

第一种方式:

# modunload -i 0  

# drvconfig 

# devlinks  

# disks 

 

第二种方式:

如果新增加了光驱、硬盘、网卡或是更换了显卡、网卡、硬盘等,需要让操作系统重新配置硬件信息。  

#reboot -- -r  

 

命令reboot -- -r用于通知系统重新启动并配置系统的硬件信息。

 

或者在OK模式下boot -r

 

 

bash-3.00# format

Searching for disks...done

 

 

AVAILABLE DISK SELECTIONS:

       0. c0t0d0

          /pci@1f,0/ide@d/dad@0,0

       1. c1t1d0

          /pci@1f,0/pci@5/pci@2/SUNW,isptwo@4/sd@1,0

       2. c1t2d0

          /pci@1f,0/pci@5/pci@2/SUNW,isptwo@4/sd@2,0

Specify disk (enter its number):

 

 

devfsadm:扫描硬件设备驱动并加载

 devfsadm(1M) maintains the /dev namespace. It  replaces  the

previous  suite  of  devfs  administration  tools  including

drvconfig(1M),     disks(1M),     tapes(1M),      ports(1M),

audlinks(1M), and devlinks(1M).

 

The default operation is to attempt to load every driver  in

the  system  and  attach  to  all possible device instances.

Next, devfsadm creates logical links to device nodes in /dev

and /devices and loads the device policy.

 

devfsadmd(1M) is the daemon  version  of  devfsadm(1M).  The

daemon  is  started during system startup and is responsible

for handling both reconfiguration boot processing and updat-

ing /dev and /devices in response to dynamic reconfiguration

event notifications from the kernel.

 

For  compatibility   purposes,   drvconfig(1M),   disks(1M),

tapes(1M),  ports(1M),  audlinks(1M),  and  devlinks(1M) are

implemented as links to devfsadm.

 

In addition to managing /dev, devfsadm  also  maintains  the

path_to_inst(4) database.

 

 

cfgadm:显示配置信息

                 显示系统组件状态

                 测试系统组件

                 更改组件配置

                 显示配置帮助消息

 

 

 

           The cfgadm  command  provides  configuration  administration

     operations on dynamically reconfigurable hardware resources.

     These operations include displaying status, (-l), initiating

     testing,  (-t),  invoking configuration state changes, (-c),

     invoking hardware specific functions,  (-x),  and  obtaining

     configuration  administration help messages (-h). Configura-

     tion administration is performed at attachment points, which

     are  places  where system software supports dynamic reconfi-

     guration of hardware resources during continued operation of

     Solaris.

 

     Configuration administration  makes  a  distinction  between

     hardware  resources  that  are  physically  present  in  the

     machine and hardware resources that are configured and visi-

     ble  to  Solaris. The nature of configuration administration

     functions are hardware specific, and are performed  by  cal-

     ling hardware specific libraries.

 

     Configuration  administration  operates  on  an   attachment

     point.  Hardware  resources located at attachment points can

     or can not be physically replaceable  during  system  opera-

     tion,  but are dynamically reconfigurable by way of the con-

     figuration administration interfaces.

 

     An attachment point defines two unique elements,  which  are

     distinct  from  the hardware resources that exist beyond the

     attachment point. The two elements of  an  attachment  point

     are  a  receptacle  and  an  occupant. Physical insertion or

     removal of hardware resources occurs  at  attachment  points

     and  results  in a receptacle gaining or losing an occupant.

     Configuration administration supports the physical insertion

     and  removal  operations  as  well  as  other  configuration

metadb:数据区,存放服务器磁盘的所有配置信息

 

阵列中有2块磁盘,将其中一块盘分一个大区作为数据盘,对数据盘做镜像

 

c1t9d0(数据盘)

formatc1t9d0分区,本次测验将c1t9d0s5分区为5G空间,将c1t9d0s7分了100m空间作为metadb数据区

 

c1t9d0s5建立文件系统文件:

newfs /dev/rdsk/c1t9d0s5

 

/下建一test目录作为挂载点

mkdir /test

 

 

c1t10d0

partition> p

Current partition table (original):

Total disk cylinders available: 4924 + 2 (reserved cylinders)

 

Part      Tag    Flag     Cylinders        Size            Blocks

  0 unassigned    wu       0               0         (0/0/0)           0

  1 unassigned    wu       0               0         (0/0/0)           0

  2     backup    wm       0 - 4923        8.43GB    (4924/0/0) 17682084

  3 unassigned    wu       0               0         (0/0/0)           0

  4 unassigned    wu       0               0         (0/0/0)           0

  5 unassigned    wm       0 - 2920        5.00GB    (2921/0/0) 10489311

  6 unassigned    wu       0               0         (0/0/0)           0

  7 unassigned    wm    2921 - 2978      101.70MB    (58/0/0)     208278

 

 

对磁盘分区做同步操作

bash-3.00# prtvtoc /dev/rdsk/c1t9d0s5 | fmthard -s - /dev/rdsk/c1t10d0s5

fmthard:  New volume table of contents now in place.

 

创建metadb数据

-a 添加metadb

-f 建立初始化的metadb,若是新建需要-a -f连用

-c 指定创建metadb备份的数目,不指定默认为1

bash-3.00# metadb -a -f -c 3 c1t9d0s7 c1t10d0s7

bash-3.00#

 

 

 

c1t10d0

partition> p

Current partition table (original):

Total disk cylinders available: 4924 + 2 (reserved cylinders)

 

Part      Tag    Flag     Cylinders        Size            Blocks

  0 unassigned    wu       0               0         (0/0/0)           0

  1 unassigned    wu       0               0         (0/0/0)           0

  2     backup    wm       0 - 4923        8.43GB    (4924/0/0) 17682084

  3 unassigned    wu       0               0         (0/0/0)           0

  4 unassigned    wu       0               0         (0/0/0)           0

  5 unassigned    wm       0 - 2920        5.00GB    (2921/0/0) 10489311

  6 unassigned    wu       0               0         (0/0/0)           0

  7 unassigned    wm    2921 - 2978      101.70MB    (58/0/0)     208278

 

 

RAID1

创建分区的镜像和子镜像

创建子镜像d15

bash-3.00# metainit -f d15 1 1 c1t9d0s5

d15: Concat/Stripe is setup

 

建立镜像设备d5并将d15子镜像加入

bash-3.00# metainit d5 -m d15 

d5: Mirror is setup

 

 

bash-3.00# metastat

d5: Mirror

    Submirror 0: d15

      State: Okay        

    Pass: 1

    Read option: roundrobin (default)

    Write option: parallel (default)

    Size: 10489311 blocks (5.0 GB)

 

d15: Submirror of d5

    State: Okay        

    Size: 10489311 blocks (5.0 GB)

    Stripe 0:

        Device     Start Block  Dbase        State Reloc Hot Spare

        c1t9d0s5          0     No            Okay   Yes

 

 

Device Relocation Information:

Device   Reloc  Device ID

c1t9d0   Yes    id1,sd@SFUJITSU_MAG3091L_SUN9.0G00490604____

 

建立子镜像d25

bash-3.00# metainit d25 1 1 c1t10d0s5

d25: Concat/Stripe is setup

bash-3.00#

 

d25加入镜像设备d5

bash-3.00# metattach d5 d25

d5: submirror d25 is attached

bash-3.00# metastat

 

/dev/md目录下会出现dskrdsk目录

bash-3.00# ls /dev/md/dsk

d15  d25  d5

bash-3.00# ls /dev/md/rdsk

d15  d25  d5

 

 

正在进行数据同步:

bash-3.00# metastat

d5: Mirror

    Submirror 0: d15

      State: Okay        

    Submirror 1: d25

      State: Resyncing   

    Resync in progress: 4 % done

    Pass: 1

    Read option: roundrobin (default)

    Write option: parallel (default)

    Size: 10489311 blocks (5.0 GB)

 

d15: Submirror of d5

    State: Okay        

    Size: 10489311 blocks (5.0 GB)

    Stripe 0:

        Device     Start Block  Dbase        State Reloc Hot Spare

        c1t9d0s5          0     No            Okay   Yes

 

 

d25: Submirror of d5

    State: Resyncing   

    Size: 10489311 blocks (5.0 GB)

    Stripe 0:

        Device      Start Block  Dbase        State Reloc Hot Spare

        c1t10d0s5          0     No            Okay   Yes

 

 

Device Relocation Information:

Device    Reloc Device ID

c1t10d0   Yes   id1,sd@SFUJITSU_MAG3091L_SUN9.0G00489986____

c1t9d0    Yes   id1,sd@SFUJITSU_MAG3091L_SUN9.0G00490604____

 

同步完成:

bash-3.00# metastat

d5: Mirror

    Submirror 0: d15

      State: Okay        

    Submirror 1: d25

      State: Okay        

    Pass: 1

    Read option: roundrobin (default)

    Write option: parallel (default)

    Size: 10489311 blocks (5.0 GB)

 

d15: Submirror of d5

    State: Okay        

    Size: 10489311 blocks (5.0 GB)

    Stripe 0:

        Device     Start Block  Dbase        State Reloc Hot Spare

        c1t9d0s5          0     No            Okay   Yes

 

 

d25: Submirror of d5

    State: Okay        

    Size: 10489311 blocks (5.0 GB)

    Stripe 0:

        Device      Start Block  Dbase        State Reloc Hot Spare

        c1t10d0s5          0     No            Okay   Yes

 

 

Device Relocation Information:

Device    Reloc Device ID

c1t10d0   Yes   id1,sd@SFUJITSU_MAG3091L_SUN9.0G00489986____

c1t9d0    Yes   id1,sd@SFUJITSU_MAG3091L_SUN9.0G00490604____

bash-3.00#

 

 

镜像创建成功后,修改vfstab文件实现镜像盘的开机挂载

首先将vfstab文件做备份

vfstab文件:

各项参数意思

#device                     device                    mount           FS          fsck    mount                    mount

#to mount                  to fsck                   point           type         pass    at boot                 options

要挂载的设备文件      要修复的设备文件            挂载点                    文件类型       检测方式   是否开机启动       参数

检测方式:1代表有序的检测,2代表无序的检测

 

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

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

/dev/dsk/c0t0d0s6       /dev/rdsk/c0t0d0s6      /usr    ufs     1       no      -

/dev/dsk/c0t0d0s1       /dev/rdsk/c0t0d0s1      /var    ufs     1       no      -

/dev/dsk/c0t0d0s7       /dev/rdsk/c0t0d0s7      /export/home    ufs     2       yes     -

/dev/dsk/c0t0d0s5       /dev/rdsk/c0t0d0s5      /opt    ufs     2       yes     -

/dev/md/dsk/d5  /dev/md/rdsk/d5 /test   ufs     2       yes     -

 

重启机器检查是否自动挂载

 

 

 

 

 

拆除镜像:

bash-3.00# metadetach d5 d15

d5: submirror d15 is detached

bash-3.00# metadetach d5 d25

metadetach: root: d5: attempt to detach last running submirror

 

bash-3.00# metaclear -r d5 

d5: Mirror is cleared

d25: Concat/Stripe is cleared

bash-3.00# metastat

d15: Concat/Stripe

    Size: 10489311 blocks (5.0 GB)

    Stripe 0:

        Device     Start Block  Dbase   Reloc

        c1t9d0s5          0     No      Yes

 

Device Relocation Information:

Device   Reloc  Device ID

c1t9d0   Yes    id1,sd@SFUJITSU_MAG3091L_SUN9.0G00490604____

bash-3.00# metaclear -r d15

d15: Concat/Stripe is cleared

bash-3.00# metastat

bash-3.00# metastat



raid0制作条带化   X86-solaris

 

 

bash-3.00# metadb -a -f -c 3 c2t0d0s7 c2t1d0s7

bash-3.00# metainit d50 1 2 c2t0d0s5 c2t1d0s5 -i 32k

d50: Concat/Stripe is setup

bash-3.00# metastat -i

d50: Concat/Stripe

    Size: 4186112 blocks (2.0 GB)

    Stripe 0: (interlace: 64 blocks)

        Device     Start Block  Dbase   Reloc

        c2t0d0s5          0     No      Yes

        c2t1d0s5       4096     No      Yes

 

Device Relocation Information:

Device   Reloc  Device ID

c2t0d0   Yes    id1,sd@n6000c29dc9e02cf29e03c9c7dcf180eb

c2t1d0   Yes    id1,sd@n6000c29b7694928dba1cc42db2e62204

bash-3.00#

 

 

串联:

bash-3.00# metainit d50 2 1 c2t0d0s5 1 c2t1d0s5

d50: Concat/Stripe is setup

bash-3.00# metastat

d50: Concat/Stripe

    Size: 4190208 blocks (2.0 GB)

    Stripe 0:

        Device     Start Block  Dbase   Reloc

        c2t0d0s5          0     No      Yes

    Stripe 1:

        Device     Start Block  Dbase   Reloc

        c2t1d0s5       4096     No      Yes

 

Device Relocation Information:

Device   Reloc  Device ID

c2t0d0   Yes    id1,sd@n6000c29dc9e02cf29e03c9c7dcf180eb

c2t1d0   Yes    id1,sd@n6000c29b7694928dba1cc42db2e62204

 

 

RAID5

sol10# metainit d30 -r c2t0d0s5 c2t1d0s5 c2t2d0s5 -i 32k

d30: RAID is setup

sol10# metastat

d30: RAID

    State: Initializing

    Initialization in progress:  8.1% done

    Interlace: 64 blocks

    Size: 4182016 blocks (2.0 GB)

Original device:

    Size: 4184704 blocks (2.0 GB)

        Device     Start Block  Dbase        State Reloc  Hot Spare

        c2t0d0s5       4746        No Initializing   Yes

        c2t1d0s5       4746        No Initializing   Yes

        c2t2d0s5       4746        No Initializing   Yes

 

Device Relocation Information:

Device   Reloc  Device ID

c2t0d0   Yes    id1,sd@n6000c29dc9e02cf29e03c9c7dcf180eb

c2t1d0   Yes    id1,sd@n6000c29b7694928dba1cc42db2e62204

c2t2d0   Yes    id1,sd@n6000c294d46299c18ba8ba9e0c1ebf8a

sol10#   

 

 

 

注意:

每个raid级别的前提,都要建立metadb数据库,对磁盘分区做同步。

 

阅读(1197) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:raid1镜像故障盘更换

给主人留下些什么吧!~~