存储相关
1. 查看主机阵列上映射的磁盘
# lsscsi
[0:2:0:0] disk DELL PERC H730P Adp 4.30 /dev/sda
[14:0:0:0] cd/dvd HL-DT-ST DVD+-RW GU90N A3C1 /dev/sr0
[16:0:0:0] disk IBM 2145 0000 /dev/sdb
[16:0:0:1] disk IBM 2145 0000 /dev/sdc
[16:0:0:2] disk IBM 2145 0000 /dev/sdd
[16:0:0:3] disk IBM 2145 0000 /dev/sde
[16:0:0:4] disk IBM 2145 0000 /dev/sdf
[16:0:0:5] disk IBM 2145 0000 /dev/sdg
[16:0:0:6] disk IBM 2145 0000 /dev/sdh
[16:0:0:7] disk IBM 2145 0000 /dev/sdi
[16:0:1:0] disk IBM 2145 0000 /dev/sdj
[16:0:1:1] disk IBM 2145 0000 /dev/sdk
[16:0:1:2] disk IBM 2145 0000 /dev/sdl
[16:0:1:3] disk IBM 2145 0000 /dev/sdm
[16:0:1:4] disk IBM 2145 0000 /dev/sdn
[16:0:1:5] disk IBM 2145 0000 /dev/sdo
[16:0:1:6] disk IBM 2145 0000 /dev/sdp
[16:0:1:7] disk IBM 2145 0000 /dev/sdq
在阵列映射关系上查看“主机LUN ID”,主机LUN ID(上面第一列的数据)和主机上看到LUN ID是一一对应的。
2. 查看磁盘挂载及分区使用情况
# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/centos-root xfs 50G 21G 30G 42% /
devtmpfs devtmpfs 16G 0 16G 0% /dev
tmpfs tmpfs 16G 12M 16G 1% /dev/shm
tmpfs tmpfs 16G 20M 16G 1% /run
tmpfs tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sda2 xfs 1014M 180M 835M 18% /boot
/dev/mapper/centos-u01 xfs 300G 9.0G 291G 3% /u01
/dev/mapper/centos-home xfs 100G 4.4G 96G 5% /home
tmpfs tmpfs 3.1G 12K 3.1G 1% /run/user/42
tmpfs tmpfs 3.1G 40K 3.1G 1% /run/user/0
tmpfs tmpfs 3.1G 0 3.1G 0% /run/user/1101
3. 服务器安装的硬盘状态(包括格式化和未格式化)
# fdisk –l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/sda: 3999.7 GB, 3999688294400 bytes, 7811891200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
Disk identifier: 78E31235-5ECC-432D-B8B3-9A04CCCAE4E1
# Start End Size Type Name
1 2048 4095 1M BIOS boot
2 4096 2101247 1G Microsoft basic
3 2101248 7811889151 3.7T Linux LVM
Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/centos-swap: 16.6 GB, 16642998272 bytes, 32505856 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sdb: 536.9 GB, 536870912000 bytes, 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sdc: 1102.7 GB, 1102732853248 bytes, 2153775104 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sdd: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sde: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
......
4. 给磁盘添加新分区
4. 测试服务器磁盘的读写速度
# hdparm -tT /dev/sdb
/dev/sdb:
Timing cached reads: 14942 MB in 2.00 seconds = 7479.77 MB/sec
Timing buffered disk reads: 164 MB in 31.87 seconds = 5.15 MB/sec
# time dd if=/dev/sdb of=test.dbf bs=8k count=150000
150000+0 records in
150000+0 records out
1228800000 bytes (1.2 GB) copied, 66.7371 s, 18.4 MB/s
【持续维护…】