I. Business UNIT requirements Description: The company recently came up with a batch of servers for big data service deployments. The Data node server consists of 14 physical disks, 2 of which are 900G disks, and 12 are 4T disks. When the server system is installed, enter the BIOS interface of the system:1) make 2 900G disk RAID1 as System disk , 2) make RAID1 of 2 4T disks and mount them to/data1 and/ Data2 is used as a big data log storage; 3) Additional 10 4T disk in the system installation did not do RAID or partition, plan to log on to the system after the system installation, through the command line directly to the format of the 10 disk, and respectively mounted to/DATA3,/DATA4,/DATA5,/ DATA6,/data7,/data8,/data9,/data10,/DATA11,/DATA12, used as data disk for Big Data service, file format is EXT4, mount with UUID, Mount property is Noatime,nobarrier.
After the server system is installed, log on to the machine, using the "fdisk-l" command, found that in addition to see 4 RAID disks, the remaining 10 physical disks do not see:
[[email protected] ~]# fdisk-l disk/dev/sdb:2001.1 GB, 2001111154688 bytes255 heads, + sectors/track, 243287 Cyli Ndersunits = Cylinders of 16065 * 8225280 bytessector size (logical/physical): bytes/512 bytesi/o Size (minimu M/optimal): bytes/512 bytesdisk identifier:0x0004a319 Device Boot Start End Blocks Id syste M/DEV/SDB1 1 243288 1954208768 Linux disk/dev/sdd:4000.2 GB, 4000225165312 bytes255 heads, 63 Sectors/track, 486333 cylindersunits = cylinders of 16065 * MB = 8225280 bytessector size (logical/physical): Bytes/ BYTESI/O size (minimum/optimal): bytes/512 bytesdisk identifier:0x00000000 disk/dev/sdf:4000.2 GB, 40002251 65312 bytes255 heads, sectors/track, 486333 cylindersunits = cylinders of 16065 * MB = 8225280 bytessector size (logic al/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 bytesdisk identifier:0x00000000 Disk/dev /sde:4000.2 GB, 4000225165312 bytes255 heads, sectors/track, 486333 cylindersunits = cylinders of 16065 * = 8225280 bytessector size (logi cal/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 bytesdisk identifier:0x00000000 disk/de v/sdh:4000.2 GB, 4000225165312 bytes255 heads, sectors/track, 486333 cylindersunits = cylinders of 16065 * 512 = 82252 Bytessector size (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 bytesdisk identif ier:0x00000000 disk/dev/sda:899.5 GB, 899527213056 bytes255 heads, sectors/track, 109361 cylindersunits = cylinders of 16065 * 8225280 = bytessector size (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes /Bytesdisk identifier:0x00026ac4 Device Boot Start End Blocks Id system/dev/sda1 * 1 409600 linuxpartition 1 does not end on cylinder BOUNDARY./DEV/SDA2 52 422 9 33554432 LinuX Swap/solaris/dev/sda3 4229 109362 844479488, Linux disk/dev/sdc:1999.1 GB, 1999114010624 byte s255 heads, sectors/track, 243045 cylindersunits = cylinders of 16065 * = 8225280 bytessector size (logical/physica L): bytes/512 bytesi/o size (minimum/optimal): bytes/512 bytesdisk identifier:0x0006d390 Device Boot Start End Blocks Id system/dev/sdc1 1 243046 1952258048 Linux
At this time, a management maintenance hardware RAID software- megacli , which can be used to understand all the current RAID card information, Includes RAID card model, RAID array type, raid on disk status, and so on. The operation record is as follows:
1) Download and install MEGACLI tool: Https://pan.baidu.com/s/1TAGHjTA19ZR8MGODaqy7Mg extract password: MSBQ download to/usr/loca/src directory [[email Protected] ~]# cd/usr/local/src/[[email protected] src]# lsibm_utl_sraidmr_megacli-8.00.48_linux_32-64.zip[[ Email protected] src]# unzip ibm_utl_sraidmr_megacli-8.00.48_linux_32-64.zip[[email protected] src]# CD Linux/[[email protected] linux]# lslib_utils-1.00-09.noarch.rpm megacli-8.00.48-1.i386.rpm[[email Protected] linux]# RPM-IVH lib_utils-1.00-09.noarch.rpm megacli-8.00.48-1.i386.rpm Description: MegaCli64 is located/opt/after installation megaraid/megacli/megacli64, in this path can run MegaCli64 tool, switch to the other path is not executed, at this time for ease of use, you can consider the/opt/megaraid/megacli/ MEGACLI64 append to the system path variable, or do this as follows (recommended): [[email protected] linux]# ln-s/opt/megaraid/megacli/megacli64/bin/ Megacli64[[email protected] linux]# ln-s/opt/megaraid/megacli/megacli64/sbin/megacli64 2) Use the MegaCli64 command to check the number of disks before doing so. As you can see, there are a total of 14 physical disks [[email protected] linux]# Megacli64-pdlist-aall | Egrep ' Enclosure Device id| Slot Number 'Enclosure device Id:32slot number:0enclosure device id:32slot number:1enclosure device Id:32slot number:2enclosure D Evice id:32slot number:3enclosure device id:32slot number:4enclosure device id:32slot number:5enclosure device Id:3 2Slot number:6enclosure device Id:32slot number:7enclosure device id:32slot number:8enclosure device Id:32slot Numbe R:9enclosure device Id:32slot number:10enclosure device id:32slot number:11enclosure device Id:32slot NUMBER:12ENCL Osure Device id:32slot number:13 then view disk information [[email protected] linux]# megacli64-pdlist-aalladapter #0 Enclosure Dev Ice Id:32slot number:0enclosure position:0device id:0sequence number:2media error Count:0other error count:0predict Ive Failure count:0last predictive Failure Event Seq number:0pd type:sataraw size:3.638 TB [0x1d1c0beb0 sectors]non Co erced size:3.637 TB [0x1d1b0beb0 sectors]coerced size:3.637 TB [0x1d1b00000 sectors]firmware state:online, Spun UpSAS A Ddress (0): 0x500056b3983fbac0connected Port number:0 (path0) Inquiry Data:4837k2dvf7detoshiba mg04aca400ny fk3dfde Capable:not capablefde Enable:DisableSecured:UnsecuredLocked:UnlockedNeeds EKM attention:noforeign state:nonedevice Speed:6.0gb/slink speed:6.0gb/smedia type:hard Disk devicedrive temperature:30c (86.00 F) ............. Enclosure Device id:32slot number:3enclosure position:0device id:3sequence number:2media error Count:0other error Co Unt:0predictive Failure count:0last Predictive Failure Event Seq number:0pd type:sataraw size:3.638 TB [0x1d1c0beb0 S Ectors]non coerced size:3.637 TB [0x1d1b0beb0 sectors]coerced size:3.637 TB [0x1d1b00000 sectors]firmware State:unconfi Gured (good), spun Upsas Address (0): 0x500056b3983fbac3connected Port number:0 (path0) Inquiry Data:4838k1vcf7detos Hiba mg04aca400ny fk3dfde capable:not capablefde Enable:DisableSecured:UnsecuredLocked:Unlocked Needs EKM Attention:noforeign State:nonedevice speed:6.0gb/slink speed:6.0gb/smedia type:hard Disk devicedrive temperature:30c (86.00 F) ..... ............ In the command results message, note the status of Firmware state: If the status is online, the disk has been made into a RAID array, and if the status is unconfigured (good), the disk is not made into a RAID array. But the status OK. The above command shows that the first 2 disks of 4T were made into raid, the remaining 10 4T disks did not raid, and 2 900G disks were made into raid. --------------------------------------------------------------------------------------now, use the MEGACLI tool to separate the 10 4T disks into RA The ID0 is then formatted into EXT4 and mounted using the UUID method. In turn, the 第3-12 block is made into a RAID0 array, wherein:-R0 is made into RAID0 array, [32:2] 32 is enclosure Device id,5 is slot number. WB Direct: Disk write back[[email protected] linux]# Megacli64-cfgldadd-r0[32:2] WB direct-a0[[email protected ] linux]# Megacli64-cfgldadd-r0[32:3] WB direct-a0[[email protected] linux]# Megacli64-cfgldadd-r0[32:4] WB Dire Ct-a0[[email protected] linux]# Megacli64-cfgldadd-r0[32:5] WB direct-a0[[email protected] linux]# Megacli64-cfgldadd-r0[32:6] WB direct-a0[[email protected] linux]# Megacli64-cfgldadd-r0[32:7] WB direct-a0[[email protected] linux]# Megacli64-cfgldadd-r0[32:8] WB direct-a0[[email protected] linux]# M EGACLI64-CFGLDADD-R0[32:9] WB direct-a0[[email protected] linux]# MEGACLI64-CFGLDADD-R0[32:10] WB Direct-a0[[em Ail protected] linux]# megacli64-cfgldadd-r0[32:11] WB direct-a0 then look at the disk again and find that the status of "Firmware state" is online, That is, all the disks are in the RAID array. [[email protected] linux]# Megacli64-pdlist-aall then use "fdisk-l" to discover all the physical disks [[email protected] linux]# Fdisk-l disk/dev/sdb:1993.4 GB, 1993414541312 bytes255 heads, sectors/track, 242352 cylindersunits = cylinders of 16 065 * 8225280 bytessector size (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 Bytesdisk identifier:0x000cd8df Device Boot Start End Blocks Id system/dev/sdb1 1 242353 1946692608 disk/dev/sda:899.5 GB, 899527213056 bytes255 heads, Sectors/track, 109361 cylinder Sunits = Cylinders of 16065 * 8225280 bytessector size (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 Bytesdisk identifier:0x000b231b Device Boot Start End Blocks Id system/dev/sda1 * 1 409600 linuxpartition 1 does not end on cylinder BOUNDARY./DEV/SDA2 52 4229 3 3554432 swap/solaris/dev/sda3 4229 109362 844479488 linux disk/dev/sdc:2006.8 GB, 2006810624000 bytes255 heads, sectors/track, 243980 cylindersunits = cylinders of 16065 * = 8225280 Bytessector siz E (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 bytesdisk identifier:0x000010e5 Device Boot Start End Blocks Id system/dev/sdc1 1 243981 1959774208 Linux disk/dev/sdd:4000.2 GB, 4000225165312 bytes255 heads, sectors/track, 486333 cylindersunits = cylinders of 16065 * 512 = 8225280 Bytessector SIze (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 bytesdisk identifier:0x00000000 disk/dev/sde:4000.2 GB, 4000225165312 bytes255 heads, sectors/track, 486333 cylindersunits = cylinders of 16065 * 51 2 = 8225280 bytessector size (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 bytesDis K identifier:0x00000000 disk/dev/sdf:4000.2 GB, 4000225165312 bytes255 heads, sectors/track, 486333 cylindersunits = Cylinders of 16065 * 8225280 = bytessector size (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 bytesdisk identifier:0x00000000 disk/dev/sdg:4000.2 GB, 4000225165312 bytes255 heads, Sectors/trac K, 486333 cylindersunits = cylinders of 16065 * MB = 8225280 bytessector size (logical/physical): bytes/512 bytesI/ O size (minimum/optimal): bytes/512 bytesdisk identifier:0x00000000 disk/dev/sdh:4000.2 GB, 4000225165312 bytes2 Heads, Sectors/traCK, 486333 cylindersunits = cylinders of 16065 * MB = 8225280 bytessector size (logical/physical): bytes/512 BytesI /o Size (minimum/optimal): bytes/512 bytesdisk identifier:0x00000000 disk/dev/sdi:4000.2 GB, 4000225165312 bytes 255 heads, Sectors/track, 486333 cylindersunits = cylinders of 16065 * = 8225280 bytessector size (logical/physical ): bytes/512 bytesi/o size (minimum/optimal): bytes/512 bytesdisk identifier:0x00000000 disk/dev/sdj:4000. 2 GB, 4000225165312 bytes255 heads, sectors/track, 486333 cylindersunits = cylinders of 16065 * 8225280 Bytessect or size (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 bytesdisk identifier:0x00000 disk/dev/sdk:4000.2 GB, 4000225165312 bytes255 heads, sectors/track, 486333 cylindersunits = cylinders of 16065 * 8225280 bytessector size (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 byte Sdisk identifier:0x00000000 disk/dev/sdl:4000.2 GB, 4000225165312 bytes255 heads, sectors/track, 486333 cylindersunits = cylinders of 16065 * 8225280 bytessector size (logical/physical): bytes/512 bytesi/o size (minimum/optimal): bytes/512 byt Esdisk identifier:0x00000000 disk/dev/sdm:4000.2 GB, 4000225165312 bytes255 heads, sectors/track, 486333 CylindersU NITs = cylinders of 16065 * 8225280 bytessector size (logical/physical): bytes/512 bytesi/o Size (minimum/opti MAL): bytes/512 bytesdisk identifier:0x00000000--------------------------------------------------------------- ------------Format the 10 disks with the following script: [[email protected] ~]# cat disk.list/dev/sdd/dev/sde/dev/sdf/dev/sdg/dev/sdh/ DEV/SDI/DEV/SDJ/DEV/SDK/DEV/SDL/DEV/SDM [[email protected] ~]# cat mkfs.disk.sh#!/bin/bashfor i in ' cat/root/ Disk.list ' do echo ' Y ' | /SBIN/MKFS.EXT4 $i &done [[email protected] ~]# sh-x mkfs.disk.sh then Mount [[email protected] ~]#/bin/mkdir /data{3,4,5,6,7,8,9,10,11,12} Check the UUID of these 10 disks (two ways below) [[email protected] ~]# blkid[[email protected] ~]# ls-l/dev/disk/by-uuid/ [[email protected] ~]# blkid/dev/sda3:uuid= "964bec23-58b4-4a6b-a96f-f2e3222fc096" TYPE= "Ext4"/dev/sdc1:uuid= "9acdef9d-fbe1-4d9f-82ff-9e9920df868e" type= "Ext4"/dev/sdb1:uuid= "696f5971-4c7c-4312-a1c3-a20fc3772299" TYPE= " Ext4 "/dev/sda1:uuid=" ee26ded4-8334-4a0f-84bc-cc97d103714e "type=" Ext4 "/dev/sda2:uuid=" 316cb693-05fe-473d-a2ff-3c3c0e0e6c3d "type=" swap "/dev/sdd:uuid=" f92e73be-526d-4d84-8f5b-95273ebbd352 "TYPE=" Ext4 "/dev/sde:uuid=" 0a6404ea-60dc-4e3e-b542-48a313e149dd "type=" Ext4 "/dev/sdf:uuid=" 05891dd0-256a-4f7f-a2de-f1f858eb2a95 "type=" Ext4 "/dev/sdg:uuid=" 77df1f77-0168-430e-96a3-f2eb44e15242 "TYPE=" Ext4 "/dev/sdh:uuid=" E1f11339-ad68-44a1-a600-066094439ed2 "type=" Ext4 "/dev/sdi:uuid=" 628f1658-d8f9-4573-a124-0712b0c29e90 "type=" Ext4 "/dev/sdj:uuid=" 9ee336b0-3960-4cfd-9cb6-c92535f45ebd "TYPE=" Ext4 "/dev/sdk:uuid=" bb6c1e2d-41b8-407d-b6df-df2e3ffc9c52 "type=" Ext4"/dev/sdl:uuid=" 9ca6aecf-e0f1-4338-a7eb-e8a1d2f3b017 "type=" Ext4 "/dev/sdm:uuid=" A5bf2880-4981-462a-8042-c6e913627c3d "type=" Ext4 "isolate the uuid[[email protected of these 10 disks] ~]# Blkid|tail-10|awk ' { Print $ ' uuid= ' f92e73be-526d-4d84-8f5b-95273ebbd352 "uuid=" 0a6404ea-60dc-4e3e-b542-48a313e149dd "UUID=" 05891dd0-256a-4f7f-a2de-f1f858eb2a95 "uuid=" 77df1f77-0168-430e-96a3-f2eb44e15242 "UUID=" E1f11339-ad68-44a1-a600-066094439ed2 "uuid=" 628f1658-d8f9-4573-a124-0712b0c29e90 "UUID=" 9EE336B0-3960-4CFD-9CB6-C92535F45EBD "uuid=" bb6c1e2d-41b8-407d-b6df-df2e3ffc9c52 "UUID=" 9ca6aecf-e0f1-4338-a7eb-e8a1d2f3b017 "uuid=" a5bf2880-4981-462a-8042-c6e913627c3d "[[email protected] ~]# Blkid|tail-10|awk ' {print $} ' |sed ' s/'//g ' uuid=f92e73be-526d-4d84-8f5b-95273ebbd352uuid= 0a6404ea-60dc-4e3e-b542-48a313e149dduuid=05891dd0-256a-4f7f-a2de-f1f858eb2a95uuid= 77df1f77-0168-430e-96a3-f2eb44e15242uuid=e1f11339-ad68-44a1-a600-066094439ed2uuid= 628f1658-d8f9-4573-a124-0712b0c29e90uuid=9ee336b0-3960-4cfd-9cb6-c92535f45ebduuid=bb6c1e2d-41b8-407d-b6df-df2e3ffc9c52uuid=9ca6aecf-e0f1-4338-a7eb-e8a1d2f3b017uuid= A5bf2880-4981-462a-8042-c6e913627c3d put the UUID of these 10 disks into the/etc/fastab open boot file [[email protected] ~]# cat/root/a.txt/ Data3 ext4 noatime,nobarrier 0 0/data4 ext4 noatime,nobarrier 0 0/data5 Ext4 noatime,nobarrier 0 0/data6 ext4 noatime,nobarrier 0 0/data7 Ext4 noatime,nobarrier 0 0/data8 ext4 noatime,nobarrier 0 0/data9 Ext4 Noatime,nobarrier 0 0/data10 ext4 noatime,nobarrier 0 0/data11 ext4 noatime,n Obarrier 0 0/data12 ext4 noatime,nobarrier 0 0 [[email protected] ~]# Blkid|tail-10|awk ' {p Rint $ ' |sed ' s/"//g ' |paste-/root/a.txt >>/etc/fastabuuid=f92e73be-526d-4d84-8f5b-95273ebbd352/data3 Ext4 Noatime,nobarrier 0 0uuid=0a6404ea-60dc-4e3e-b542-48A313e149dd/data4 ext4 Noatime,nobarrier 0 0uuid=05891dd0-256a-4f7f-a2de-f1f858eb2a95/data5 Ext4 noatime,nobarrier 0 0uuid=77df1f77-0168-430e-96a3-f2eb44e15242/data6 ext4 Noati Me,nobarrier 0 0uuid=e1f11339-ad68-44a1-a600-066094439ed2/data7 ext4 noatime,nobarrier 0 0UUID= 628f1658-d8f9-4573-a124-0712b0c29e90/data8 ext4 Noatime,nobarrier 0 0uuid=9ee336b0-3960-4cfd-9cb6- C92535f45ebd/data9 ext4 Noatime,nobarrier 0 0uuid=bb6c1e2d-41b8-407d-b6df-df2e3ffc9c52/data10 Ext4 noatime,nobarrier 0 0uuid=9ca6aecf-e0f1-4338-a7eb-e8a1d2f3b017/data11 Ext4 Noa Time,nobarrier 0 0uuid=a5bf2880-4981-462a-8042-c6e913627c3d/data12 ext4 noatime,nobarrier 0 0Finally, reboot the server and then reboot to see the 10-block disk mount.
[[email protected] ~]# df-hfilesystem Size used Avail use% mounted On/dev/sda3 793G 3.1G 750G 1%/tm PFS 63G 0 63G 0%/dev/shm/dev/sda1 380M 78M 282M 22%/boot/dev/sdb1 1.8T 68M 1.7T 1%/data1/dev/sdc1 1.8T 68M 1.8T 1%/data2/dev/sdd 3.6T 68M 3.4T 1%/data3/dev/sde 3.6T 68 M 3.4T 1%/data4/dev/sdf 3.6T 68M 3.4T 1%/data5/dev/sdg 3.6T 68M 3.4T 1%/DATA6/DEV/SDH 3.6T 68M 3.4T 1%/data7/dev/sdi 3.6T 68M 3.4T 1%/data8/dev/sdj 3.6T 68M 3.4T 1%/data9/dev/ SDK 3.6T 68M 3.4T 1%/data10/dev/sdl 3.6T 68M 3.4T 1%/data11/dev/sdm 3.6T 68M 3.4T 1% /DATA12 [[email protected] ~]# mount/dev/sda3 on/type ext4 (rw) proc On/proc type proc (rw) sysfs On/sys type SYSF S (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/data1 Type EXT4 (rw)/DEV/SDC1 on/data2 type EXT4 (rw)/DEV/SDD on/data3 type Ext4 (rw,noatime,nobarrier)/dev/sde on/data4 type ext 4 (rw,noatime,nobarrier)/dev/sdf on/data5 type Ext4 (rw,noatime,nobarrier)/DEV/SDG on/data6 type EXT4 (rw,noatime,nobar RieR)/DEV/SDH on/data7 type Ext4 (rw,noatime,nobarrier)/dev/sdi on/data8 type Ext4 (rw,noatime,nobarrier)/dev/sdj On/da TA9 type EXT4 (rw,noatime,nobarrier)/dev/sdk on/data10 type Ext4 (rw,noatime,nobarrier)/dev/sdl on/data11 type EXT4 (rw, Noatime,nobarrier)/dev/sdm on/data12 type Ext4 (rw,noatime,nobarrier) None On/proc/sys/fs/binfmt_misc type Binfmt_misc (rw)
Physical server Linux under soft RAID and UUID mode Mount method--megacli64