Update cheatsheets

This commit is contained in:
ivuorinen
2024-10-06 00:18:37 +00:00
parent 931605c628
commit 06ae4b9964
7 changed files with 51 additions and 3 deletions

41
tldr/linux/blockdev Normal file
View File

@@ -0,0 +1,41 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# blockdev
> Manage, query, and manipulate block devices.
> More information: <https://manned.org/blockdev>.
- Print a report for all devices:
`sudo blockdev --report`
- Print a report for a specific device:
`sudo blockdev --report {{/dev/sdXY}}`
- Get the size of a device in 512-byte sectors:
`sudo blockdev --getsz {{/dev/sdXY}}`
- Set read-only:
`sudo blockdev --setro {{/dev/sdXY}}`
- Set read-write:
`sudo blockdev --setrw {{/dev/sdXY}}`
- Flush buffers:
`sudo blockdev --flushbufs {{/dev/sdXY}}`
- Get the physical block size:
`sudo blockdev --getpbsz {{/dev/sdXY}}`
- Set the read-ahead value to 128 sectors:
`sudo blockdev --setra 128 {{/dev/sdXY}}`