概述

由于机房异常停电,导致服务器启动后系统分区异常。无法识别之前挂载的磁盘分区,并且无法使用fdisk命令重置分区。

[root@db2 ~]# cat /etc/fstab
/dev/mapper/data10p1    /data                    ext4    defaults       0 0
[root@db2 ~]# ll /dev/mapper/data10
lrwxrwxrwx 1 root root 8 9月   6 17:37 /dev/mapper/data10 -> ../dm-16
[root@db2 ~]# fdisk /dev/mapper/data10

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: 无效的参数.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

处理办法

使用partprobe命令重读分区表

[root@db2 ~]# partprobe /dev/mapper/data10
[root@db2 ~]# ll /dev/mapper/data10*
lrwxrwxrwx 1 root root 8 9月   6 17:37 /dev/mapper/data10 -> ../dm-16
lrwxrwxrwx 1 root root 8 10月 29 15:39 /dev/mapper/data10p1 -> ../dm-17

分类: Linux