zoukankan      html  css  js  c++  java
  • linux磁盘阵列raid1的搭建教程

    骤1:添加两块大小相同 的磁盘

    查看磁盘是否添加成功:lsblk

    查看磁盘是否为raid格式

    步骤2:/dev/sdb创建分区并且修改分区类型为raid fd

    [root@localhost ~]# fdisk /dev/sdb
    Welcome to fdisk (util-linux 2.23.2).

    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.

    Device does not contain a recognized partition table
    Building a new DOS disklabel with disk identifier 0x001b1421.

    Command (m for help): p

    Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x001b1421

    Device Boot Start End Blocks Id System

    Command (m for help):
    Command (m for help): n
    Partition type:
    p primary (0 primary, 0 extended, 4 free)
    e extended
    Select (default p): p
    Partition number (1-4, default 1):
    First sector (2048-41943039, default 2048):
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039):
    Using default value 41943039
    Partition 1 of type Linux and of size 20 GiB is set

    Command (m for help): p

    Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x001b1421

    Device Boot Start End Blocks Id System
    /dev/sdb1 2048 41943039 20970496 83 Linux

    Command (m for help): t
    Selected partition 1
    Hex code (type L to list all codes): fd
    Changed type of partition 'Linux' to 'Linux raid autodetect'

    Command (m for help): p

    Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x001b1421

    Device Boot Start End Blocks Id System
    /dev/sdb1 2048 41943039 20970496 fd Linux raid autodetect

    (2)/dev/sdc的创建分区并且修改分区类型为raid fd的步骤跟上面一样

    (3)分区后查看结果:检查分区是否为raid类型

     步骤3:创建raid1:mdadm -C -v /dev/md1 -l 1 -n 2 /dev/sd[b-c]1

    查看raid1的详细信息

    步骤4:格式化并挂载设备

    步骤5:设置开机自动挂载

    步骤6:生成raid的配置文件

    步骤7:测试:创建一个test.txt的文件

    模拟坏掉一块盘mdadm /dev/md1 -f /dev/sdc1

     

    查看详细信息并查看test.txt文件

    出现如图所示表明raid1已经创建成功了

      

  • 相关阅读:
    windows10 新安装后输入法输入后显示?:(这是在officediary新建节点时遇到的问题)
    windows分区尽量使用工具
    powershell 中文系统默认UTF-16 (LE) UNICODE编码 使用时需小心
    oracle 登录下载JDK7 账号密码共享
    Weblogic 免密码登录-调试Weblogic时idea bug 输入username回车后跳过密码输入
    mac 10.14.4 gdb安装 tips
    通过 ffmpeg 下载 m3u8 等视频流并转为 mp4 格式
    正则表达式[]、和B的区别
    Mac OS X 制作 ubuntu 安装启动盘
    Fedora 12 源-fedora.repo
  • 原文地址:https://www.cnblogs.com/liuhui-xzz/p/9655158.html
Copyright © 2011-2022 走看看