前文介绍了使用mdadm命令穿件软RAID0的过程,本章将继续演示RAID1和RAID5的创建过程。
在演示具体的创建过程之前,需要进一步介绍madam命令可用的选项:
-f:把某设备指定为模拟损坏
-r:把损坏的设备移除
-a:新增一个设备到阵列中
一、创建一个大小为1G的RAID1:
对RAID1来说,其利用率只有50%,故要使RAID1的有效空间为1G,就需要两个1G的分区,其创建过程如下:
[[email protected] backup]# fdisk/dev/sdc
WARNING: DOS-compatible mode is deprecated. It‘s stronglyrecommended to switch offthe 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): 2 # 第二块分区 First cylinder (655-1305, default 655): Using default value 655 Last cylinder, +cylinders or +size{K,M,G} (655-1305, default1305): +1G # 大小为1G Command (m for help): t # 调整分区 Partition number (1-4): 2 # 调整第二块分区 Hex code (type L to list codes): fd # 调整id为fd Changed system type of partition 2 to fd (Linux raidautodetect) Command (m for help): p # 查看当前设备分区信息 Disk /dev/sdc: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 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: 0xb8ee6343 Device Boot Start End Blocks Id System /dev/sdc1 1 654 5253223+ fd Linux raid autodetect /dev/sdc2 655 786 1060290 fd Linux raid autodetect
创建第二块磁盘分区的过程和上述过程一样,不加赘述。
[[email protected] backup]# partx-a /dev/sdc
BLKPG: Device or resource busy error adding partition 1
[[email protected] backup]# partx-a /dev/sdc2 /dev/sdc
[[email protected] backup]# partx-a /dev/sdd
BLKPG: Device or resource busy error adding partition 1
[[email protected] backup]# partx-a /dev/sdd2 /dev/sdd
# 将新建的两块分区同步到分区表中
[[email protected] backup]# cat/proc/partitions
major minor #blocks name 8 0 26214400 sda 8 1 512000 sda1 8 2 25701376 sda2 8 16 99614720 sdb 8 19 10490413 sdb3 8 20 1 sdb4 8 21 5253223 sdb5 8 22 1060258 sdb6 8 32 10485760 sdc 8 33 5253223 sdc1 8 34 1060290 sdc2 8 48 10485760 sdd 8 49 5253223 sdd1 8 50 1060290 sdd2 # 已经能看到两个新的分区了 253 0 23633920 dm-0 253 1 2064384 dm-1 9 0 10506240 md0
[[email protected] backup]# mdadm-C /dev/md1 -a yes -l 1 -n 2 /dev/sd{c,d}2
# 将两个新分区创建为RAID1 mdadm: Note: this array has metadata at the start and may not besuitable as a boot device. If you planto store ‘/boot‘ onthis device please ensure that your boot-loaderunderstands md/v1.x metadata, or use --metadata=0.90 Continue creating array? Y # 这是个警告信息,即当前创建的RAID1设备不适合挂载到/boot上,由于不打算挂载到/boot上,故忽略 mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md1 started.
RAID1需要保证镜像完全同步,要监控这两个阵列是否完全同步,可以查看/proc/mdstat。
[[email protected] backup]# cat/proc/mdstat
Personalities : [raid0] [raid1] md1 : active raid1 sdd2[1] sdc2[0] 1059200 blockssuper 1.2 [2/2] [UU] [========>............] resync = 43.3% (458944/1059200) finish=0.7minspeed=13907K/sec # 目前同步了43.3% md0 : active raid0 sdd1[1] sdc1[0] 10506240 blockssuper 1.2 512k chunks unused devices: <none>
使用cat命令只能查看一次,要保持实时监控,可以使用另一个命令watch和选项-n,其中-n选项可以用来指定每隔几秒钟执行一次,其格式如下:
watch-n # ‘COMMAND’
故可以使用watch来不断刷新执行cat /proc/mdstat:
[[email protected] backup]# watch-n 1 ‘cat /proc/mdstat‘
Every 1.0s: cat /proc/mdstat TueAug 12 20:05:38 2014 Personalities : [raid0] [raid1] md1 : active raid1 sdd2[1] sdc2[0] 1059200 blockssuper 1.2 [2/2] [UU] md0 : active raid0 sdd1[1] sdc1[0] 10506240 blockssuper 1.2 512k chunks unused devices: <none>
使用Ctrl+C,可以退出watch命令。
现在来格式化md1这个设备:
[[email protected] backup]# mke2fs-t ext4 /dev/md1 -L MD1
# 可以为/dev/md1指定卷标MD1 mke2fs 1.41.12 (17-May-2010) Filesystem label=MD1 OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 66240 inodes, 264800 blocks 13240 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=272629760 9 block groups 32768 blocks per group, 32768 fragments per group 7360 inodes per group Superblock backups stored on blocks: 32768, 98304,163840, 229376 Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information:done This filesystem will be automatically checked every 24mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
[[email protected] backup]# mount/dev/md1 /mnt
# 挂载到/mnt下
[[email protected] backup]# df -lh
Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup-lv_root 23G 4.6G 17G 22% / tmpfs 499M 72K 499M 1% /dev/shm /dev/sda1 485M 35M 426M 8% /boot /dev/sdb3 9.9G 36M 9.7G 1% /mydata /dev/md0 9.9G 151M 9.3G 2% /backup /dev/md1 1019M 34M 934M 4% /mnt # 使用df -lh命令,可以看到/dev/md1这个设备,其有效利用率为1G左右
[[email protected] backup]# mdadm-D /dev/md1
# 还可以使用mdadm -D来查看具体的设备信息 /dev/md1: Version : 1.2 Creation Time : TueAug 12 19:54:19 2014 Raid Level :raid1 Array Size :1059200 (1034.55 MiB 1084.62 MB) Used Dev Size :1059200 (1034.55 MiB 1084.62 MB) Raid Devices : 2 Total Devices : 2 Persistence :Superblock is persistent Update Time : TueAug 12 20:09:20 2014 State :clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Name :localhost.localdomain:1 (local to hostlocalhost.localdomain) UUID :e54d628e:ef3d2e61:0a06110b:56c15012 Events : 17 Number Major Minor RaidDevice State 0 8 34 0 active sync /dev/sdc2 1 8 50 1 active sync /dev/sdd2
二、验证RAID1的冗余能力
由于RAID1具有冗余能力,所以即使其中一块盘坏了,设备仍然可以工作,现在演示一下一块盘坏了的情况:
[[email protected] backup]# cd/mnt
[[email protected] mnt]# ls
lost+found
[[email protected] mnt]# cp/etc/inittab ./
# 复制一个文件到设备/dev/md1上
[[email protected] mnt]# pwd
/mnt
[[email protected] mnt]# mount
/dev/mapper/VolGroup-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,rootcontext="system_u:object_r:tmpfs_t:s0") /dev/sda1 on /boot type ext4 (rw) /dev/sdb3 on /mydata type ext4 (rw,noatime) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) /dev/md0 on /backup type ext4 (rw) /dev/md1 on /mnt type ext4 (rw)
[[email protected] mnt]# cd
[[email protected] ~]# mdadm/dev/md1 -f /dev/sdc2
mdadm: set /dev/sdc2 faulty in /dev/md1 # 使用-f选项模拟md1中一块磁盘损坏的情况
[[email protected] ~]# mdadm -D/dev/md1
/dev/md1: Version : 1.2 Creation Time : TueAug 12 19:54:19 2014 Raid Level :raid1 Array Size :1059200 (1034.55 MiB 1084.62 MB) Used Dev Size :1059200 (1034.55 MiB 1084.62 MB) Raid Devices : 2 Total Devices : 2 Persistence :Superblock is persistent Update Time : TueAug 12 20:18:49 2014 State :clean, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 1 Spare Devices : 0 Name :localhost.localdomain:1 (local to hostlocalhost.localdomain) UUID : e54d628e:ef3d2e61:0a06110b:56c15012 Events : 19 Number Major Minor RaidDevice State 0 0 0 0 removed 1 8 50 1 active sync /dev/sdd2 0 8 34 - faulty /dev/sdc2 #/dev/sdc2已经损坏了
[[email protected] ~]# cd /mnt
[[email protected] mnt]# ls
inittab lost+found
[[email protected] mnt]# catinittab
# inittab is only used by upstartfor the default runlevel. # # ADDING OTHER CONFIGURATION HEREWILL HAVE NO EFFECT ON YOUR SYSTEM. # # System initialization isstarted by /etc/init/rcS.conf # # Individual runlevels arestarted by /etc/init/rc.conf # # Ctrl-Alt-Delete is handled by/etc/init/control-alt-delete.conf # # Terminal gettys are handled by/etc/init/tty.conf and /etc/init/serial.conf, # with configuration in/etc/sysconfig/init. # # For information on how to writeupstart event handlers, or how # upstart works, see init(5),init(8), and initctl(8). # # Default runlevel. The runlevelsused are: # 0 - halt (Do NOT set initdefault to this) # 1 - Single user mode # 2 - Multiuser, without NFS (The same as 3,if you do not have networking) # 3 - Full multiuser mode # 4 - unused # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) # id:5:initdefault: #即使/dev/sdc2已经损坏了,访问/mnt下的文件,仍然没有任何问题
[[email protected] mnt]# cp/etc/fstab ./
# 再复制一个文件到/mnt下
[[email protected] mnt]# cat fstab
# # /etc/fstab # Created by anaconda on WedJul 9 21:21:40 2014 # # Accessible filesystems, byreference, are maintained under ‘/dev/disk‘ # See man pages fstab(5),findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/VolGroup-lv_root/ ext4 defaults 1 1 UUID=d9512fb3-8dd6-4613-ae55-8e99ba0ef627/boot ext4 defaults 1 2 /dev/mapper/VolGroup-lv_swapswap swap defaults 0 0 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/sdb3 /mydata ext4 defaults,noatime 0 0 LABEL="NEWSWAP" swap swap defaults 0 0 #查看新复制的fstab也没有问题,说明/dev/md1读写都可以正常进行
[[email protected] mnt]# mdadm/dev/md1 -r /dev/sdc2
mdadm: hot removed /dev/sdc2 from/dev/md1 #移除/dev/sdc2这个设备
[[email protected] mnt]# mdadm -D/dev/md1
/dev/md1: Version : 1.2 Creation Time : Tue Aug 12 19:54:19 2014 Raid Level : raid1 Array Size : 1059200 (1034.55 MiB 1084.62MB) Used Dev Size : 1059200 (1034.55 MiB 1084.62 MB) Raid Devices : 2 Total Devices : 1 Persistence : Superblock is persistent Update Time : Tue Aug 12 20:26:48 2014 State : clean, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 0 Spare Devices : 0 Name : localhost.localdomain:1 (local to host localhost.localdomain) UUID : e54d628e:ef3d2e61:0a06110b:56c15012 Events : 40 Number Major Minor RaidDevice State 0 0 0 0 removed 1 8 50 1 active sync /dev/sdd2 #可以看到/dev/sdc2已经被移除了
[[email protected] mnt]# ls
fstab inittab lost+found
[[email protected] mnt]# cat fstab
# # /etc/fstab # Created by anaconda on WedJul 9 21:21:40 2014 # # Accessible filesystems, byreference, are maintained under ‘/dev/disk‘ # See man pages fstab(5),findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/VolGroup-lv_root/ ext4 defaults 1 1 UUID=d9512fb3-8dd6-4613-ae55-8e99ba0ef627/boot ext4 defaults 1 2 /dev/mapper/VolGroup-lv_swapswap swap defaults 0 0 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/sdb3 /mydata ext4 defaults,noatime 0 0 LABEL="NEWSWAP" swap swap defaults 0 0 #即使/dev/sdc2已经被移除了,/dev/md1仍然可以正常使用
如果现在又将/dev/sdc2修复了,可以使用-a选项将其加回到阵列中:
[[email protected] mnt]# mdadm/dev/md1 -a /dev/sdc2
mdadm: added /dev/sdc2 #将/dev/sdc2加回来,不一定非要是/dev/sdc2,也可以是其他的盘
[[email protected] mnt]# mdadm -D/dev/md1
/dev/md1: Version : 1.2 Creation Time : Tue Aug 12 19:54:19 2014 Raid Level : raid1 Array Size : 1059200 (1034.55 MiB 1084.62MB) Used Dev Size : 1059200 (1034.55 MiB 1084.62 MB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Update Time : Tue Aug 12 20:31:15 2014 State : clean, degraded, recovering Active Devices : 1 Working Devices : 2 Failed Devices : 0 Spare Devices : 1 Rebuild Status : 13% complete # /dev/sdc2已经加回来了,但是需要和/dev/sdd2进行同步 Name : localhost.localdomain:1 (local to host localhost.localdomain) UUID :e54d628e:ef3d2e61:0a06110b:56c15012 Events : 50 Number Major Minor RaidDevice State 2 8 34 0 spare rebuilding /dev/sdc2 1 8 50 1 active sync /dev/sdd2
[[email protected] mnt]# watch -n1 ‘cat /proc/mdstat‘
# 使用watch命令查看同步过程 Every 1.0s: cat /proc/mdstat TueAug 12 20:32:02 2014 Personalities : [raid0] [raid1] md1 : active raid1 sdc2[2]sdd2[1] 1059200 blocks super 1.2 [2/1] [_U] [===============>.....] recovery = 75.4% (799424/1059200) finish=0.2min speed=14604K/sec # 正在同步的信息 md0 : active raid0 sdd1[1]sdc1[0] 10506240 blocks super 1.2 512k chunks unused devices: <none>
现在将/dev/sdd2损坏掉,以查看/dev/md1是否还能正常使用:
[[email protected] ~]# mdadm/dev/md1 -f /dev/sdd2
mdadm: set /dev/sdd2 faulty in/dev/md1 # /dev/sdd2被损坏了
[[email protected] ~]# mdadm -D/dev/md1
/dev/md1: Version : 1.2 Creation Time : Tue Aug 12 19:54:19 2014 Raid Level : raid1 Array Size : 1059200 (1034.55 MiB 1084.62MB) Used Dev Size : 1059200 (1034.55 MiB 1084.62 MB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Update Time : Tue Aug 12 20:39:54 2014 State : clean, degraded # 注意,这里显示该整列被降级了,说明它不再具有冗余能力了,只是一块单个硬盘 Active Devices : 1 Working Devices : 1 Failed Devices : 1 Spare Devices : 0 Name : localhost.localdomain:1 (local to host localhost.localdomain) UUID :e54d628e:ef3d2e61:0a06110b:56c15012 Events : 93 Number Major Minor RaidDevice State 2 8 34 0 active sync /dev/sdc2 1 0 0 1 removed 1 8 50 - faulty /dev/sdd2
[[email protected] ~]# cat/mnt/fstab
# # /etc/fstab # Created by anaconda on WedJul 9 21:21:40 2014 # # Accessible filesystems, byreference, are maintained under ‘/dev/disk‘ # See man pages fstab(5), findfs(8),mount(8) and/or blkid(8) for more info # /dev/mapper/VolGroup-lv_root/ ext4 defaults 1 1 UUID=d9512fb3-8dd6-4613-ae55-8e99ba0ef627/boot ext4 defaults 1 2 /dev/mapper/VolGroup-lv_swap swap swap defaults 0 0 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/sdb3 /mydata ext4 defaults,noatime 0 0 LABEL="NEWSWAP" swap swap defaults 0 0 # /dev/md1设备依然可以正常工作
通过上述过程的演示,可以看出RAID1的优势——冗余。
现在想停止/dev/md1,可以使用-S选项:
[[email protected] ~]# umount /mnt
# 注意,需要先卸载设备,才可以停用
[[email protected] ~]# mdadm -S/dev/md1
mdadm: stopped /dev/md1
[[email protected] ~]# cat/proc/mdstat
Personalities : [raid0] [raid1] md0 : active raid0 sdd1[1] sdc1[0] 10506240 blockssuper 1.2 512k chunks # md1已经被停用了 unused devices: <none>
三、使用备盘
由于RAID1可以有备盘,所以可以创建三个分区,将其中的一个分区作为热备盘使用。为了演示热备盘的使用过程,可以在/dev/sdb上创建一个新分区/dev/sdb7,并将其信息同步到内核中,过程和之前一样,不加赘述:
[[email protected] ~]# cat/proc/partitions
major minor #blocks name 8 0 26214400 sda 8 1 512000 sda1 8 2 25701376 sda2 8 16 99614720 sdb 8 19 10490413 sdb3 8 20 1 sdb4 8 21 5253223 sdb5 8 22 1060258 sdb6 8 23 1060258 sdb7 # 现在已经有三个分区可供使用了: sdb7, sdc2,sdd2 8 32 10485760 sdc 8 33 5253223 sdc1 8 34 1060290 sdc2 8 48 10485760 sdd 8 49 5253223 sdd1 8 50 1060290 sdd2 253 0 23633920 dm-0 253 1 2064384 dm-1 9 0 10506240 md0 9 1 1059200 md1
创建备盘使用的是-x选项:
[[email protected] ~]# mdadm -C/dev/md1 -a yes -l 1 -n 2 -x 1 /dev/sdb7 /dev/sd{c,d}2
# 这里启用了三块盘,其中一块盘是作为热备盘使用的 mdadm: Note: this array has metadata at the start and may not besuitable as a boot device. If you planto store ‘/boot‘ onthis device please ensure that your boot-loaderunderstands md/v1.x metadata, or use --metadata=0.90 mdadm: /dev/sdc2 appears to be part of a raid array: level=raid1devices=2 ctime=Tue Aug 12 19:54:19 2014 mdadm: /dev/sdd2 appears to be part of a raid array: level=raid1devices=2 ctime=Tue Aug 12 19:54:19 2014 # 提示/dev/sdc2和/dev/sdd2已经被使用了,可以忽略 Continue creating array? y mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md1 started.
[[email protected] ~]# mdadm -D/dev/md1
/dev/md1: Version : 1.2 Creation Time : TueAug 12 21:01:59 2014 Raid Level :raid1 Array Size :1059200 (1034.55 MiB 1084.62 MB) Used Dev Size :1059200 (1034.55 MiB 1084.62 MB) Raid Devices : 2 Total Devices : 3 # 总设备是3个 Persistence :Superblock is persistent Update Time : TueAug 12 21:03:15 2014 State :clean Active Devices : 2 Working Devices : 3 # 能正常工作的设备也是3个 Failed Devices : 0 Spare Devices : 1 Name :localhost.localdomain:1 (local to hostlocalhost.localdomain) UUID :0e046b01:6063e7bb:85755072:109db8d2 Events : 17 Number Major Minor RaidDevice State 0 8 23 0 active sync /dev/sdb7 1 8 34 1 active sync /dev/sdc2 2 8 50 - spare /dev/sdd2 # 这里可以看到三块盘,其中spare盘即为热备盘
[[email protected] ~]# mke2fs -text4 /dev/md1
mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 66240 inodes, 264800 blocks 13240 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=272629760 9 block groups 32768 blocks per group, 32768 fragments per group 7360 inodes per group Superblock backups stored on blocks: 32768, 98304,163840, 229376 Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information:done This filesystem will be automatically checked every 31mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
[[email protected] ~]# mount/dev/md1 /mnt
# 挂载/dev/md1到/mnt下
[[email protected] ~]# cp/etc/fstab /mnt
[[email protected] ~]# cat/mnt/fstab
# 设备/dev/md1可以正常使用了 # # /etc/fstab # Created by anaconda on Wed Jul 9 21:21:40 2014 # # Accessible filesystems, by reference, are maintained under‘/dev/disk‘ # See man pages fstab(5), findfs(8), mount(8) and/orblkid(8) for more info # /dev/mapper/VolGroup-lv_root / ext4 defaults 1 1 UUID=d9512fb3-8dd6-4613-ae55-8e99ba0ef627 /boot ext4 defaults 1 2 /dev/mapper/VolGroup-lv_swap swap swap defaults 0 0 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/sdb3 /mydata ext4 defaults,noatime 0 0 LABEL="NEWSWAP" swap swap defaults 0 0
现在模拟一块磁盘损坏的情况:
[[email protected] ~]# mdadm/dev/md1 -f /dev/sdb7
mdadm: set /dev/sdb7 faulty in /dev/md1 # 让/dev/sdb7模拟损坏
[[email protected] ~]# mdadm -D/dev/md1
/dev/md1: Version : 1.2 Creation Time : TueAug 12 21:01:59 2014 Raid Level :raid1 Array Size :1059200 (1034.55 MiB 1084.62 MB) Used Dev Size :1059200 (1034.55 MiB 1084.62 MB) Raid Devices : 2 Total Devices : 3 # 总设备仍然是三个 Persistence :Superblock is persistent Update Time : TueAug 12 22:16:49 2014 State :clean Active Devices : 2 Working Devices : 2 # 但是能正常工作的只有2个 Failed Devices : 1 Spare Devices : 0 Name :localhost.localdomain:1 (local to hostlocalhost.localdomain) UUID :0e046b01:6063e7bb:85755072:109db8d2 Events : 36 Number Major Minor RaidDevice State 2 8 50 0 active sync /dev/sdd2 1 8 34 1 active sync /dev/sdc2 0 8 23 - faulty /dev/sdb7 # 原来的热备盘/dev/sdd2自动顶上并完成重建
[[email protected] ~]# mdadm/dev/md1 -r /dev/sdb7
mdadm: hot removed /dev/sdb7 from /dev/md1 # 将损坏的设备移除
[[email protected] ~]# mdadm -D/dev/md1
/dev/md1: Version : 1.2 Creation Time : TueAug 12 21:01:59 2014 Raid Level :raid1 Array Size :1059200 (1034.55 MiB 1084.62 MB) Used Dev Size :1059200 (1034.55 MiB 1084.62 MB) Raid Devices : 2 Total Devices : 2 Persistence :Superblock is persistent Update Time : TueAug 12 22:20:45 2014 State :clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Name :localhost.localdomain:1 (local to hostlocalhost.localdomain) UUID :0e046b01:6063e7bb:85755072:109db8d2 Events : 37 Number Major Minor RaidDevice State 2 8 50 0 active sync /dev/sdd2 1 8 34 1 active sync /dev/sdc2
[[email protected] ~]# cat/mnt/fstab
# # /etc/fstab # Created by anaconda on Wed Jul 9 21:21:40 2014 # # Accessible filesystems, by reference, are maintained under‘/dev/disk‘ # See man pages fstab(5), findfs(8), mount(8) and/orblkid(8) for more info # /dev/mapper/VolGroup-lv_root / ext4 defaults 1 1 UUID=d9512fb3-8dd6-4613-ae55-8e99ba0ef627 /boot ext4 defaults 1 2 /dev/mapper/VolGroup-lv_swap swap swap defaults 0 0 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/sdb3 /mydata ext4 defaults,noatime 0 0 LABEL="NEWSWAP" swap swap defaults 0 0 # 移除了一块盘,设备仍然可以正常工作
15.文件系统——软RAID的实现(二)(mdadm,watch, RAID1),布布扣,bubuko.com