Chinaunix首页 | 论坛 | 博客
  • 博客访问: 93383
  • 博文数量: 19
  • 博客积分: 2030
  • 博客等级: 大尉
  • 技术积分: 315
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-01 23:40
文章分类

全部博文(19)

文章存档

2009年(19)

我的朋友

分类:

2009-03-28 11:33:40

V880smc新建卷步骤
 
一、    以下是创建Solaris Volume Manager 组件的先决条件:
 
创建初始状态数据库副本。如果尚未执行此操作,找出可供Solaris Volume Manager 使用的片。如有必要,请使用format 命令、fmthard 命令或Solaris Management Console 对现有磁盘重新分区。
 
确保您具有超级用户权限。
 
具有所有数据的最新备份。
 
二、用到的磁盘
 
V880smc中选取c1t2d0和c1t3d0这两磁盘做镜像,分配给/opt目录,应用程序。在v880smc中用AVAILABLE DISK SELECTIONS:
       0. c1t0d0
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf789b07,0
       1. c1t1d0
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf788acc,0
       2. c1t2d0
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf789ae9,0
       3. c1t3d0
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf787f27,0
       4. c1t4d0
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf789b34,0
       5. c1t5d0
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf789a49,0
 
在这6个磁盘有我们使用2和3号磁盘做镜像,这两个磁盘的片结构如下:
2号磁盘c1t2d0:
partition> p
Current partition table (original):
Total disk cylinders available: 24620 + 2 (reserved cylinders)
 
Part      Tag    Flag     Cylinders         Size            Blocks
 0       root    wm       0 -    90      128.37MB    (91/0/0)      262899
 1       swap    wu      91 -   181      128.37MB    (91/0/0)      262899
 2     backup    wu       0 - 24619       33.92GB    (24620/0/0) 71127180
 3 unassigned    wm       0                0         (0/0/0)            0
 4 unassigned    wm       0                0         (0/0/0)            0
 5 unassigned    wm     182 - 24589       33.62GB    (24408/0/0) 70514712
 6        usr    wm   24590 - 24604       21.16MB    (15/0/0)       43335
 7 unassigned    wm   24605 - 24619       21.16MB    (15/0/0)       43335
?        3号磁盘c1t3d0:
partition> p
Current partition table (original):
Total disk cylinders available: 24620 + 2 (reserved cylinders)
 
Part      Tag    Flag     Cylinders         Size            Blocks
 0       root    wm       0 -    90      128.37MB    (91/0/0)      262899
 1       swap    wu      91 -   181      128.37MB    (91/0/0)      262899
 2     backup    wu       0 - 24619       33.92GB    (24620/0/0) 71127180
 3 unassigned    wm       0                0         (0/0/0)            0
 4 unassigned    wm       0                0         (0/0/0)            0
 5 unassigned    wm     182 - 24589       33.62GB    (24408/0/0) 70514712
 6        usr    wm   24590 - 24604       21.16MB    (15/0/0)       43335
 7 unassigned    wm   24605 - 24619       21.16MB    (15/0/0)       43335
 
从上面的信息中我们可以看到c1t2d05 c1t2d0s5的大小为33.62GB 这个和磁盘部大小相差不大,可以选取这两个盘片做镜像就可以了。
 
注:各盘的S6片是为是给metadb加入到状态数据库中使用而预留的磁盘空间。如果将整个磁盘做镜像。最好也是预留一定大小的磁盘空间给状态数据库使用。
 
如果要对磁盘做新的分片操作可以按下面的《磁盘分区操作》部分进行操作。
 
三、 具体操作方法
 
1.   把被镜像盘和镜像盘的各物理分区封装成disksuit能够直接管理的设备metadevice,并给它起一个别名,作为这个物理分区的metadevice name(下例中的d51、d52):
       #metainit -f d25 1 1 c1t2d0s5
       #metainit d35 1 1 c1t3d0s5
 
2.   为每一个需要做镜像的分区起一个镜像名作为最终被系统使用的文件系统名(下例中的d0),并使其指向被镜像分区的metadevice name:
       #metainit d5 -m d25
 
3.   被镜像分区与镜像分区之间进行数据同步,并使该分区的文件系统名同时也指向该分区的镜像分区的metadevice name:
       #metattach d5 d35
 
4.  修改/etc/vfstab文件,使其指向被镜像分区的文件系统名。
$ cat /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/md/dsk/d13 -       -       swap    -       no      -
/dev/md/dsk/d3 /dev/md/rdsk/d3 /       ufs     1       no      logging
#/dev/dsk/c1t0d0s6      /dev/rdsk/c1t0d0s6      /sdsdb ufs     2       yes     -
#/dev/dsk/c1t0d0s7      /dev/rdsk/c1t0d0s7      /vmdb   ufs     2       yes     -
/dev/md/dsk/d5        /dev/md/rdsk/d5        /opt        ufs     1       no      -
swap    -       /tmp    tmpfs   -       yes     -
 
以上是单独作一个分区的镜象的例子。
做完磁盘的镜像操作后,下一步的操作就是对/opt目录文件的迁移工作。
四、 /opt目录备份操作
 
由于要用新建的/dev/md/dsk/d5 挂到/opt下使用,我们在备份的时候就把/opt目录下的所有文件都恢复到/dev/md/dsk/d5挂载的一暂时目录/test下,出到对安全的考量,我们建议再做一份磁带的备份,以防不时之需。
 
操作方法和步骤:
1.ok boot -s
2.# ufsdump 0uf - /opt |(cd /test ; ufsrestore rf - )
3.# vi /etc/vfstab
/dev/md/dsk/d5        /dev/md/rdsk/d5        /opt        ufs     1       no      -
4.# mount /opt
5.# reboot
 
文件目录的复制,这样可以使用COPY过来的文件的属性和原来的是一样的。链接文件也会拷贝过来:
# cd /opt
# find . –print –depth |cpio –pdm /test
如果只是做目录的同步可以按上面的操作进行,只用非根(/)和非/usr目录的情形。
 
五、 磁盘分区操作
 
如果 要对磁盘各片进行大小的调整可以按下面的操作方法进行操作。指定各个磁盘片的大小,如果要使用整个磁盘的话可以将除了片s2之外的所有片的空间都置为0就 可以了。在使用片的时候可以直接使用s2就可以达到使用整个磁盘空间的目的了。不过,建议还是留一部分小的空间用供状态数据库使用。
 
# format
Searching for disks...done
 
AVAILABLE DISK SELECTIONS:
       0. c1t0d0
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf789b07,0
       1. c1t1d0
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf788acc,0
       2. c1t2d0
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf789ae9,0
       3. c1t3d0
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf787f27,0
       4. c1t4d0
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf789b34,0
       5. c1t5d0
          /pci@8,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cf789a49,0
Specify disk (enter its number): 3
selecting c1t3d0
[disk formatted]
 
FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> p
 
PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name  - name the current table
        print - display the current table
        label - write partition map and label to the disk
        ! - execute , then return
        quit
partition> modify
Select partitioning base:
        0. Current partition table (original)
        1. All Free Hog
Choose base (enter number) [0]? 0
 
Part      Tag    Flag     Cylinders         Size            Blocks
 0       root    wm       0 -    90      128.37MB    (91/0/0)      262899
 1       swap    wu      91 -   181      128.37MB    (91/0/0)      262899
 2     backup    wu       0 - 24619       33.92GB    (24620/0/0) 71127180
 3 unassigned    wm       0                0         (0/0/0)            0
 4 unassigned    wm       0                0         (0/0/0)            0
 5 unassigned    wm     182 - 24589       33.62GB    (24408/0/0) 70514712
 6        usr    wm   24590 - 24604       21.16MB    (15/0/0)       43335
 7 unassigned    wm   24605 - 24619       21.16MB    (15/0/0)       43335
 
Do you wish to continue creating a new partition
table based on above table[yes]? yes
Free Hog partition[6]? 6     #注释:从第6个盘片上取空间用于新的盘片
Enter size of partition '0' [262899b, 91c, 128.37mb, 0.13gb]:
Enter size of partition '1' [262899b, 91c, 128.37mb, 0.13gb]:
Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '5' [70514712b, 24408c, 34431.01mb, 33.62gb]:
Enter size of partition '7' [43335b, 15c, 21.16mb, 0.02gb]:
 
Part      Tag    Flag     Cylinders         Size            Blocks
 0       root    wm       0 -    90      128.37MB    (91/0/0)      262899
 1       swap    wu      91 -   181      128.37MB    (91/0/0)      262899
 2     backup    wu       0 - 24619       33.92GB    (24620/0/0) 71127180
 3 unassigned    wm       0                0         (0/0/0)            0
 4 unassigned    wm       0                0         (0/0/0)            0
 5 unassigned    wm     182 - 24589       33.62GB    (24408/0/0) 70514712
 6        usr    wm   24590 - 24604       21.16MB    (15/0/0)       43335
 7 unassigned    wm   24605 - 24619       21.16MB    (15/0/0)       43335
 
Okay to make this the current partition table[yes]? yes
Enter table name (remember quotes): original
 
Ready to label disk, continue? Yes
完成对磁盘的分区操作。

阅读(851) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~