初级会员
- 积分
- 187
- 金钱
- 187
- 注册时间
- 2020-11-11
- 在线时间
- 27 小时
|
3金钱
跟着教程做到块设备驱动,51.3 使用请求队列实验
写到程序可以编译通过,没有错误和警告,
下面是操作步骤
1.加载模块,可以正常加载。下面是输出:- # modprobe ramdisk_withrequest.ko
- ramdisk init
- ramdisk open
- ramdisk release
复制代码
2.查看磁盘信息也正常:- # fdisk -l
- Found valid GPT with protecramdisk open
- tive MBR; using GPT
- Disk /devramdisk release
- /mmcblk1: 15269888 sectors, 3360ramdisk open
- M
- Logical sector size: 512
- Disk iramdisk release
- dentifier (GUID): 7748b6a0-cb09-4b5e-82b6-dccdc8a28f39
- Partition table holds up to 128 entries
- First usable sector is 34, last usable sector is 15269854
- Number Start (sector) End (sector) Size Name
- 1 1024 5119 2048K ssbl
- 2 5120 136191 64.0M boot
- 3 136192 15268863 7389M rootfs
- Disk /dev/ramdisk: 2 MB, 2097152 bytes, 4096 sectors
- 32 cylinders, 2 heads, 64 sectors/track
- Units: sectors of 1 * 512 = 512 bytes
- Disk /dev/ramdisk doesn't contain a valid partition table
复制代码
3.格式化也没报错:- # mkfs.vfat /dev/ramdisk
- ramdisk open
- ramdisk release
复制代码
4.挂载时到输出如下:- # mount /dev/ramdisk /mnt/ramdisk/
- ramdisk open
- ramdisk release
- ramdisk open
- ramdisk release
- ramdisk open
- ramdisk release
- ramdisk open
- ramdisk release
- ramdisk open
复制代码
5.进入目录后查看文件就出现报错:
- # ls /mnt/ramdisk/
- FAT-fs (ramdisk): error, fat_get_cluster: invalid start cluster (i_pos 0, start 98dc6281)
- FAT-fs (ramdisk): Filesystem has been set read-only
- ls: /mnt/ramdisk/HDUP.": Input/output error
- ?P???Z??.?? ??$???.?#P ?H(?.? ??."&[url=home.php?mod=space&uid=95564]@[/url] ??????-?.c'?
- ?????X?.bf? ??&!?@??. -Q ?????(??.c% T@(????P.p?? ?P?????X.Q!?
- ??L?????."'? ????.??Q ???.`%? ?.?!? ?P ???.Q??
复制代码
使用df -h 命令可以看到磁盘已经满了:
- # df -h
- Filesystem Size Used Available Use% Mounted on
- 192.168.1.20:/home/lituo/linux/nfs/rootfs
- 290.0G 51.4G 235.2G 18% /
- devtmpfs 370.8M 0 370.8M 0% /dev
- tmpfs 435.3M 0 435.3M 0% /dev/shm
- tmpfs 435.3M 40.0K 435.2M 0% /tmp
- tmpfs 435.3M 20.0K 435.3M 0% /run
- /dev/ramdisk 2.0M 1.8M 128.0K 94% /mnt/ramdisk
复制代码
请问各位大佬这个怎么解决啊?
|
|