不带 -o 循环安装
我为 Linux 内核编写了一个虚拟(ram 磁盘)块设备驱动程序。 加载驱动程序后,我可以看到它为 /dev/mybd。
我可以使用dd命令成功地将数据传输到它上面,比较复制的数据 成功地。
问题是,当我在其上创建 ext2/3 文件系统时,我必须使用 -o 循环 mount 命令的选项。否则挂载失败并显示以下结果:
挂载:错误的文件系统类型,错误的选项,mybd 上的错误超级块, 缺少代码页或帮助程序,或其他错误
可能是什么问题?请帮忙。
谢谢。
I have written a dummy (ram disk) block device driver for linux kernel.
When the driver is loaded, I can see it as /dev/mybd.
I can successfully transfer data onto it using dd command, compare the copied data
successfully.
The problem is that when I create ext2/3 filesystem on it, I have to use -o loop
option with the mount command. Otherwise mount fails with following result:
mount: wrong fs type, bad option, bad superblock on mybd,
missing codepage or helper program, or other error
What could be the problem? Please help.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
嗯,如果它与
-o Loop
一起工作并且不与它一起工作,那么我有坏消息给你:你的“设备”实际上只是 /dev 中的一个普通文件。ls -l /dev/mybd
显示什么?如果它的文件大小非零,则它是一个常规文件,与您的驱动程序无关。如果需要,请使用
mknod
自行创建设备文件。Hmm, if it works with
-o loop
and doesn't work without, then I have bad news for you: your "device" is actually just a plain file in /dev. What doesls -l /dev/mybd
show? If its filesize is non-zero, it's a regular file, and has nothing to do with your driver.Use
mknod
to create the device file yourself if needed.我看你又要重新开始了作为关于您之前尝试的快速说明,您是否确保您的设备在 /dev 中显示为块设备而不是字符设备?
I see you're starting over again. As a quick note about your previous attempt, did you make sure your device appeared in /dev as a block device and not a character one?
在安装设备之前在设备上创建一个文件系统:
或者
Create a filesytem on the device before mounting it:
or
循环设备用于在 Linux 文件系统上挂载块特殊文件,将它们模拟为块设备。因此,安装会抛出错误。
The loop device is used to mount block special files on the linux filesystem emulating them as block devices. Hence, the mount throws error.