CCDCONFIG(8)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’… CCDCONFIG(8) β€” like, the ccd config utility, bestie

okay so picture this: it's the System Manager's Manual section 8, and we're talking about ccdconfig, the configuration utility for the concatenated disk driver. yes she's a whole vibe. let's get into it πŸŽ€

✨ SYNOPSIS ✨

ccdconfig [-cv] ccd ileave [flags] dev ...
ccdconfig -C [-v] [-f config_file]
ccdconfig -u [-v] ccd ...
ccdconfig -U [-v] [-f config_file]
ccdconfig -g [ccd ...]

🌸 DESCRIPTION 🌸

The ccdconfig utility is used to dynamically configure and unconfigure concatenated disk devices, aka ccds. like, she sets them up and she tears them down, no biggie. if you want more deets about what a ccd even is, go read ccd(4). iykyk πŸ’–

The options are as follows, and yes we're listing every single one because that's the whole point:

  • -c β€” Configure a ccd. this is literally the default behavior of ccdconfig, so she's doing it anyway, but you can say it out loud if it makes you feel powerful πŸ‘‘
  • -C β€” Configure all ccd devices listed in the ccd configuration file. all of them. every last one. ate.
  • -f config_file β€” When configuring or unconfiguring all devices, read the file config_file instead of the default /etc/ccd.conf. your file, your rules, periodt.
  • -g β€” Dump the current ccd configuration in a format suitable for use as the ccd configuration file. If no arguments are specified, every configured ccd is dumped. Otherwise, the configuration of each listed ccd is dumped. it's giving "copy me into your config" energy ✨
  • -u β€” Unconfigure a ccd. bye bestie πŸ‘‹
  • -U β€” Unconfigure all ccd devices listed the ccd configuration file. (yes, that's how the original words it, we're keeping it, no notes πŸ’€)
  • -v β€” Cause ccdconfig to be verbose. she will talk. and honestly? love that for her.

A ccd is described on the command line and in the ccd configuration file by the name of the ccd, the interleave factor, the ccd configuration flags, and a list of one or more devices. The flags may be represented as a decimal number, a hexadecimal number, a comma-separated list of strings, or the word none. flexible queen 🌈

The flags are as follows:

  • CCDF_UNIFORM β€” 0x02 β€” Use uniform interleave
  • CCDF_MIRROR β€” 0x04 β€” Support mirroring
  • CCDF_NO_OFFSET β€” 0x08 β€” Do not use an offset
  • CCDF_LINUX β€” 0x0A β€” Linux md(4) compatibility

The format in the configuration file appears exactly as if it were entered on the command line. Note that on the command line and in the configuration file, the flags argument is optional. so you can just... not. slay.

#
# /etc/ccd.conf
# Configuration file for concatenated disk devices
#

# ccd           ileave  flags   component devices
ccd0            16      none    /dev/da2s1 /dev/da3s1

If you want to use the Linux md(4) compatibility mode, please be sure to read the notes in ccd(4). like actually read them. i'm serious. don't skip the notes πŸ™ˆ


πŸ¦‹ FILES πŸ¦‹

  • /etc/ccd.conf β€” default ccd configuration file

πŸ’œ EXAMPLES πŸ’œ

A number of ccdconfig examples are shown below. The arguments passed to ccdconfig are exactly the same as you might place in the /etc/ccd.conf configuration file. okay so:

The first example creates a 4-disk stripe out of four scsi disk partitions. The stripe uses a 64-sector interleave.

The second example is an example of a complex stripe/mirror combination. It reads as a two disk stripe of da4 and da5 which is mirrored to a two disk stripe of da6 and da7.

The last example is a simple mirror. The second slice of /dev/da8 is mirrored with the third slice of /dev/da9 and assigned to ccd0.

# ccdconfig ccd0 64 none /dev/da0s1 /dev/da1s1 /dev/da2s1 /dev/da3s1
# ccdconfig ccd0 128 CCDF_MIRROR /dev/da4 /dev/da5 /dev/da6 /dev/da7
# ccdconfig ccd0 128 CCDF_MIRROR /dev/da8s2 /dev/da9s3

The following are matching commands in Linux and FreeBSD to create a RAID-0 in Linux and read it from FreeBSD. cross-platform bestie behavior fr fr 🫢

# Create a RAID-0 on Linux:
mdadm --create --chunk=32 --level=0 --raid-devices=2 /dev/md0 \
   /dev/hda1 /dev/hdb1
# Make the RAID-0 just created available on FreeBSD:
ccdconfig -c /dev/ccd0 32 linux /dev/ada0s1 /dev/ada0s2

When you create a new ccd disk you generally want to partition it using gpart(8) it before doing anything else. (yes, "using gpart(8) it" β€” that's the original wording, we stan a quirky sentence 😭)

⚠️ Beware, and i mean this with my whole chest: changing any ccd parameters β€” interleave, flags, or the device list making up the ccd disk β€” will usually destroy any prior data on that ccd disk. like, gone. If this occurs it is usually a good idea to reinitialize the label before [re]constructing your ccd disk. do not skip this step, bestie, i am begging πŸ’€

πŸ”₯ RECOVERY πŸ”₯

An error on a ccd disk is usually unrecoverable unless you are using the mirroring option. harsh but true πŸ˜”

But mirroring has its own perils: It assumes that both copies of the data at any given sector are the same. This holds true until a write error occurs or until you replace either side of the mirror. This is a poor-man's mirroring implementation. It works well enough that if you begin to get disk errors you should be able to backup the ccd disk, replace the broken hardware, and then regenerate the ccd disk. lowkey iconic for what it is, ngl πŸ’…

If you need more than this you should look into external hardware RAID SCSI boxes, RAID controllers (see GENERIC), or software RAID systems such as graid(8) or zfs(8). level up, basically ⭐


πŸ‘‘ SEE ALSO πŸ‘‘

dd(1), ccd(4), gpart(8), graid(8), rc(8), zfs(8)

go read them, they're all part of the lore πŸ¦‹


🌈 HISTORY 🌈

The ccdconfig utility first appeared in NetBSD 1.1. she's been around. a true main character since day one πŸ’–


okay that's the whole page!! this one's from Debian, dated January 23, 2025 β€” mwah, xoxo, go configure your disks responsibly πŸŽ€βœ¨πŸ’œ

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms