GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — linux-command/command/blockdev.md at master · javamickey/linux-command

Expand file tree

/

blockdev.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
55 lines (37 loc) · 937 Bytes
/

blockdev.md

Copy path

File metadata and controls

55 lines (37 loc) · 937 Bytes
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

blockdev

从命令行调用区块设备控制程序

补充说明

blockdev命令 在命令调用“ioxtls”函数,以实现对设备的控制。

语法

blockdev(选项)(参数)

选项

-V:打印版本号并退出;
-q:安静模式;
-v:详细信息模式;
--setro:只读;
--setrw:只写;
--getro:打印只读状态,“1”表示只读,“0”表示非只读;
--getss:打印扇区大小。通常为521;
--flushbufs:刷新缓冲区;
--rereadpt:重新读取分区表。

参数

设备文件名:指定要操作的磁盘的设备文件名。

实例

设置设备为只读:

blockdev --setro /dev/hda4

读取设备是否为只读:

blockdev --getro /dev/hda4

设置设别为可读写:

blockdev --setrw /dev/hda4
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.