DK(4)

πŸ“¦ version 11.0, in nixpkgs unstable

πŸ’– NAME πŸ’–

dk β€” disk partition (wedge) driver. This is the dk(4) page from the Kernel Interfaces Manual, and yes bestie, it's the section-4 one πŸ’….

✨ SYNOPSIS ✨

options DKWEDGE_AUTODISCOVER
options DKWEDGE_METHOD_APPLE
options DKWEDGE_METHOD_BSDLABEL
options DKWEDGE_METHOD_GPT
options DKWEDGE_METHOD_MBR
options DKWEDGE_METHOD_RDB
options DKWEDGE_METHOD_TOS

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so the dk driver gives you a disk-like interface β€” a wedge β€” pointing at some area of a physical disk. It's giving "tiny fake disk with main character energy." Wedges can be configured manually with dkctl(8), or the kernel can set them up automatically when the physical disk attaches. Literal auto-magic ✨.

Wedges need to have unique names. If a duplicate name gets detected during auto-discovery, that partition is ignored. No cap πŸ’€.

πŸ‘‘ KERNEL OPTIONS πŸ‘‘

  • DKWEDGE_AUTODISCOVER β€” automatically detect and configure wedges using any available methods. For each partition found, a wedge with a corresponding name is created.

Currently only DKWEDGE_METHOD_GPT and DKWEDGE_METHOD_APPLE are enabled by default. iykyk πŸ’–

  • DKWEDGE_METHOD_APPLE β€” Apple partition map detection method. 🍎
  • DKWEDGE_METHOD_BSDLABEL β€” BSD disklabel detection method.

For each configured partition in disklabel(5) that is not of type FS_UNUSED, a wedge is created and named after the d_packname field followed by / and the partition letter a..p.

When the d_packname is empty or has the value fictitious, the regular partition names are used as wedge names, i.e. the device name, unit number and partition letter, for example wd0a.

  • DKWEDGE_METHOD_GPT β€” Extensible Firmware Interface Globally Unique Identifier Partition Table (GPT) detection method.

For every GPT partition a wedge is created and named after the partition label. GPT partitions are UTF-16–encoded β€” this is converted into UTF-8. If a partition has no label, its UUID is used instead.

  • DKWEDGE_METHOD_MBR β€” IBM PC-compatible Master Boot Record (MBR) partitioning detection method, with support for Extended MBRs.

For every partition in the MBR a wedge is created and named like a regular partition name, i.e. the device name, unit number and a partition letter, for example wd0e. Primary partitions start with e, extended partitions start with i.

  • DKWEDGE_METHOD_RDB β€” Amiga Rigid Disk Block (RDB) partitioning detection method. πŸŽ€
  • DKWEDGE_METHOD_TOS β€” Atari's TOS partition map detection method, for disks that conform to Atari's AHDI specification.

For each partition, a wedge is created with a name of the format ATARI_{type}_{number} where type may either be GEM or BGM. The number 0 partition typically corresponds to the C: drive when read on an actual Atari, the next to D: and so on. Extended partitions (those of type XGM) are not currently supported.

🌈 FILES 🌈

  • /dev/dk* β€” block mode dk device special files.
  • /dev/rdk* β€” raw mode dk device special files.

πŸŽ€ SEE ALSO πŸŽ€

config(1), disklabel(8), dkctl(8), fdisk(8), gpt(8), and MAKEDEV(8). Go read those too, bestie 🫢.

⭐ HISTORY ⭐

The dk driver first appeared in NetBSD 3.0. Iconic behavior, honestly πŸ‘‘.

πŸ’œ AUTHORS πŸ’œ

The dk driver was written by Jason R. Thorpe. Respect the icon who wrote it πŸ«‘πŸ’œ.


This page's source/version line is Debian, dated April 2, 2024, and it's the DK(4) page β€” mwah, bestie πŸ’‹βœ¨

πŸ“¦ where this page comes from