BLKTOOL(8)

πŸ’– BLKTOOL(8) πŸ’–

okay so bestie, welcome to BLKTOOL, section 8 of the System Manager's Manual. it's a block device tool. it's giving "i know what your hard drive is doing at all times." let's get into it ✨


πŸ¦‹ NAME πŸ¦‹

blktool β€” Display or change block device settings. that's the whole thing. short, sweet, iconic. πŸ’…


🌸 SYNOPSIS 🌸

blktool [options] device [acoustic-mgmt nnn]
blktool [options] device [block-sz nnn]
blktool [options] device [bus-id]
blktool [options] device [bus-state nnn]
blktool [options] device [class]
blktool [options] device [cd-speed nnn]
blktool [options] device [defect-mgmt off|on]
blktool [options] device [dev-keep-settings off|on]
blktool [options] device [dev-read-ahead off|on]
blktool [options] device [dma off|on]
blktool [options] device [geometry]
blktool [options] device [i2o-rcache nnn]
blktool [options] device [i2o-wcache nnn]
blktool [options] device [id]
blktool [options] device [keep-settings off|on]
blktool [options] device [media unlock|lock]
blktool [options] device [multiple-count nnn]
blktool [options] device [no-write-err off|on]
blktool [options] device [pio-data 16-bit|32-bit]
blktool [options] device [pio-mode nnn]
blktool [options] device [pm-mode nnn]
blktool [options] device [queue-depth nnn]
blktool [options] device [read-ahead nnn]
blktool [options] device [readonly off|on]
blktool [options] device [reread-part]
blktool [options] device [reset]
blktool [options] device [sector-sz]
blktool [options] device [sleep]
blktool [options] device [standby]
blktool [options] device [unmask-irq off|on]
blktool [options] device [version]
blktool [options] [version]
blktool [options] device [wcache off|on]

✨ DESCRIPTION ✨

okay so here's the tea: blktool is used for querying and/or changing settings of a block device. you point it at a device, you ask it questions, or you tell it what to do. main character energy for your storage stack fr fr. 🫢

device is the name of the block device to query or modify. like, the actual thing you're poking at. no device, no vibes.


πŸ’… OPTIONS πŸ’…

  • -f β€” for a few commands, blktool will flush the buffers of the block device out to disk, before performing the requested command. specify this option β€” that's "force" β€” and it disables any flushing blktool would attempt to do. so it's not "do it harder," it's "don't bother flushing first." iykyk. πŸ™ˆ
  • -t class β€” where class is one of 'ide', 'ata', 'scsi', 'i2o', or 'auto', to override the default auto-detection of device class. you're basically telling it "bestie i already know what this is, stop guessing." πŸ”₯

πŸ‘‘ COMMANDS πŸ‘‘

  • acoustic-mgmt β€” query or set the underlying device's acoustic level. yes, your drive can be quiet or loud. slay. πŸŽ€
  • block-sz β€” query or set device block size.
  • bus-id β€” query device bus id.
  • bus-state β€” query or set device bus state (0 off, 1 on, 2 tristate).
  • class β€” query the detected (or overridden, via -t) device class. typically this will result in 'ATA' or 'SCSI' for most devices. detection is based on device major; thus your SATA device may appear as 'SCSI'. yeah, that's just how it is. πŸ¦‹
  • cd-speed β€” set CD-ROM device speed (in Kbytes/sec).
  • defect-mgmt β€” toggle the underlying device's defect management. it's obsolete, so, like, it's there, but it's giving vintage. πŸ’€
  • dev-keep-settings β€” toggle the underlying device's revert-to-defaults-on-reset feature.
  • dev-read-ahead β€” toggle the underlying device's read-ahead feature.
  • dma β€” toggle DMA data transfer. omitting the on/off argument will print the current state.
  • geometry β€” query device geometry (cylinders / heads / sectors / etc.).
  • i2o-rcache β€” query or set an I2O block device's read cache.
  • i2o-wcache β€” query or set an I2O block device's write cache.
  • id β€” query IDENTIFY [PACKET] DEVICE data.
  • keep-settings β€” keep settings across device resets. omitting the on/off argument will print the current state.
  • media β€” lock in (or unlock) a removable device.
  • multiple-count β€” set multiple count for use in READ/WRITE MULTIPLE commands.
  • no-write-err β€” toggle ignore-write-errors flag. omitting the on/off argument will print the current state.
  • pio-data β€” ATA PIO data transfer via 16-bit or 32-bit I/O. omitting the on/off argument will print the current state.
  • pio-mode β€” set the underlying ATA device's PIO data transfer mode.
  • pm-mode β€” set the underlying device's Advanced Power Management mode.
  • queued-depth β€” query or set the underlying device's queue depth.
  • read-ahead β€” query or set block device read-ahead (in units of sectors).
  • readonly β€” toggle block device read-only setting. omitting the on/off argument will print the current state.
  • reread-part β€” re-read partition table.
  • reset β€” execute device reset.
  • sector-sz β€” query device sector size.
  • sleep β€” put device to sleep immediately. night night bestie πŸ˜΄πŸ’€
  • standby β€” put device in standby mode.
  • unmask-irq β€” toggle unmasked irqs. omitting the on/off argument will print the current state.
  • version β€” print version number and exit.
  • wcache β€” toggle the underlying device's writeback cache.
not me noticing the synopsis says queue-depth and the command list says queued-depth β€” we keep both exactly as written, no editing, no "fixing", periodt. πŸ’…

πŸ’€ BUGS πŸ’€

inevitably there are some. 😭 please report any you find. be a good citizen about it.


πŸŽ€ AUTHOR πŸŽ€

blktool was written by Jeff Garzik. king behavior, honestly. πŸ‘‘


🌈 AVAILABILITY 🌈

blktool is available over the Web on the SourceForge site at http://sourceforge.net/projects/gkernel/ β€” go, run, don't walk. 🧚


and that's the whole page, bestie!! πŸ₯³ this was blktool version 4, from August 2004 β€” yeah she's an elder but she still ate. go forth and query your block devices. mwah πŸ’–πŸŒΈ

πŸ“¦ where this page comes from