如何挂载出现在 /proc/devices 而不是 /dev 的设备?

如何挂载出现在 /proc/devices 而不是 /dev 的设备?

我在该 SoM 的 Phytec 演示板上使用在 Phytec i.MX6 ULL SoM 上运行的基本 Linux 发行版。我需要能够从 SD 卡复制文件。

我从演示板 SD 卡插槽中的 SD 卡刷新了 SoM NAND,所以我知道 SD 卡硬件是好的。现在我从 NAND 启动,并在操作系统启动后尝试从 SD 卡读取。

当我启动时,没有mmc*设备dev

$ ls -l /dev | grep mmc
(no result)

然而,SD 卡显然可以通过以下方式可见/proc/devices

$ cat /proc/devices
.
.
.
Block devices:
.
.
.
179 mmc
.
.
.

/dev有没有办法可以从数据中创建条目/proc/devices?根据谷歌搜索,我怀疑我应该使用该mknod命令,但我不知道如何使用。

- 编辑 -

该死,我想我已经弄清楚了。基于此https://programmer.group/manual-creation-of-device-nodes-under-dev-in-linux.html我做了:

mknod /dev/mmcblk0 b 179 0
mknod /dev/mmcblk0p1 b 179 1
mount /dev/mmcblk0p1 /mnt/

但我收到错误:

mount: /mnt: /dev/mmcblk0p1 is not a valid block device.

-- 编辑2 --

@用户414777

如果我做:

ls /sys/block

我明白了

loop0@     loop3@     loop6@     mtdblock1@ mtdblock4@ ram10@     ram13@     ram2@      ram5@      ram8@
loop1@     loop4@     loop7@     mtdblock2@ ram0@      ram11@     ram14@     ram3@      ram6@      ram9@
loop2@     loop5@     mtdblock0@ mtdblock3@ ram1@      ram12@     ram15@     ram4@      ram7@

mmc我的里面没有/sys/block

我将继续阅读,devtmpfs因为我对此并不熟悉。

-- 编辑3 --

这是我的/dev/block/sys/dev/块的内容:

$ ls -l /dev/block

lrwxrwxrwx    1 root     root             7 Jan  1 00:16 1:0 -> ../ram0
lrwxrwxrwx    1 root     root             7 Jan  1 00:16 1:1 -> ../ram1
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 1:10 -> ../ram10
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 1:11 -> ../ram11
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 1:12 -> ../ram12
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 1:13 -> ../ram13
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 1:14 -> ../ram14
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 1:15 -> ../ram15
lrwxrwxrwx    1 root     root             7 Jan  1 00:16 1:2 -> ../ram2
lrwxrwxrwx    1 root     root             7 Jan  1 00:16 1:3 -> ../ram3
lrwxrwxrwx    1 root     root             7 Jan  1 00:16 1:4 -> ../ram4
lrwxrwxrwx    1 root     root             7 Jan  1 00:16 1:5 -> ../ram5
lrwxrwxrwx    1 root     root             7 Jan  1 00:16 1:6 -> ../ram6
lrwxrwxrwx    1 root     root             7 Jan  1 00:16 1:7 -> ../ram7
lrwxrwxrwx    1 root     root             7 Jan  1 00:16 1:8 -> ../ram8
lrwxrwxrwx    1 root     root             7 Jan  1 00:16 1:9 -> ../ram9
lrwxrwxrwx    1 root     root            12 Jan  1 00:16 31:0 -> ../mtdblock0
lrwxrwxrwx    1 root     root            12 Jan  1 00:16 31:1 -> ../mtdblock1
lrwxrwxrwx    1 root     root            12 Jan  1 00:16 31:2 -> ../mtdblock2
lrwxrwxrwx    1 root     root            12 Jan  1 00:16 31:3 -> ../mtdblock3
lrwxrwxrwx    1 root     root            12 Jan  1 00:16 31:4 -> ../mtdblock4
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 7:0 -> ../loop0
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 7:1 -> ../loop1
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 7:2 -> ../loop2
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 7:3 -> ../loop3
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 7:4 -> ../loop4
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 7:5 -> ../loop5
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 7:6 -> ../loop6
lrwxrwxrwx    1 root     root             8 Jan  1 00:16 7:7 -> ../loop7

$ ls -l /sys/dev/block

lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:0 -> ../../devices/virtual/block/ram0/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:1 -> ../../devices/virtual/block/ram1/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:10 -> ../../devices/virtual/block/ram10/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:11 -> ../../devices/virtual/block/ram11/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:12 -> ../../devices/virtual/block/ram12/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:13 -> ../../devices/virtual/block/ram13/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:14 -> ../../devices/virtual/block/ram14/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:15 -> ../../devices/virtual/block/ram15/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:2 -> ../../devices/virtual/block/ram2/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:3 -> ../../devices/virtual/block/ram3/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:4 -> ../../devices/virtual/block/ram4/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:5 -> ../../devices/virtual/block/ram5/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:6 -> ../../devices/virtual/block/ram6/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:7 -> ../../devices/virtual/block/ram7/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:8 -> ../../devices/virtual/block/ram8/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 1:9 -> ../../devices/virtual/block/ram9/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 31:0 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd0/mtdblock0/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 31:1 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd1/mtdblock1/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 31:2 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd2/mtdblock2/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 31:3 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd3/mtdblock3/
lrwxrwxrwx    1 root     root             0 Jan  1 00:17 31:4 -> ../../devices/soc0/soc/1806000.gpmi-nand/mtd/mtd4/mtdblock4/
lrwxrwxrwx    1 root     root             0 Jan  1 00:16 7:0 -> ../../devices/virtual/block/loop0/
lrwxrwxrwx    1 root     root             0 Jan  1 00:16 7:1 -> ../../devices/virtual/block/loop1/
lrwxrwxrwx    1 root     root             0 Jan  1 00:16 7:2 -> ../../devices/virtual/block/loop2/
lrwxrwxrwx    1 root     root             0 Jan  1 00:16 7:3 -> ../../devices/virtual/block/loop3/
lrwxrwxrwx    1 root     root             0 Jan  1 00:16 7:4 -> ../../devices/virtual/block/loop4/
lrwxrwxrwx    1 root     root             0 Jan  1 00:16 7:5 -> ../../devices/virtual/block/loop5/
lrwxrwxrwx    1 root     root             0 Jan  1 00:16 7:6 -> ../../devices/virtual/block/loop6/
lrwxrwxrwx    1 root     root             0 Jan  1 00:16 7:7 -> ../../devices/virtual/block/loop7/

我好像没有/sys/dev/block/179:0

相关内容