原因:
有些情况下服务器系统不是自己装的,raid也不是自己配置的,或者当你接收一个岗位,远程登录系统后可能就不知道系统是否有做raid,raid级别?因此在这里博主总结一下Linux下查看软、硬raid信息的方法,分享一下。
软件raid:( 只能通过Linux系统本身来查看)
[root@
test
~]
# cat /proc/mdstat
1 2 3 4 |
Personalities : [raid6] [raid5] [raid4]
md0 : active raid5 sdd1[2] sdc1[1] sdb1[0]
9783296 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]
unused devices: <none> |
通过cat /proc/mdstat信息查看所有运行的RAID阵列的状态,在第一行中首先是MD的设备名md0,active和inactive选项表示阵列是否能读/写,接着是阵列的RAID级别raid5,后面是属于阵列的块设备,方括号[]里的数字表示设备在阵列中的序号,(S)表示其是热备盘,(F)表示这个磁盘是 faulty状态。下一行中首先是阵列的大小,用块数来表示;后面有chunk-size的大小,然后是layout类型,不同RAID级别的 layout类型不同,[3/3] [UUU]表示阵列有3个磁盘并且3个磁盘都是正常运行的,而[2/3]和[_UU] 表示阵列有3个磁盘中2个是正常运行的,下划线对应的那个位置的磁盘是faulty状态的。
[root@
test
~]
# mdadm --detail /dev/md0
/dev/md0:
Version : 0.90
Creation Time : Tue Mar 15 08:17:52 2011
Raid Level : raid5
Array Size : 9783296 (9.33 GiB 10.02 GB)
Used Dev Size : 4891648 (4.67 GiB 5.01 GB)
Raid Devices : 3
Total Devices : 3
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Tue Mar 15 08:20:25 2011
State : clean
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric 校验规则
Chunk Size : 64K
UUID : e0d929d1:69d7aacd:5ffcdf9b:c1aaf02d
Events : 0.2
Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
1 8 33 1 active sync /dev/sdc1
2 8 49 2 active sync /dev/sdd1
引用自: http://ultrasql.blog.51cto.com/9591438/1627755
Linux阵列 RAID详解 可参考 博客:
http://molinux.blog.51cto.com/2536040/516008 (软raid制作并不复杂,这里略过制作过程)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
硬件raid:
2)cat /proc/scsi/scsi
Attached devices:
Host: scsi4 Channel: 00 Id: 00 Lun: 00
Vendor: PLDS Model: DVD+-RW DS-8ABSH Rev: LD51
Type: CD-ROM ANSI SCSI revision: 05
Host: scsi6 Channel: 02 Id: 00 Lun: 00
Vendor: DELL Model: PERC H710P Rev: 3.13
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi6 Channel: 02 Id: 01 Lun: 00
Vendor: DELL Model: PERC H710P Rev: 3.13
Type: Direct-Access
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
df -TH
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda3 ext4 557G 3.6G 525G 1% /
tmpfs tmpfs 34G 0 34G 0% /dev/shm
/dev/sda1 ext4 500M 32M 442M 7% /boot
/dev/sdb1 ext4 1.8T 24G 1.7T 2% /usr/local
fdisk -l
Disk /dev/sda: 599.6 GB, 599550590976 bytes
255 heads, 63 sectors/track, 72891 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: 0x0006d30c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 4144 32768000 82 Linux swap / Solaris
/dev/sda3 4144 72892 552217600 83 Linux
Disk /dev/sdb: 1798.7 GB, 1798651772928 bytes
255 heads, 63 sectors/track, 218673 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: 0x00088b5e
Device Boot Start End Blocks Id System
/dev/sdb1 1 218674 1756494848 83 Linux
注意:可以通过fdisk -l和df -TH查看你个人磁盘信息,结合上面命令确定raid信息,这里给大家可以猜猜我给服务器做的raid几,还能看到什么raid信息?
本文出自 “任志远@IT笔记” 博客,谢绝转载!