You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
789 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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
```