创建一个空间大小为10G的raid5,要求其chunk为1024k,格式为ext4文件系统,开机可自动挂载至/backup目录,并支持acl功能;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
[root@mail ~]# fdisk /dev/sdc
 
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').
 
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): +5G
 
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (655-2610, default 655):
Using default value 655
Last cylinder, +cylinders or +size{K,M,G} (655-2610, default 2610): +5G
 
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (1309-2610, default 1309):
Using default value 1309
Last cylinder, +cylinders or +size{K,M,G} (1309-2610, default 2610): +5G
 
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)
 
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): fd
Changed system type of partition 2 to fd (Linux raid autodetect)
 
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): fd
Changed system type of partition 3 to fd (Linux raid autodetect)
 
Command (m for help): w
The partition table has been altered!
 
Calling ioctl() to re-read partition table.
 
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[root@mail ~]# partprobe /dev/sdc
[root@mail ~]# cat /proc/partitions
major minor  #blocks  name
 
   8        0   52428800 sda
   8        1     512000 sda1
   8        2   51915776 sda2
   8       16  524288000 sdb
   8       17  524281243 sdb1
   8       32   20971520 sdc
   8       33    5253223 sdc1
   8       34    5253255 sdc2
   8       35    5253255 sdc3
   8       48   20971520 sdd
   8       49    2104483 sdd1
   8       50    2104515 sdd2
   8       51    2104515 sdd3
  11        0    3763200 sr0
 252        0   47816704 dm-0
 252        1    4096000 dm-1
   9        2    2102400 md2
 
[root@mail ~]# mdadm -C /dev/md5 -a yes -l 5 -n 3 -c 1024 /dev/sdc{1,2,3}
mdadm: /dev/sdc1 appears to be part of a raid array:
       level=raid0 devices=2 ctime=Tue May 10 20:19:43 2016
Continue creating array? yes
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md5 started.
[root@mail ~]# mdadm -D /dev/md5
/dev/md5:
        Version : 1.2
  Creation Time : Wed May 11 09:20:55 2016
     Raid Level : raid5
     Array Size : 10498048 (10.01 GiB 10.75 GB)
  Used Dev Size : 5249024 (5.01 GiB 5.38 GB)
   Raid Devices : 3
  Total Devices : 3
    Persistence : Superblock is persistent
 
    Update Time : Wed May 11 09:21:08 2016
          State : clean, degraded, recovering
 Active Devices : 2
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 1
 
         Layout : left-symmetric
     Chunk Size : 1024K
 
 Rebuild Status : 52% complete
 
           Name : mail.saviorsyang.com:5  (local to host mail.saviorsyang.com)
           UUID : af628086:b4a74844:bd49e03d:5dae3968
         Events : 9
 
    Number   Major   Minor   RaidDevice State
       0       8       33        0      active sync   /dev/sdc1
       1       8       34        1      active sync   /dev/sdc2
       3       8       35        2      spare rebuilding   /dev/sdc3
[root@mail ~]# mdadm -D /dev/md5
/dev/md5:
        Version : 1.2
  Creation Time : Wed May 11 09:20:55 2016
     Raid Level : raid5
     Array Size : 10498048 (10.01 GiB 10.75 GB)
  Used Dev Size : 5249024 (5.01 GiB 5.38 GB)
   Raid Devices : 3
  Total Devices : 3
    Persistence : Superblock is persistent
 
    Update Time : Wed May 11 09:21:22 2016
          State : clean
 Active Devices : 3
Working Devices : 3
 Failed Devices : 0
  Spare Devices : 0
 
         Layout : left-symmetric
     Chunk Size : 1024K
 
           Name : mail.saviorsyang.com:5  (local to host mail.saviorsyang.com)
           UUID : af628086:b4a74844:bd49e03d:5dae3968
         Events : 22
 
    Number   Major   Minor   RaidDevice State
       0       8       33        0      active sync   /dev/sdc1
       1       8       34        1      active sync   /dev/sdc2
       3       8       35        2      active sync   /dev/sdc3
[root@mail ~]# mkdir /backup
[root@mail ~]# mke2fs -t ext4 /dev/md5
mke2fs 1.43-WIP (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=256 blocks, Stripe width=512 blocks
657072 inodes, 2624512 blocks
131225 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2688548864
81 block groups
32768 blocks per group, 32768 fragments per group
8112 inodes per group
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
 
Allocating group tables: done                           
Writing inode tables: done                           
Creating journal (32768 blocks):
done
Writing superblocks and filesystem accounting information: done
 
[root@mail ~]# echo '/dev/md5  /backup  ext4  defaults,acl 1 '  >> /etc/fstab
[root@mail ~]# cat /etc/fstab
 
#
# /etc/fstab
# Created by anaconda on Wed Apr 27 00:43:47 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_demo-lv_root /                       ext4    defaults        1 1
    1 2
  1 4
/dev/mapper/vg_demo-lv_swap swap                    swap    defaults        0 0
/dev/cdrom      /mnt            iso9660 defaults        1 3
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/md5  /backup  ext4  defaults,acl 1
 
[root@mail ~]# mount -a
[root@mail ~]# mount
/dev/mapper/vg_demo-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
/dev/sdb1 on /student type ext4 (rw)
/dev/sr0 on /mnt type iso9660 (ro)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/md2 on /media type ext4 (rw)
/dev/md5 on /backup type ext4 (rw,acl)

linux软raid练习的更多相关文章

  1. 网易视频云技术分享:linux软raid的bitmap分析

    网易视频云是网易倾力打造的一款基于云计算的分布式多媒体处理集群和专业音视频技术,提供稳定流畅.低时延.高并发的视频直播.录制.存储.转码及点播等音视频的PAAS服务,在线教育.远程医疗.娱乐秀场.在线 ...

  2. Linux软raid创建

    RAID: HBA:基于主机的适配器 RAID:Redundent Array of Inexpensive Disks 廉价磁盘阵列 Independent       独立磁盘阵列 Level:仅 ...

  3. linux磁盘管理系列-软RAID的实现

    1 什么是RAID RAID全称是独立磁盘冗余阵列(Redundant Array of Independent Disks),基本思想是把多个磁盘组合起来,组合一个磁盘阵列组,使得性能大幅提高. R ...

  4. linux磁盘管理系列二:软RAID的实现

    磁盘管理系列 linux磁盘管理系列一:磁盘配额管理   http://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_linux_040_quota.html l ...

  5. linux服务器系统盘坏且系统盘为软raid的修复方法

    1 需要换新盘的情况 1.1 一块盘grub损坏修复 一块盘grub损坏修复(可通过另一块盘进入系统的情况).更换硬盘的方式,可以热插拔,也可以服务器断电后更换,但如果是热插拔,可能会导致盘符变更.坏 ...

  6. Linux中的LVM和软RAID

        在实际工作中,会经常碰到所给的服务器硬盘容量太小,而实际的应用软件中却需要一个容量较大的分区进行数据存储等,除了通过硬件RAID卡来实现合并多硬盘外,其实我们也可以通过软件的方式来实现. 实验 ...

  7. LINUX中软RAID的实现方案

    转自linux就该这么学 应用场景 Raid大家都知道是冗余磁盘的意思(Redundant Arrays of Independent Disks,RAID),可以按业务系统的需要提供高可用性和冗余性 ...

  8. Linux 常见 RAID 及软 RAID 创建

    RAID可以大幅度的提高磁盘性能,以及可靠性,这么好的技术怎么能不掌握呢!此篇介绍一些常见RAID,及其在Linux上的软RAID创建方法. mdadm 创建软RAID mdadm -C -v /de ...

  9. Linux下创建软Raid

    1- Linux下创建软Raid   步骤1.创建磁盘,并转换为fd #fdisk /dev/sdb //这里使用新的磁盘sdb 然后输入n ,创建分区 使用默认的起始点 输入大小为+100M 然后重 ...

随机推荐

  1. Ajax读取txt并对txt内容进行分页显示

    function TransferString(content) { var string = content; try{ string=string.replace(/\r\n/g,"&l ...

  2. jQuery初级篇(一)

    知识说明: jQuery库是一个javascript库文件,它比起javascript来,写的更少,但做得更多,下面便对刚开始学习jQuery,一些基础知识整理出来,供后期翻阅. 一.      jQ ...

  3. ueditor工具栏更改按钮的默认操作

    ueditor 上的 image 按钮,默认有一个图片选择工具. 但是我想把他去掉,用上自己写的图片选择功能. 原来使用cleditor 是可以给按钮自定义一个函数.但是在ueditor就没有找到可以 ...

  4. iOS进阶之多线程

    多线程 注意:iOS关于UI的刷新和添加必须在主线程中操作! pthread的创建方法: pthread_t pthread; //第一个参数 线程指针 //第二个参数 线程的一些属性 //第三个参数 ...

  5. display:inline-block 和float:left 的区别

    display:inline-block 和float:left 的区别   display是指显示状态,float是针对块级元素的浮动. 使用inline-block:控制元素的垂直对齐跟横向排列元 ...

  6. .net dataGridView当鼠标经过时当前行背景色变色;然后【给GridView增加单击行事件,并获取单击行的数据填充到页面中的控件中】

    1.首先在前台dataGridview属性中增加onRowDataBound属性事件 2.然后在后台Observing_RowDataBound事件中增加代码 protected void Obser ...

  7. (转)Web性能优化方案

    第一章 打开网站慢现状分析 在公司访问部署在IDC机房的VIP网站时会感觉很慢.是什么原因造成的?为了缩短页面的响应时间,改进我们的用户体验,我们需要知道用户的时间花在等待什么东西上. 可以跟踪一下我 ...

  8. 六大免费网站数据采集器对比(火车头,海纳,云采集,ET,三人行,狂人采集)

    2013年02月27日 PHP开源系统 暂无评论 阅读 497 views 次 在目前的站长圈内,比较流行的采集工具有很多,但是总结起来,比较出名的免费的就这么几个:火车头,海纳,云采集,ET,三人行 ...

  9. MFC对话框显示BMP图片

    1.MFC对话框显示BMP图片我们先从简单的开始吧.先分一个类: (一) 非动态显示图片(即图片先通过资源管理器载入,有一个固定ID) (二) 动态载入图片(即只需要在程序中指定图片的路径即可载入) ...

  10. sass/less/stylus css编译

    早上来了听一同事说stylus如何才能编译成css文件,瞬时间有点蒙,一听感觉和less是差不多的功能,随着就上网去查,然后发现这个文章,介绍了这三种sass/less/stylus的安装和语法,贴在 ...