Soft raid
Mount/dev/md0/opt
[Email protected] root]# cp/usr/share/doc/raidtools-1.00.3/raid*.conf.*/etc
[Email protected] root]# ls-l/etc/|grep raid
[Email protected] root]# vi/etc/raid0.conf.sample
Mkraid/dev/md0
Mkfs.ext3/dev/md0
Lsraid-a-a/dev/md0
[Email protected] root]# More/proc/mdstat
Please delete the/etc/raidtab file directly when not in use. # Rm/etc/raidtab
Sometimes you want to know that there are a few disks on the server, if you do not do raid, you can simply use the fdisk-l can be seen. But I did raid, so I couldn't see it. So how do I check the raid on the server?
Windows:raid card manufacturers have raid installers and drivers. After the raid is configured, enter the Windows system, download the appropriate RAID installer, and install it. For example, LSI 1064E can be downloaded on the official website. or HD Tune can view basic RAID information
Linux: Sub-soft and hard
Software RAID: Only through the Linux system itself to view the Cat/proc/mdstat, you can see the raid level, status and other information.
Hardware RAID: The best way to do this is through the management tools of the installed RAID vendors, with CmdLine and graphical interfaces. such as the Adaptec company's hardware card can be viewed by the following command:
#/usr/dpt/raidutil-l All can see very detailed information.
Of course, more often than not install the appropriate management tools, only rely on the Linux itself, generally there are two ways:
# DMESG |grep-i raid
# CAT/PROC/SCSI/SCSI
The information displayed is similar to the raid manufacturer, model, level, but cannot view each block of hard disk information.
[Email protected] log]# CAT/PROC/SCSI/SCSI
Attached devices:
Host:scsi6 channel:02 id:00 lun:00
VENDOR:IBM Model:serveraid M1015 rev:2.13
Type:direct-access ANSI SCSI revision:05
Host:scsi7 channel:00 id:00 lun:00
VENDOR:IBM SATA model:device 81y3672 rev:sa81
Type:cd-rom ANSI SCSI revision:00
# fdisk-l
disk/dev/sda:145.9 GB, 145999527936 bytes
255 heads, Sectors/track, 17750 cylinders
Units = Cylinders of 16065 * 8225280 bytes
Device Boot Start End Blocks Id System
/DEV/SDA1 * 1 104391 Linux
/dev/sda2 17750 142472452+ 8e Linux LVM
# CAT/PROC/SCSI/SCSI
Attached devices:
Host:scsi0 channel:00 id:00 lun:00
Vendor:seagate MODEL:ST3146356SS rev:hs09
Type:direct-access ANSI SCSI revision:05
Host:scsi0 channel:00 id:01 lun:00
Vendor:seagate MODEL:ST3146356SS rev:hs09
Type:direct-access ANSI SCSI revision:05
Host:scsi0 channel:01 id:00 lun:00
Vendor:dell model:virtual DISK rev:1028
Type:direct-access ANSI SCSI revision:05
As you can see from the above information, the server has two disks. Brand is Seagate, the disk code is ST3146356SS, if you are familiar with the detailed disk code naming rules, you will easily determine the size of the disk is 146G. According to the results of Fdisk can be determined that the server is to take two 146G hard disk RAID1.
Different file systems (XFS,REISERFS,EXT3) have their own detection and repair tools. Before detection can use the DMESG command to see if there is no hardware I/O failure of the log, if any, first use fsck to see if there is a problem with the file system, if not you can use the following describes the hard disk detection and optimization method to repair it. grep "Error"/va/log/messages*
[Email protected] log]# Rpm-qf/usr/sbin/smartctl
Smartmontools-5.42-2.el6.x86_64
[Email protected] log]# RPM-QL smartmontools
/etc/rc.d/init.d/smartd
/etc/smartd.conf
/etc/sysconfig/smartmontools
/usr/sbin/smartctl
/usr/sbin/smartd
/usr/sbin/update-smart-drivedb
Using smart to detect hard drives
Smart is a disk self-analysis and detection technology, as early as in the late 90, the basic access to each piece of hard disk (including IDE, SCSI), in the run time will be a number of its own parameters recorded, these parameters include model, capacity, temperature, density, sector, seek time, transmission, error rate and so on. After thousands of hours of hard drive operation, a lot of intrinsic physical parameters will change, a certain parameter exceeds the alarm threshold, then the hard disk is close to damage, the hard disk is still working, if the user ignore the alarm continue to use, then the hard disk will become very unreliable, may malfunction at any time.
Enable Smart
Smart is in conjunction with the corresponding function on the motherboard BIOS, to use smart, you must first enter into the motherboard BIOS settings to start the relevant settings. Generally from the Pentium2 level of the motherboard, all support Smart,bios boot, is the operating system level of things (Windows does not have built-in smart related tools, need to install third-party tool software), fortunately, Linux has a very early smart support, If you install Linux on a virtual machine such as VMware, you can see a service start error when the system starts: SMARTD. This server is the Smart daemon process (because the VMware virtual machine's hard drive does not support smart, so it is an error). SMARTD is a daemon (a helper) that monitors hard disks that have self-monitoring, analysis, and reporting techniques (self-monitoring, analytics, and Reporting Technology-smart). The smart system allows the hard drive to monitor and report on its own health. An important feature of this is the ability to predict failure, allowing system administrators to avoid data loss.
Using Badblocks to detect hard drive bad blocks
The Badblocks command can check for damaged chunks in the disk appliance. The instruction must be executed by specifying the disk device to be inspected and the number of disk blocks of the device.
badblocks-s//Show Progress-v//Show execution Details/dev/sda1
# badblocks-s-V/DEV/SDA
Checking for blocks from 0 to 244198583
Checking for Bad blocks (read-only test): ^c0.10% done, 0:04 elapsed
Interrupted at block 272896
$badblocks-s//Show Progress-w//to write to detect-v//display execution Details/dev/sda2
# badblocks-w-s-v/dev/sda1
Checking for bad blocks in read-write mode
From Block 0 to 25607577
Testing with pattern 0xaa: ^c0.73% done, 0:03 elapsed
Note that a mounted hard drive cannot be detected in writing
Using the Hdparm test
Test drive Read and write speed
# HDPARM-TT/DEV/SDA
Linux Tool class HDD detection