一: 加载好sbull驱动

root@CarRadio:/# ls /dev/sbull -l brw-r--r-- 1 root root 254, 16 Mar 25 08:25 /dev/sbull root@CarRadio:/#

可以看到sbull文件属性是一个块设备, 主设备号是254,次设备号是16

二:对设备进行分区

root@CarRadio:/# fdisk /dev/sbull [ 266.720648] sbull: unknown partition table Welcome to fdisk (util-linux 2.24.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0xb90ed7e4. Command (m for help): m Help: DOS (MBR) a toggle a bootable flag b edit nested BSD disklabel c toggle the dos compatibility flag Generic d delete a partition l list known partition types n add a new partition p print the partition table t change a partition type v verify the partition table Misc m print this menu u change display/entry units x extra functionality (experts only) Save & Exit w write table to disk and exit q quit without saving changes Create a new label g create a new empty GPT partition table G create a new empty SGI (IRIX) partition table o create a new empty DOS partition table s create a new empty Sun partition table Command (m for help): n //输入n 添加一个新的分区Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p //主分区 Partition number (1-4, default 1): 1 //该分区NO.1 First sector (1-1023, default 1): 1 // 该分区起始扇区 Last sector, +sectors or +size{K,M,G,T,P} (1-1023, default 1023): 1023 //该分区结尾扇区 Created a new partition 1 of type 'Linux' and of size 511.5 KiB. Command (m for help): w //保存并退出 The partition table has been altered. Calling ioctl() to re-read parti[ 303.589984] sbull: sbull1 tion table. Syncing disks.

 
 

查看分区:笔者做了两个分区

root@CarRadio:/# ls /dev/sbull*
/dev/sbull   /dev/sbull1  /dev/sbull2
root@CarRadio:/#

二:格式化文件系统

root@CarRadio:/# mkfs.ext4 /dev/sbull2
mke2fs 1.42.4 (12-June-2012)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
64 inodes, 504 blocks
25 blocks (4.96%) reserved for the super user
First data block=1
Maximum filesystem blocks=524288
1 block group
8192 blocks per group, 8192 fragments per group
64 inodes per group

Allocating group tables: done
Writing inode tables: done

Filesystem too small for a journal
Writing superblocks and filesystem accounting information: done

三:挂在文件系统

root@CarRadio:/# mount /dev/sbull1 /tmp/mnt/sbull/ mount: mounting /dev/sbull1 on /tmp/mnt/sbull/ failed: Invalid argument root@CarRadio:/# mount /dev/sbull2 /tmp/mnt/sbull/ [ 832.527053] EXT4-fs (sbull2): couldn't mount as ext3 due to feature incompatibilities [ 832.557133] EXT4-fs (sbull2): couldn't mount as ext2 due to feature incompatibilities [ 832.588127] EXT4-fs (sbull2): mounted filesystem without journal. Opts: (null) root@CarRadio:/# root@CarRadio:/#

以上完成了该块设备应用层的挂在操作,接下来就可以直接在/tmp/mnt/sbull目录里面操作了

linux 块设备驱动(五)——块设备应用层的操作的更多相关文章

  1. 【转】深入浅出:Linux设备驱动之字符设备驱动

    深入浅出:Linux设备驱动之字符设备驱动 一.linux系统将设备分为3类:字符设备.块设备.网络设备.使用驱动程序: 字符设备:是指只能一个字节一个字节读写的设备,不能随机读取设备内存中的某一数据 ...

  2. Linux 设备驱动开发 —— platform设备驱动应用实例解析

    前面我们已经学习了platform设备的理论知识Linux 设备驱动开发 —— platform 设备驱动 ,下面将通过一个实例来深入我们的学习. 一.platform 驱动的工作过程 platfor ...

  3. 字符设备驱动、平台设备驱动、设备驱动模型、sysfs的比较和关联

    转载自:http://www.kancloud.cn/yueqian_scut/emlinux/106829 学习Linux设备驱动开发的过程中自然会遇到字符设备驱动.平台设备驱动.设备驱动模型和sy ...

  4. [kernel]字符设备驱动、平台设备驱动、设备驱动模型、sysfs几者之间的比较和关联

    转自:http://www.2cto.com/kf/201510/444943.html Linux驱动开发经验总结,绝对干货! 学习Linux设备驱动开发的过程中自然会遇到字符设备驱动.平台设备驱动 ...

  5. 乾坤合一~Linux设备驱动之块设备驱动

    1. 题外话 在蜕变成蝶的一系列学习当中,我们已经掌握了大部分Linux驱动的知识,在乾坤合一的分享当中,以综合实例为主要讲解,在一个月的蜕茧成蝶的学习探索当中,觉得数据结构,指针,链表等等占据了代码 ...

  6. 深入浅出:Linux设备驱动之字符设备驱

    一.linux系统将设备分为3类:字符设备.块设备.网络设备.使用驱动程序: 字符设备:是指只能一个字节一个字节读写的设备,不能随机读取设备内存中的某一数据,读取数据需要按照先后数据.字符设备是面向流 ...

  7. linux设备驱动之字符设备驱动模型(2)

    在上一篇中我们已经了解了字符设备驱动的原理,也了解了应用层调用内核函数的机制,但是我们每次操作设备,都必须首先通过mknod命令创建一个设备文件名,比如说我们要打开u盘,硬盘等这些设备,难道我们还要自 ...

  8. Linux 设备驱动之字符设备

    参考转载博客:http://blog.chinaunix.net/uid-26833883-id-4369060.html https://www.cnblogs.com/xiaojiang1025/ ...

  9. 蜕变成蝶~Linux设备驱动之字符设备驱动

    一.linux系统将设备分为3类:字符设备.块设备.网络设备.使用驱动程序: 字符设备:是指只能一个字节一个字节读写的设备,不能随机读取设备内存中的某一数据,读取数据需要按照先后数据.字符设备是面向流 ...

  10. 深入浅出:Linux设备驱动之字符设备驱动

    一.linux系统将设备分为3类:字符设备.块设备.网络设备.使用驱动程序: 字符设备:是指只能一个字节一个字节读写的设备,不能随机读取设备内存中的某一数据,读取数据需要按照先后数据.字符设备是面向流 ...

随机推荐

  1. Server-Side Rendering(服务端渲染)的优点与缺点

    优点 1. SEO 客户端渲染,页面中只有初始的几个html容器,js生成内容填充到容器中,爬虫只能识别到初始的html容器,js生成的内容一般不会被识别,而服务端渲染直接给出html,爬虫可以识别到 ...

  2. IBM QMF下载

    官网下载页面: http://www-01.ibm.com/support/docview.wss?uid=swg27009383 官方BBS: https://w3-connections.ibm. ...

  3. python中的daemon守护进程实现方法

    原文参考:http://blog.csdn.net/tao_627/article/details/49532021 守护进程是生存期长的一种进程.它们独立于控制终端并且周期性的执行某种任务或等待处理 ...

  4. 博彩游戏(tyvj 1519)

    背景 Bob最近迷上了一个博彩游戏…… 描述 这个游戏的规则是这样的:每花一块钱可以得到一个随机数R,花上N块钱就可以得到一个随机序列:有M个序列,如果某个序列是产生的随机序列的子串,那么就中奖了,否 ...

  5. 洛谷P1469找筷子

    题目描述 经过一段时间的紧张筹备,电脑小组的“RP餐厅”终于开业了,这天,经理LXC接到了一个定餐大单,可把大家乐坏了!员工们齐心协力按要求准备好了套餐正准备派送时,突然碰到一个棘手的问题,筷子!CX ...

  6. 洛谷P1236 算24点

    题目描述 几十年前全世界就流行一种数字游戏,至今仍有人乐此不疲.在中国我们把这种游戏称为“算24点”.您作为游戏者将得到4个1~9之间的自然数作为操作数,而您的任务是对这4个操作数进行适当的算术运算, ...

  7. 【CF652C】Foe Pairs(线性扫描)

    题意:给你1-n的一个排列和m组数对,问有多少区间不包含任意一个数对. (1 ≤ n, m ≤ 3·105) 思路:数据范围过大,不能用容斥原理 f[i]表示以位置i上的数为左端点,右端点最小到哪里 ...

  8. 如何循序渐进向.NET架构师发展

    微软的DotNet开发绝对是属于那种入门容易提高难的技术.而要能够成为DotNet架构师没有三年或更长时间的编码积累基本上是不可能的.特别是在大型软件项目中,架构师是项目核心成员,承上启下,因此RUP ...

  9. Toast问题记录:This Toast was not created with Toast.makeText()

    最近使用自己封装的Toast时,遇到一个问题 java.lang.RuntimeException: This Toast was not created with Toast.makeText() ...

  10. 洛谷——P2912 [USACO08OCT]牧场散步Pasture Walking(lca)

    题目描述 The N cows (2 <= N <= 1,000) conveniently numbered 1..N are grazing among the N pastures ...