![插入全新驱动器后显示特殊字符文件](https://linux22.com/image/1090143/%E6%8F%92%E5%85%A5%E5%85%A8%E6%96%B0%E9%A9%B1%E5%8A%A8%E5%99%A8%E5%90%8E%E6%98%BE%E7%A4%BA%E7%89%B9%E6%AE%8A%E5%AD%97%E7%AC%A6%E6%96%87%E4%BB%B6.png)
我在我的服务器中使用以下内核(4.4.0-31-generic),当我更换驱动器时,我看到了以下问题。
插入新驱动器后,我看到以下字符设备文件。移除旧驱动器后,我看不到此文件。(在移除之前,我确保驱动器的所有 I/O 都已停止)
brw-rw---- 1 root disk 8, 128 Jul 24 19:07 /dev/sdi
cr-------- 1 root root 8, 129 Jul 15 23:50 /dev/sdi1 =====> (Who creates with this permissions, i have seen this only in pseudo terminals)
同时,我在 /proc/diskstats 和 /sys/class/block 中看到了该分区的条目。
/proc/diskstats
8 128 sdi 139089 4 2112504 37000 4473 31 312 9212 0 30764 46144
8 129 sdi1 21056 0 241392 9308 0 0 0 0 0 8928 9292
cat /sys/class/block/sdi1/start
2048
cat /sys/class/block/sdi1/size
15628048384
$ stat /dev/sdi1
File: ‘/dev/sdi1’
Size: 0 Blocks: 0 IO Block: 4096 character special file
Device: 6h/6d Inode: 723 Links: 1 Device type: 8,81
Access: (0400/cr--------) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-07-15 23:50:00.675853644 +0000
Modify: 2017-07-15 23:50:00.675853644 +0000
Change: 2017-07-15 23:50:00.675853644 +0000
出生日期:-
$ stat /dev/sdi
File: ‘/dev/sdi’
Size: 0 Blocks: 0 IO Block: 4096 block special file
Device: 6h/6d Inode: 521 Links: 1 Device type: 8,80
Access: (0660/brw-rw----) Uid: ( 0/ root) Gid: ( 6/ disk)
Access: 2017-07-25 23:37:22.598418068 +0000
Modify: 2017-07-25 23:37:22.598418068 +0000
Change: 2017-07-25 23:37:22.598418068 +0000
出生日期:-
有人见过类似的东西吗?谁可能创建了这样一个文件,具有块属性,但却是字符文件。
N: sdi
S: disk/by-path/pci-0000:09:00.0-sas-0x5000cca23bd280a5-lun-0
E: DEVNAME=/dev/sdi
E: DEVPATH=/devices/pci0000:00/0000:00:01.0/0000:09:00.0/host0/port-0:0/expander-0:0/port-0:0:13/end_device-0:0:13/target0:0:13/0:0:13:0/block/sdi
E: DEVTYPE=disk
E: ID_BUS=scsi
E: ID_PART_TABLE_TYPE=gpt
E: ID_PATH=pci-0000:09:00.0-sas-0x5000cca23bd280a5-lun-0
E: ID_PATH_TAG=pci-0000_09_00_0-sas-0x5000cca23bd280a5-lun-0
E: ID_REVISION=A7D8
E: ID_SCSI=1
E: ID_SCSI_SERIAL=2EKRSUZV
E: ID_TYPE=disk
E: MAJOR=8
E: MINOR=128
E: SUBSYSTEM=block
E: USEC_INITIALIZED=4744118623
E: nomdmonddf=1
E: nomdmonisw=1