Linux┊字符设备和块设备的区别?

Doubi Gao3 posted @ 2014年4月29日 21:11 in Linux with tags ubuntu , 1237 阅读

      今天学了下Linux下文件的备份,如dump命令,然后在/dev里面查看文件时发现了有些文件的标识是b与c,不是通常的d,然后去网上找了找资料,就放这了吧。laugh

      设备文件分为Block Device Driver和Character Device Drive两类。Character Device Drive又被称为字符设备或裸设备raw devices; Block Device Driver通常成为块设备。而Block Device Driver是以固定大小长度来传送转移资料 ;Character Device Driver是以不定长度的字元传送资料 。且所连接的Devices也有所不同,Block Device大致是可以随机存取(Random Access)资料的设备,如硬碟机或光碟机;而Character Device刚好相反,依循先後顺序存取资料的设备,如印表机 、终端机等皆是。

  /dev/dsk对应的为块设备,文件系统的操作用到它,如mount。/dev/rdsk对应的为字符设备(裸设备,rdsk的r即为raw),fsck newfs等会涉及到。一般我们的操作系统和各种软件都是以块方式读写硬盘,这里的块是逻辑块,创建文件系统时可以选择,windows里叫簇。可看newfs or mkfs的manual。oracle是比较常见的字符方式读写硬盘。

  Character Device Files

  The file type “c” identifies character device files. For disk devices,character device files call for I/O operations based on the disks smallest addressable unit, or sectors. Each sector is 512 bytes in size.

  Block Device Files

  The file type “b” identifies block device files. For disk devices, block device files call for I/O operations based on a defined block size. The block size depends on the particular device, but for UFS file systems,the default block size is 8 Kbytes.

转载自:http://www.360doc.com/content/11/0420/14/1317564_111004478.shtml

LIC Online Premium P 说:
2022年8月07日 18:28

Life Insurance Corporation was established in 1956 and Is the oldest insurance company in India, and it has been providing millions of individuals with their variety of insurance schemes along with giving a good service to the business groups. To have a successful policy on your name, it is mandatory to make the LIC online premium payment or offline in time, LIC Online Premium Payment and timely paying the installments of LIC will keep your policy active and that will be helpful in your emergency.LIC does provide various methods to make the premium which can be office and as well online whichever is convenient to the customer, and it is also mandatory to check the payment dates, as it depends on the customer whether they have chosen for monthly, half-yearly or yearly.

AP 1st Inter Model P 说:
2022年8月19日 22:15

Important Model Question Paper for Andhra Pradesh Intermediate First Year 2023 Important Model Question Paper 2023 for BIEAP is available on their official website. Those preparing for the exams are required to go through AP 1st Inter Model Paper 2023 all of the provided BIEAP Intermediate First Year Important Model Question Paper 2023 and have a thorough understanding of each subject. and, thus, develop their talents in the area where they lacked proficiency. Additionally, until the exam day, use these AP Inter First Year Old Important Model Question Paper 2023.

Alyssa 说:
2023年1月02日 14:16

In Linux, a device is a special file that represents a device or a resource that is not normally part of the file system. Devices are usually accessed through device files, which are located in the /dev directory.There are two main types cheap real diamond rings online of devices in Linux: character devices and block devices.A character device is a device that can be accessed one character at a time. Examples of character devices include serial ports, terminal devices, and printers.A block device is a device that can be accessed in blocks of data. Examples of block devices include hard drives, floppy drives, and CD-ROM drives.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter