search
HomeOperation and MaintenanceLinux Operation and MaintenanceIn addition to block devices, what other devices does Linux have?

In addition to block devices, Linux also has character devices and network devices. A character device is a device that can be accessed like a byte stream. When a read or write request is issued to a character device, the corresponding IO operation occurs immediately; while the network device is driven by the Linux network subsystem and is responsible for sending and receiving data packets. Rather than being oriented to stream devices, network devices do not have nodes in the Linux system file system.

In addition to block devices, what other devices does Linux have?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

In addition to block devices, Linux also has character devices and network devices.

Devices in the Linux system can be divided into three categories: character devices, block devices and network devices.

(1) Character device

A character device is a device that can be accessed like a byte stream. When a read or write request is issued to a character device, the corresponding IO operation occurs immediately. Many devices in the Linux system are character devices, such as character terminals, serial ports, keyboards, mice, etc. In embedded Linux development, the most common ones are character devices and drivers.

(2) Block device

Block device is a device that must be accessed in blocks when performing TO operations in the Linux system. Block devices can install file systems. The block device driver will use a piece of system memory as a buffer, so issuing read and write accesses to the block device does not necessarily result in hardware I/O operations immediately. Common block devices in Linux systems include hard disks, floppy drives, etc.

(3) Network equipment

Network equipment can be either a hardware device such as a network card or a pure software device such as a loopback device. Network devices are driven by the Linux network subsystem and are responsible for sending and receiving data packets, rather than stream devices. Therefore, network devices do not have nodes in the Linux system file system. Access to network devices is generated through socket calls, rather than ordinary file operations such as open/closc and read/write.

In addition to block devices, what other devices does Linux have?

Linux View block device information

In Linux, you can use the lsblk command to view block devices information.

The lsblk command in English is "list block", which is used to list information about all available block devices, and also displays the dependencies between them, but it does not list RAM disk information. Block devices include hard disks, flash drives, CD-ROMs, etc. The lsblk command is included in the util-linux-ng package, which is now renamed util-linux.

The lsblk command has several options:

Default Options

The lsblk command will list all block devices in a tree view by default. Open the terminal and enter the following command:

$ lsblk

The output is as follows:

lsblk default
lsblk default

The 7 column names are as follows:

NAME : 这是块设备名。
MAJ:MIN : 本栏显示主要和次要设备号。
RM : 本栏显示设备是否可移动设备。注意,在本例中设备sdb和sr0的RM值等于1,这说明他们是可移动设备。
SIZE : 本栏列出设备的容量大小信息。例如298.1G表明该设备大小为298.1GB,而1K表明该设备大小为1KB。
RO : 该项表明设备是否为只读。在本案例中,所有设备的RO值为0,表明他们不是只读的。
TYPE :本栏显示块设备是否是磁盘或磁盘上的一个分区。在本例中,sda和sdb是磁盘,而sr0是只读存储(rom)。(LCTT译注,此处sr0的RO项没有标记为1,可能存在一些错误?)
MOUNTPOINT : 本栏指出设备挂载的挂载点。

List all devices:

The default option will not list all empty devices. To view these empty devices, use the following command:

$ lsblk -a

This option will list all devices, including empty devices.

lsblk bytes sda

lsblk bytes sda

List device permissions and owners:

lsblk command can also be used Lists ownership of a specific device. Groups and modes can also be listed. You can obtain this information through the following command:

$ lsblk -m
lsblk permissions
lsblk permissions

List the specified device:

This command can also obtain only the information of the specified device. This is accomplished by specifying the device name after the options provided to the lsblk command. For example, you might be interested in knowing the size of your disk drive in bytes. You can do this by running the following command:

$ lsblk -b /dev/sda

Alternatively, the following command is equivalent:

$ lsblk --bytes /dev/sda

List unheaded devices in list form:

You can also combine several options to get specific output. For example, you might want to list devices in a list format instead of the default tree format. You may also be interested in removing headers for different column names. Two different options can be combined to get the desired output with the command:

$ lsblk -nl

Alternatively, you can use the long options below which also give the same output.

$ lsblk --noheadings --list
lsblk no header and list
lsblk no header and list

List SCSI devices:

To get a list of SCSI devices, you can only use the -S option. This option is a capital S and should not be confused with the -s option, which prints dependencies in reverse order.

$ lsblk -S

lsblk lists SCSI devices, and -s is the reverse order option (LCTT annotation: reverse the organizational relationship of devices and partitions to display), which will give the following output. Enter the command:

$ lsblk -s

or

$ lsblk --inverse

You can use lsblk to get more information about your block device, try displaying it yourself

Related recommendations :《Linux video tutorial

The above is the detailed content of In addition to block devices, what other devices does Linux have?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
修复在 Windows 10/11 中设备禁用(错误代码 22)的方法修复在 Windows 10/11 中设备禁用(错误代码 22)的方法Aug 04, 2023 pm 03:17 PM

设备管理器中的“此设备已禁用”代码22错误是否阻止您在PC上使用新设备或旧设备?不用担心,因为我们在这里帮助您解决此问题。代码22错误意味着设备已被手动禁用,有时重新启用它无济于事。无论原因是什么,这里有10种方法可以修复Windows22/PC上的“此设备已禁用”代码10错误并使该硬件再次工作。1.拔下并重新插入新硬件您插入PC的新硬件可能会在快速卸下并重新安装后重新开始工作。因此,如果它是通过USB插入的设备,请继续拔下它。然后,等待几秒钟,然后重新插入。现在,检查设备是否显示在设备管理器中

重新安装 Safari 的 8 种方法,适用于 iPhone重新安装 Safari 的 8 种方法,适用于 iPhoneSep 16, 2023 am 11:17 AM

网页浏览是移动设备的基本功能,浏览器可以有效地促进它。这些浏览器还支持安装内容拦截器和其他工具,以个性化您的浏览体验。苹果的iOS平台使用Safari作为其默认浏览器。在极少数情况下,您可能会发现Safari浏览器从您的设备中丢失。如果遇到这种情况,以下步骤将指导您如何还原它。您可以在iPhone上重新安装Safari吗?Safari是iOS设备上的内置应用程序,由于其受保护的系统状态而无法删除或卸载。如果设备中似乎缺少该应用程序,则可能是您正在处理错误,或者该应用程序可能由于各种原因而被隐藏。

prru是什么设备prru是什么设备Apr 14, 2023 pm 04:59 PM

PRRU是指皮基站设备,是一种有源设备,是一种小型化、低功率、低功耗的室内覆盖射频单元,即一种室内基站。PRRU具备接收机和发射机两部分的功能,即都在远端将数字信号(先转换成中频信号)转换成射频信号,然后放大传送出去;或者接收天线收到的射频信号,转换成数字信号再传给基带处理单元。

修复:在 Windows 11 中无法在此设备上加载驱动程序修复:在 Windows 11 中无法在此设备上加载驱动程序Apr 15, 2023 pm 08:22 PM

驱动程序是促进操作系统和相应设备之间命令中继的关键软件。但是如果在Windows11中遇到Adrivercannotloadonthisdevice错误怎么办?您将在引导操作系统时看到此错误消息,其效果最初可能会或可能不会明显可见,具体取决于受影响的驱动程序。但是,随着时间的推移,驱动程序可能会停止与相应设备一起运行。因此,您必须对错误进行故障排除。此外,在大多数情况下,故障驱动程序会列在错误框中,便于您继续操作。如何修复Windows11中的A驱动程序无法在此设备上加载错误?1.

如何使用“隔空播放”流式传输视频或镜像 iPhone 或 iPad 屏幕如何使用“隔空播放”流式传输视频或镜像 iPhone 或 iPad 屏幕Jul 14, 2023 pm 07:53 PM

本快速指南将向您展示如何使用AirPlay,这是Apple的创新无线流媒体功能,可以轻松共享和显示内容。允许您使用Wi-Fi将iPhone或iPad连接到与AirPlay兼容的AppleTV、智能电视、扬声器和Mac以及某些第三方扬声器和智能电视,以实现无缝数据传输。“隔空播放”以点对点为基础运行,通过本地网络连接您的Apple设备。它使用多种技术的组合,包括用于流式传输音频和视频的实时传输协议(RTP)和用于设备发现的Bonjour。简而言之,当您使用“隔空播放”时,您的设备会发送数据流,然后

如何使用 Windows Copilot 打开暗模式、免打扰、管理蓝牙设备等如何使用 Windows Copilot 打开暗模式、免打扰、管理蓝牙设备等Aug 01, 2023 pm 09:58 PM

任何想要尽早了解Windows上AI未来的人都不需要再看Copilot预览。Copilot的功能很少,似乎只不过是侧面的BingAI任务栏,无疑是朝着正确方向前进的推动。即使是现在,用户也可以在浅色和深色主题之间切换,打开和关闭免打扰和蓝牙,并直接跳转到蓝牙设备设置页面来管理连接–所有这些都可以通过Copilot实现。以下是获取Windows11Copilot并完成所有这些操作的方法。如何在Windows11上启用Copilot要在Windows11上开始使用Copilot,

Tg7100c是什么设备Tg7100c是什么设备Mar 13, 2023 pm 03:11 PM

Tg7100c是智能新一代高集成Wi-Fi和BLE组合芯片,支持内部RTC时钟唤醒、外部中断唤醒,以达到低功耗睡眠唤醒机制。TG7100C搭载32位RISC-V处理器,配备2MB Flash/276KB RAM/EFuse存储资源,支持SDIO、SPI、UART、I2C、IR remote、PWM等外设接口;具有极简的电路设计,优异的射频性能,低功耗,宽工作温度等特点。

如何修复“iPhone不可用”消息如何修复“iPhone不可用”消息Sep 17, 2023 pm 09:25 PM

“iPhone不可用”安全功能如何操作?触发“iPhone不可用”消息的基本机制植根于系统设计的安全功能,该功能可跟踪每个不正确的密码条目。这种保护机制从第五次错误尝试解锁设备开始进入高速运转。一旦达到这个里程碑,iPhone就会设置一分钟的临时锁定期,在此期间,任何输入密码的额外尝试都将变得徒劳无功。此锁定持续时间不是静态的,而是遵循不断升级的模式。具体来说,在第五次密码尝试之后,每次后续错误密码尝试都会导致锁定计时器增加一分钟。例如,第六次错误尝试将导致2分钟锁定,第七次错误尝试将导致3分钟

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.