码迷,mamicode.com
首页 > 系统相关 > 详细

Linux RAID 1

时间:2014-08-15 14:48:49      阅读:311      评论:0      收藏:0      [点我收藏+]

标签:linux raid1

磁盘管理RAID1

 

POC环境

linux上添加2块新的30GB硬盘启动

bubuko.com,布布扣

cat /etc/redhat-releasecat

 

Name        : mdadm                        Relocations: (not relocatable)
Version     : 3.2.5                             Vendor: Red Hat, Inc.
Release     : 4.el6                         Build Date: Fri 07 Dec 2012 12:14:45 AM CST
Install Date: Fri 01 Aug 2014 06:07:09 PM CST      Build Host: x86-003.build.bos.redhat.com
Group       : System Environment/Base       Source RPM: mdadm-3.2.5-4.el6.src.rpm
Size        : 860588                           License: GPLv2+
Signature   : RSA/8, Mon 28 Jan 2013 10:48:06 PM CST, Key ID 199e2f91fd431d51
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://www.kernel.org/pub/linux/utils/raid/mdadm/
Summary     : The mdadm program controls Linux md devices (software RAID arrays)
Description :
The mdadm program is used to create, manage, and monitor Linux MD (software
RAID) devices.  As such, it provides similar functionality to the raidtools
package.  However, mdadm is a single program, and it can perform
almost all functions without a configuration file, though a configuration
file can be used to help with some common tasks.

操作

分区

 

 fdisk -l

Disk /dev/sdb: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

 

Disk /dev/sdc: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

 

创建目录,将光盘挂载到目录下,进入sdb硬盘

bubuko.com,布布扣

 

 

 进入硬盘创建sdb1 查看

Fdisk /dev/sdb1

bubuko.com,布布扣

/dev/sdc进行操作

 

fdisk -l /dev/sdc

 

Disk /dev/sdc: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x8f7a12ed

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1        1        3916    31455238+  fd  Linux raid autodetect

 

 

进入挂载目录安装rpm mdadm

cd /mnt/packages

bubuko.com,布布扣

 

 

建立RAID1

使sdb1 sdc1 阵列

mdadm -C /dev/md0 -l 1 -n 2 /dev/sdb1 /dev/sdc1

bubuko.com,布布扣

进入查看是否建立成功

Cat  /proc/mdstart

bubuko.com,布布扣

 

 

 

 

 

 

 创建文件系统

格式化该磁盘阵列

mkfs.ext4 /dev/md0

bubuko.com,布布扣

 

创建目录DATA

Mkdir /mnt/data

bubuko.com,布布扣

md0挂载到data

Mount /dev/md0 /mnt/DATA

 

bubuko.com,布布扣

 

 

 

在文件fatab下追加内容

vi /etc/fstab

/dev/md0         /data         ext4    defaults        0 0

 

bubuko.com,布布扣

写入配置文件

mdadm -Ds >> /etc/mdadm.conf

 bubuko.com,布布扣

 

重新启动

 reboot

Linux RAID 1,布布扣,bubuko.com

Linux RAID 1

标签:linux raid1

原文地址:http://bokelvxing.blog.51cto.com/9275120/1540416

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!