HFORMAT(1)

πŸ’– HFORMAT(1) β€” the manual page, but make it cute πŸ’–

General Commands Manual · hformat · bestie edition ✨


✨ NAME ✨

hformat β€” create a new HFS filesystem and make it current

okay so basically: you want a brand new HFS filesystem? This is the girl. She writes it, she sets it up, she makes it current so everything after this just knows where to look. πŸ‘‘


🌸 SYNOPSIS 🌸

hformat [-f] [-l label] destination-path [partition-no]

πŸ¦‹ DESCRIPTION πŸ¦‹

hformat is the one who writes a whole new HFS filesystem onto a volume. Periodt.

You have to give her a UNIX pathname to the volume's destination. That destination can be either a block device or a regular file β€” either is fine, she's not picky β€” but it must already exist and be writable. She does not create the destination for you, bestie. That's on you. 😭

You can optionally give the volume a label, because naming things is self-care. The name must be between 1-27 characters and cannot contain a colon (:). Colon is not invited to this party. By default, the volume will be named Untitled (she's humble like that).

If the destination medium is partitioned, one partition has to be chosen to receive the filesystem. If there's only one HFS partition on the medium, she'll just pick it for you, no thoughts needed. Otherwise, you have to say which partition you want on the command line β€” as the ordinal *n*th HFS partition. And the size of that partition? That's what determines the size of the resulting volume. Simple math, slay. πŸ’…

Partition number 0 is special: specify it and you're formatting the entire medium as a single filesystem, no partition map at all, erasing any existing partition information. Iconic but also kind of scary β€” this destroys all the partitions. So if the medium currently has a partition map, you must pass -f to force this. No -f, no dice.

If the medium isn't partitioned (or if you specified partition 0), then the size or capacity of the medium is what determines the size of the resulting volume. Whatever the medium's giving, that's what you get. 🌈

The new volume will be empty, and it will become "current" so all your subsequent commands refer to it. The current working directory for the volume gets set to the root of the volume. Main character energy, honestly. ✨


πŸŽ€ OPTIONS πŸŽ€

  • -f β€” force the operation. Specifically you need this when you're formatting the whole medium as one filesystem (partition 0) while it still has a partition map, because that's about to nuke every partition and she wants you to mean it. 🫢
  • -l label β€” name the volume. 1-27 characters, no colons allowed. Defaults to Untitled if you don't say anything.

(And then the positional ones:)

  • destination-path β€” the UNIX pathname to the volume. Block device or regular file, but it must already exist and be writable.
  • partition-no β€” which HFS partition (ordinal) to format. Optional if there's exactly one HFS partition on the medium. 0 means "whole medium, no partition map," and needs -f if a partition map is already there.

🌟 EXAMPLES 🌟

% hformat /dev/fd0

If a floppy disk is available as /dev/fd0, this formats the disk as an HFS volume named Untitled. (N.B. The floppy must already have received a low-level format by other means.)


% dd if=/dev/zero of=disk.hfs bs=1k count=800
% hformat -l "Test Disk" disk.hfs

This sequence creates an 800K HFS volume image in the file disk.hfs in the current directory, and names it Test Disk. πŸ“


% hformat -l "Loma Prieta" /dev/sd2 1

If a SCSI disk is available as /dev/sd2, this initializes the first HFS partition on the disk (which must already exist) with a new filesystem, naming the resulting volume Loma Prieta.


% hformat -f /dev/sd2 0

This causes the medium accessible as /dev/sd2 to be reformatted as a single HFS volume, ignoring and erasing any existing partition information on the medium. The -f option must be specified if the medium is currently partitioned; otherwise the command will fail. πŸ’€


🧚 NOTES 🧚

This command does not create or alter partition maps β€” although it can erase them (as described above). Any partition number you specify on the command line must already exist. She's a formatter, not a partition-maker. iykyk.

The smallest volume size which can be formatted with hformat is 800K. That's the floor, bestie, no going lower. πŸ™ˆ


🌈 SEE ALSO 🌈

hfsutils(1), hmount(1)


πŸ’œ FILES πŸ’œ

$HOME/.hcwd


πŸ‘‘ AUTHOR πŸ‘‘

Robert Leslie <rob@mars.org>


HFSUTILS Β· 08-Nov-1997

and that's the whole page, bestie πŸ’– thanks for reading, go format something responsibly (or at least with -f) πŸŽ€βœ¨πŸ¦‹