第一步、查看文件系統linux
幾種查看掛載磁盤分區和文件系統類型的方法nginx
1)df-T能夠查看已經掛載的分區和文件系統類型centos
[root@localhost nginx]# df -T Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/mapper/centos-root xfs 28289540 5970724 22318816 22% / devtmpfs devtmpfs 906088 0 906088 0% /dev tmpfs tmpfs 917152 0 917152 0% /dev/shm tmpfs tmpfs 917152 24880 892272 3% /run tmpfs tmpfs 917152 0 917152 0% /sys/fs/cgroup /dev/vda1 xfs 1038336 145756 892580 15% /boot
2) fdisk -l 能夠顯示出全部掛載和未掛載的分區,但不顯示文件系統類型bash
[root@localhost nginx]# fdisk -l Disk /dev/vda: 32.2 GB, 32212254720 bytes, 62914560 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: dos Disk identifier: 0x0009e475 Device Boot Start End Blocks Id System /dev/vda1 * 2048 2099199 1048576 83 Linux /dev/vda2 2099200 62914559 30407680 8e Linux LVM Disk /dev/mapper/centos-root: 29.0 GB, 28982640640 bytes, 56606720 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: 2147 MB, 2147483648 bytes, 4194304 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
3) parted -l 能夠查看未掛載的文件系統類型,以及那些分區還沒有格式化app
[root@localhost nginx]# parted -l Model: Linux device-mapper (linear) (dm) Disk /dev/mapper/centos-swap: 2147MB Sector size (logical/physical): 512B/512B Partition Table: loop Disk Flags: Number Start End Size File system Flags 1 0.00B 2147MB 2147MB linux-swap(v1) Model: Linux device-mapper (linear) (dm) Disk /dev/mapper/centos-root: 29.0GB Sector size (logical/physical): 512B/512B Partition Table: loop Disk Flags: Number Start End Size File system Flags 1 0.00B 29.0GB 29.0GB xfs Model: Virtio Block Device (virtblk) Disk /dev/vda: 32.2GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 1075MB 1074MB primary xfs boot 2 1075MB 32.2GB 31.1GB primary lvm
5)lsblk -f 也能夠查看未掛載的文件系統類型
ide
[root@master1 ~]# lsblk -f NAME FSTYPE LABEL UUID MOUNTPOINT vda ├─vda1 xfs 47540296-497a-4a1a-8eb5-602f3f1473e5 /boot └─vda2 LVM2_member N0luC7-9cMv-ZBNJ-icSN-SrJP-H0nX-JXvKK0 ├─centos-root xfs 407126a2-772a-4835-bebc-90cc7226bdf6 / └─centos-swap swap e3bcb5e9-3e10-426c-9dd9-aa86bac03852 [SWAP]
第二部、修復磁盤oop
ext4文件系統,使用命令 fsck.ext4 /dev/xxx 修復,spa
若是是xfs文件系統,使用命令 xfs_repair -L /dev/xxx修復it
通常狀況修復後都可掛載,io
可是若是磁盤有問題,或者陣列出問題時此種修復可能會失敗,掛載時依然要求格盤,那就果斷的格盤吧