SETUP-DISK(8)

๐Ÿ“ฆ version 3.22.0, in alpine 3.24

๐Ÿ’ฟ setup-disk(8) โ€” the System Manager's Manual, but make it cute โœจ

okay so bestie, you're reading the System Manager's Manual page for setup-disk, section 8, and honestly? this one's a whole vibe. it installs Alpine Linux. to a disk. or to a mounted root. let's get into it ๐Ÿ’…


๐ŸŒธ NAME

setup-disk โ€” install Alpine Linux to disk or mounted root ๐Ÿซถ


โœจ SYNOPSIS

setup-disk [-hLqrve] [-b DISKDEV] [-B BOOTLOADER] [-k KERNELFLAVOR]
setup-disk [-m MODE] [-o APKOVL] [-R ROOT_SIZE] [-s SWAP_SIZE]
setup-disk [-w FILE] [MOUNTPOINT | DISKDEV...]

like, three whole ways to summon it. pick your fighter ๐ŸŽ€


๐Ÿฆ‹ DESCRIPTION

setup-disk installs Alpine Linux to a mounted root, or it gets one or more block devices all prepped and ready for a system installation or a data-only installation. lowkey does it all ๐Ÿ’–

If you hand it a MOUNTPOINT, setup-disk installs Alpine Linux into that mounted root and sets up bootloader support for you. considerate queen behavior ๐Ÿ‘‘

With disk device arguments, the disks get partitioned and formatted without prompting โ€” no "are you sure", no little confirmation dance, it just goes. and if you pass multiple disks? they get configured as a software RAID array: two disks use RAID1, and more than two disks use RAID5. math! we love her ๐Ÿงฎโœจ

If you specify no target at all, setup-disk lists the available disks and prompts you for the target disk and the install mode. very "let's figure this out together" of it ๐ŸŒˆ

โš ๏ธ bestie, listen to me very carefully: the selected disk devices are erased. gone. wiped. do NOT point this at a disk you like. ๐Ÿ˜ญ๐Ÿ’€

๐ŸŽ€ MODES

  • sys โ€” do a traditional disk install. the target disk is used for the operating system and normally receives boot, root, and swap storage. the classic. the icon. the main character ๐Ÿ‘‘
  • data โ€” use the target disk for persistent data storage while the operating system keeps running from tmpfs. storage bestie, separate from the OS ๐Ÿ“
  • crypt โ€” enable encryption and then prompt you again for sys or data mode. yes, it asks twice. it's thorough ๐Ÿ’œ
  • cryptsys โ€” sys mode, but with encryption enabled. no second prompt, we're being decisive โœจ
  • lvm โ€” enable LVM and prompt again for sys or data mode ๐Ÿฆ‹
  • lvmsys โ€” sys mode with LVM enabled ๐Ÿ”ฅ
  • lvmdata โ€” data mode with LVM enabled ๐ŸŒธ
  • none โ€” exit without installing to disk. the "actually, never mind" option, and honestly? valid ๐Ÿ™ˆ

๐Ÿ’… OPTIONS

  • -b DISKDEV โ€” install the bootloader to DISKDEV when installing to a mounted root. you can specify this bad boy multiple times, stack 'em up ๐Ÿซถ
  • -B BOOTLOADER โ€” use BOOTLOADER instead of the default. supported values: grub, syslinux, zipl, raspberrypi-bootloader, u-boot, limine, none. choose your own adventure โญ
  • -e โ€” encrypt the disk using LUKS. secret agent mode activated ๐Ÿ”โœจ
  • -h โ€” display usage information and exit. the polite escape hatch ๐ŸŽ€
  • -k KERNELFLAVOR โ€” use KERNELFLAVOR instead of the detected kernel flavor ๐Ÿงš
  • -L โ€” use LVM to manage partitions ๐Ÿฆ‹
  • -m MODE โ€” use MODE without prompting. valid non-interactive modes are sys, data, and none. (that's the whole non-interactive list, no extras, don't @ me) ๐Ÿ‘‘
  • -o APKOVL โ€” restore the system from the specified apkovl file ๐Ÿ’พ
  • -q โ€” exit quietly if no disks are found. no drama, no message, just vibes ๐Ÿ“
  • -r โ€” enable software RAID1 with a single disk. one disk, RAID energy ๐ŸŒˆ
  • -R ROOT_SIZE โ€” use ROOT_SIZE MB for the root filesystem instead of maximizing its size ๐Ÿ“
  • -s SWAP_SIZE โ€” use SWAP_SIZE MB for swap instead of autodetecting the swap size. use 0 to disable swap entirely ๐Ÿšซ๐Ÿ’ค
  • -v โ€” print more information about what is happening. lore drops, but for your disk ๐Ÿ’ฌ๐Ÿ”ฅ
  • -w FILE โ€” write the selected install mode to FILE ๐Ÿ“

๐ŸŒˆ ENVIRONMENT

  • BOOTLOADER โ€” select the bootloader. supported values are grub, syslinux, zipl, raspberrypi-bootloader, u-boot, limine, and none. if unset, a default is selected from the architecture and boot environment. and heads up: the -B option takes precedence over this variable ๐Ÿ‘€
  • BOOTFS, ROOTFS, VARFS โ€” select filesystems for boot, root, and var storage. the default is ext4. supported boot filesystems are ext2, ext3, ext4, btrfs, xfs, and vfat for EFI. root and var support the same list except vfat. sorry vfat, this isn't your department ๐Ÿ’…
  • DISKLABEL โ€” select the partition label. supported values are dos and gpt. the default is dos, except EFI installations use gpt. ECKD DASD disks use eckd automatically โ€” it just knows ๐Ÿงšโ€โ™€๏ธ
  • KERNELOPTS โ€” append kernel boot parameters. the default is quiet ๐Ÿคซ
  • DEFAULT_DISK โ€” device name proposed by default in interactive disk selection ๐ŸŽฏ
  • ERASE_DISKS โ€” space-separated full device paths that may be processed without the confirmation dialog. key word: full device paths. be sooooo careful with this one ๐Ÿ˜ญ
  • USE_EFI โ€” force EFI behavior. this selects gpt partitioning and a vfat boot filesystem โœจ

๐Ÿงš EXAMPLES

install to /dev/sda in system mode:

setup-disk -m sys /dev/sda

install to /dev/sda without swap:

setup-disk -m sys -s 0 /dev/sda

install to two disks using RAID:

setup-disk -m sys /dev/sda /dev/sdb

install into a mounted root and install the bootloader to /dev/sda:

setup-disk -b /dev/sda /mnt

use Limine as the bootloader:

setup-disk -B limine -m sys /dev/sda

ate. no crumbs. ๐Ÿ”ฅ


โญ EXIT STATUS

  • 0 โ€” success. we love a happy ending ๐Ÿ’–
  • non-zero โ€” an error occurred. it happens to the best of us ๐Ÿ˜ญ

๐Ÿ”ฅ SEE ALSO

lbu(8), setup-alpine(8), setup-bootable(8), setup-lbu(8), setup-apkcache(8), update-kernel(8) โ€” the whole friend group, go say hi ๐Ÿซถ


๐Ÿ‘‘ AUTHORS

Natanael Copa <ncopa@alpinelinux.org> and others ๐Ÿ’œ


and that's the page!! this was written for Alpine Linux, dated 2026-06-09, under the SETUP-DISK(8) header โ€” mwah, go forth and install responsibly bestie ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from