VIRTIO_BLK(4)

πŸ’– VIRTIO_BLK(4) πŸ’–

okay bestie, welcome to the Kernel Interfaces Manual section of the group chat β€” today's main character is virtio_blk, and no, it's not a new drink at Starbucks, it's the VirtIO Block driver. πŸ¦‹


✨ NAME ✨

virtio_blk β€” the VirtIO Block driver. that's it, that's the vibe. πŸ‘‘


🌸 SYNOPSIS 🌸

so if you want this driver baked into your kernel (permanent, committed, no cap), you drop these lines into your kernel configuration file:

device virtio_blk

OR β€” and this is the lowkey easier route β€” you can load it as a module at boot time instead, by putting this line in loader.conf(5):

virtio_blk_load="YES"

pick your fighter, both are iconic. πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

The virtio_blk device driver provides support for VirtIO block devices. that's the whole job, and it does it flawlessly. periodt. ✨


πŸŽ€ LOADER TUNABLES πŸŽ€

okay so these tunables? you can set them at the loader(8) prompt before the kernel boots, or you can just store them in loader.conf(5) so they're ready to go. your choice, bestie.

  • hw.vtblk.no_ident
  • hw.vtblk.X.no_ident

These tunables disable retrieving the device identification string from the hypervisor β€” either globally (hw.vtblk.no_ident) or per-device (hw.vtblk.X.no_ident). The default value is 0. 🫢

  • hw.vtblk.writecache_mode
  • hw.vtblk.X.writecache_mode

These tunables determine the write cache mode, globally or per-device. heads up though: the mode can be changed only if the ConfigWCE feature is negotiated. Set it to 0 for writethrough mode, 1 for writeback mode, and -1 to leave it as-is. The default value is to leave as-is. 🌈


🧚 SYSCTL VARIABLES 🧚

these ones are available as sysctl(8) variables, so you can poke at them live, iykyk:

  • dev.vtblk.X.writecache_mode β€” the write cache mode of the device can be either writethrough (0) or writeback (1). If the ConfigWCE feature is negotiated, the write cache mode can be toggled between writethrough and writeback. πŸ”₯

πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’€ HISTORY πŸ’€

The virtio_blk driver was written by Bryan Venteicher <bryanv@FreeBSD.org>. It first appeared in FreeBSD 9.0. a legend, honestly. 🌟


and that's the whole page bestie!! this one shipped with the Debian manual set, dated July 2, 2013 β€” yeah, vintage, but the vibes are timeless. go forth and slay your block devices πŸ’–πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from