{
    "mode": "man",
    "parameter": "SFDISK",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/SFDISK/8/json",
    "generated": "2026-05-30T08:15:47Z",
    "synopsis": "sfdisk [options] device [-N partition-number]\nsfdisk [options] command",
    "sections": {
        "NAME": {
            "content": "sfdisk - display or manipulate a disk partition table\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "sfdisk [options] device [-N partition-number]\n\nsfdisk [options] command\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "sfdisk is a script-oriented tool for partitioning any block device. It runs in interactive\nmode if executed on a terminal (stdin refers to a terminal).\n\nSince version 2.26 sfdisk supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer\nprovides any functionality for CHS (Cylinder-Head-Sector) addressing. CHS has never been\nimportant for Linux, and this addressing concept does not make any sense for new devices.\n\nsfdisk protects the first disk sector when create a new disk label. The option --wipe always\ndisables this protection. Note that fdisk(8) and cfdisk(8) completely erase this area by\ndefault.\n\nsfdisk (since version 2.26) aligns the start and end of partitions to block-device I/O limits\nwhen relative sizes are specified, when the default values are used or when multiplicative\nsuffixes (e.g., MiB) are used for sizes. It is possible that partition size will be optimized\n(reduced or enlarged) due to alignment if the start offset is specified exactly in sectors\nand partition size relative or by multiplicative suffixes.\n\nThe recommended way is not to specify start offsets at all and specify partition size in MiB,\nGiB (or so). In this case sfdisk aligns all partitions to block-device I/O limits (or when\nI/O limits are too small then to megabyte boundary to keep disk layout portable). If this\ndefault behaviour is unwanted (usually for very small partitions) then specify offsets and\nsizes in sectors. In this case sfdisk entirely follows specified numbers without any\noptimization.\n\nsfdisk does not create the standard system partitions for SGI and SUN disk labels like\nfdisk(8) does. It is necessary to explicitly create all partitions including whole-disk\nsystem partitions.\n\nsfdisk uses BLKRRPART (reread partition table) ioctl to make sure that the device is not used\nby system or other tools (see also --no-reread). It’s possible that this feature or another\nsfdisk activity races with udevd. The recommended way how to avoid possible collisions is to\nuse --lock option. The exclusive lock will cause udevd to skip the event handling on the\ndevice.\n\nThe sfdisk prompt is only a hint for users and a displayed partition number does not mean\nthat the same partition table entry will be created (if -N not specified), especially for\ntables with gaps.\n",
            "subsections": []
        },
        "COMMANDS": {
            "content": "The commands are mutually exclusive.\n\n[-N partition-number] device\nThe default sfdisk command is to read the specification for the desired partitioning of\ndevice from standard input, and then create a partition table according to the\nspecification. See below for the description of the input format. If standard input is a\nterminal, then sfdisk starts an interactive session.\n\nIf the option -N is specified, then the changes are applied to the partition addressed by\npartition-number. The unspecified fields of the partition are not modified.\n\nNote that it’s possible to address an unused partition with -N. For example, an MBR\nalways contains 4 partitions, but the number of used partitions may be smaller. In this\ncase sfdisk follows the default values from the partition table and does not use built-in\ndefaults for the unused partition given with -N. See also --append.\n",
            "subsections": [
                {
                    "name": "-A --activate",
                    "content": "Switch on the bootable flag for the specified partitions and switch off the bootable flag\non all unspecified partitions. The special placeholder '-' may be used instead of the\npartition numbers to switch off the bootable flag on all partitions.\n\nThe activation command is supported for MBR and PMBR only. If a GPT label is detected,\nthen sfdisk prints warning and automatically enters PMBR.\n\nIf no partition-number is specified, then list the partitions with an enabled flag.\n\n--delete device [partition-number...]\nDelete all or the specified partitions.\n",
                    "flag": "-A",
                    "long": "--activate"
                },
                {
                    "name": "-d --dump",
                    "content": "Dump the partitions of a device in a format that is usable as input to sfdisk. See the\nsection BACKING UP THE PARTITION TABLE.\n",
                    "flag": "-d",
                    "long": "--dump"
                },
                {
                    "name": "-g --show-geometry",
                    "content": "List the geometry of all or the specified devices. For backward compatibility the\ndeprecated option --show-pt-geometry have the same meaning as this one.\n",
                    "flag": "-g",
                    "long": "--show-geometry"
                },
                {
                    "name": "-J --json",
                    "content": "Dump the partitions of a device in JSON format. Note that sfdisk is not able to use JSON\nas input format.\n",
                    "flag": "-J",
                    "long": "--json"
                },
                {
                    "name": "-l --list",
                    "content": "List the partitions of all or the specified devices. This command can be used together\nwith --verify.\n",
                    "flag": "-l",
                    "long": "--list"
                },
                {
                    "name": "-F --list-free",
                    "content": "List the free unpartitioned areas on all or the specified devices.\n\n--part-attrs device partition-number [attributes]\nChange the GPT partition attribute bits. If attributes is not specified, then print the\ncurrent partition settings. The attributes argument is a comma- or space-delimited list\nof bits numbers or bit names. For example, the string \"RequiredPartition,50,51\" sets\nthree bits. The currently supported attribute bits are:\n\nBit 0 (RequiredPartition)\nIf this bit is set, the partition is required for the platform to function. The\ncreator of the partition indicates that deletion or modification of the contents can\nresult in loss of platform features or failure for the platform to boot or operate.\nThe system cannot function normally if this partition is removed, and it should be\nconsidered part of the hardware of the system.\n\nBit 1 (NoBlockIOProtocol)\nEFI firmware should ignore the content of the partition and not try to read from it.\n\nBit 2 (LegacyBIOSBootable)\nThe partition may be bootable by legacy BIOS firmware.\n\nBits 3-47\nUndefined and must be zero. Reserved for expansion by future versions of the UEFI\nspecification.\n\nBits 48-63\nReserved for GUID specific use. The use of these bits will vary depending on the\npartition type. For example Microsoft uses bit 60 to indicate read-only, 61 for\nshadow copy of another partition, 62 for hidden partitions and 63 to disable\nautomount.\n\n--part-label device partition-number [label]\nChange the GPT partition name (label). If label is not specified, then print the current\npartition label.\n\n--part-type device partition-number [type]\nChange the partition type. If type is not specified, then print the current partition\ntype.\n\nThe type argument is hexadecimal for MBR, GUID for GPT, type alias (e.g. \"linux\") or type\nshortcut (e.g. 'L'). For backward compatibility the options -c and --id have the same\nmeaning as this one.\n\n--part-uuid device partition-number [uuid]\nChange the GPT partition UUID. If uuid is not specified, then print the current partition\nUUID.\n\n--disk-id device [id]\nChange the disk identifier. If id is not specified, then print the current identifier.\nThe identifier is UUID for GPT or unsigned integer for MBR.\n",
                    "flag": "-F",
                    "long": "--list-free"
                },
                {
                    "name": "-r --reorder",
                    "content": "Renumber the partitions, ordering them by their start offset.\n",
                    "flag": "-r",
                    "long": "--reorder"
                },
                {
                    "name": "-s --show-size",
                    "content": "List the sizes of all or the specified devices in units of 1024 byte size. This command\nis DEPRECATED in favour of blockdev(8).\n",
                    "flag": "-s",
                    "long": "--show-size"
                },
                {
                    "name": "-T --list-types",
                    "content": "Print all supported types for the current disk label or the label specified by --label.\n",
                    "flag": "-T",
                    "long": "--list-types"
                },
                {
                    "name": "-V --verify",
                    "content": "Test whether the partition table and partitions seem correct.\n\n--relocate oper device\nRelocate partition table header. This command is currently supported for GPT header only.\nThe argument oper can be:\n\ngpt-bak-std\nMove GPT backup header to the standard location at the end of the device.\n\ngpt-bak-mini\nMove GPT backup header behind the last partition. Note that UEFI standard requires\nthe backup header at the end of the device and partitioning tools can automatically\nrelocate the header to follow the standard.\n",
                    "flag": "-V",
                    "long": "--verify"
                }
            ]
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-a --append",
                    "content": "Don’t create a new partition table, but only append the specified partitions.\n\nNote that unused partition maybe be re-used in this case although it is not the last\npartition in the partition table. See also -N to specify entry in the partition table.\n",
                    "flag": "-a",
                    "long": "--append"
                },
                {
                    "name": "-b --backup",
                    "content": "Back up the current partition table sectors before starting the partitioning. The default\nbackup file name is ~/sfdisk-<device>-<offset>.bak; to use another name see option -O,\n--backup-file.\n\n--color[=when]\nColorize the output. The optional argument when can be auto, never or always. If the when\nargument is omitted, it defaults to auto. The colors can be disabled; for the current\nbuilt-in default see the --help output. See also the COLORS section.\n",
                    "flag": "-b",
                    "long": "--backup"
                },
                {
                    "name": "-f --force",
                    "content": "Disable all consistency checking.\n",
                    "flag": "-f",
                    "long": "--force"
                },
                {
                    "name": "--Linux",
                    "content": "Deprecated and ignored option. Partitioning that is compatible with Linux (and other\nmodern operating systems) is the default.\n\n--lock[=mode]\nUse exclusive BSD lock for device or file it operates. The optional argument mode can be\nyes, no (or 1 and 0) or nonblock. If the mode argument is omitted, it defaults to \"yes\".\nThis option overwrites environment variable $LOCKBLOCKDEVICE. The default is not to use\nany lock at all, but it’s recommended to avoid collisions with udevd or other tools.\n",
                    "long": "--Linux"
                },
                {
                    "name": "-n --no-act",
                    "content": "Do everything except writing to the device.\n",
                    "flag": "-n",
                    "long": "--no-act"
                },
                {
                    "name": "--no-reread",
                    "content": "Do not check through the re-read-partition-table ioctl whether the device is in use.\n",
                    "long": "--no-reread"
                },
                {
                    "name": "--no-tell-kernel",
                    "content": "Don’t tell the kernel about partition changes. This option is recommended together with\n--no-reread to modify a partition on used disk. The modified partition should not be used\n(e.g., mounted).\n",
                    "long": "--no-tell-kernel"
                },
                {
                    "name": "-O --backup-file",
                    "content": "Override the default backup file name. Note that the device name and offset are always\nappended to the file name.\n\n--move-data[=path]\nMove data after partition relocation, for example when moving the beginning of a\npartition to another place on the disk. The size of the partition has to remain the same,\nthe new and old location may overlap. This option requires option -N in order to be\nprocessed on one specific partition only.\n\nThe optional path specifies log file name. The log file contains information about all\nread/write operations on the partition data. The word \"@default\" as a path forces sfdisk\nto use ~/sfdisk-<devname>.move for the log. The log is optional since v2.35.\n\nNote that this operation is risky and not atomic. Don’’t forget to backup your data!\n\nSee also --move-use-fsync.\n\nIn the example below, the first command creates a 100MiB free area before the first\npartition and moves the data it contains (e.g., a filesystem), the next command creates a\nnew partition from the free space (at offset 2048), and the last command reorders\npartitions to match disk order (the original sdc1 will become sdc2).\n\necho '+100M,' | sfdisk --move-data /dev/sdc -N 1 echo '2048,' | sfdisk /dev/sdc --append\nsfdisk /dev/sdc --reorder\n",
                    "flag": "-O",
                    "long": "--backup-file"
                },
                {
                    "name": "--move-use-fsync",
                    "content": "Use the fsync(2) system call after each write when moving data to a new location by\n--move-data.\n",
                    "long": "--move-use-fsync"
                },
                {
                    "name": "-o --output",
                    "content": "Specify which output columns to print. Use --help to get a list of all supported columns.\n\nThe default list of columns may be extended if list is specified in the format +list\n(e.g., -o +UUID).\n",
                    "flag": "-o",
                    "long": "--output"
                },
                {
                    "name": "-q --quiet",
                    "content": "Suppress extra info messages.\n",
                    "flag": "-q",
                    "long": "--quiet"
                },
                {
                    "name": "-u --unit",
                    "content": "Deprecated option. Only the sector unit is supported. This option is not supported when\nusing the --show-size command.\n",
                    "flag": "-u",
                    "long": "--unit"
                },
                {
                    "name": "-X --label",
                    "content": "Specify the disk label type (e.g., dos, gpt, ...). If this option is not given, then\nsfdisk defaults to the existing label, but if there is no label on the device yet, then\nthe type defaults to dos. The default or the current label may be overwritten by the\n\"label: <name>\" script header line. The option --label does not force sfdisk to create\nempty disk label (see the EMPTY DISK LABEL section below).\n",
                    "flag": "-X",
                    "long": "--label"
                },
                {
                    "name": "-Y --label-nested",
                    "content": "Force editing of a nested disk label. The primary disk label has to exist already. This\noption allows editing for example a hybrid/protective MBR on devices with GPT.\n",
                    "flag": "-Y",
                    "long": "--label-nested"
                },
                {
                    "name": "-w --wipe",
                    "content": "Wipe filesystem, RAID and partition-table signatures from the device, in order to avoid\npossible collisions. The argument when can be auto, never or always. When this option is\nnot given, the default is auto, in which case signatures are wiped only when in\ninteractive mode; except the old partition-table signatures which are always wiped before\ncreate a new partition-table if the argument when is not never. The auto mode also does\nnot wipe the first sector (boot sector), it is necessary to use the always mode to wipe\nthis area. In all cases detected signatures are reported by warning messages before a new\npartition table is created. See also the wipefs(8) command.\n",
                    "flag": "-w",
                    "long": "--wipe"
                },
                {
                    "name": "-W --wipe-partitions",
                    "content": "Wipe filesystem, RAID and partition-table signatures from a newly created partitions, in\norder to avoid possible collisions. The argument when can be auto, never or always. When\nthis option is not given, the default is auto, in which case signatures are wiped only\nwhen in interactive mode and after confirmation by user. In all cases detected signatures\nare reported by warning messages after a new partition is created. See also wipefs(8)\ncommand.\n",
                    "flag": "-W",
                    "long": "--wipe-partitions"
                },
                {
                    "name": "-v --version",
                    "content": "Display version information and exit.\n",
                    "flag": "-v",
                    "long": "--version"
                },
                {
                    "name": "-h --help",
                    "content": "Display help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                }
            ]
        },
        "INPUT FORMATS": {
            "content": "sfdisk supports two input formats and generic header lines.\n",
            "subsections": [
                {
                    "name": "Header lines",
                    "content": "The optional header lines specify generic information that apply to the partition table. The\nheader-line format is:\n"
                },
                {
                    "name": "<name>: <value>",
                    "content": "The currently recognized headers are:\n"
                },
                {
                    "name": "unit",
                    "content": "Specify the partitioning unit. The only supported unit is sectors.\n"
                },
                {
                    "name": "label",
                    "content": "Specify the partition table type. For example dos or gpt.\n"
                },
                {
                    "name": "label-id",
                    "content": "Specify the partition table identifier. It should be a hexadecimal number (with a 0x\nprefix) for MBR and a UUID for GPT.\n"
                },
                {
                    "name": "first-lba",
                    "content": "Specify the first usable sector for GPT partitions.\n"
                },
                {
                    "name": "last-lba",
                    "content": "Specify the last usable sector for GPT partitions.\n"
                },
                {
                    "name": "table-length",
                    "content": "Specify the maximal number of GPT partitions.\n"
                },
                {
                    "name": "grain",
                    "content": "Specify minimal size in bytes used to calculate partitions alignment. The default is 1MiB\nand it’s strongly recommended to use the default. Do not modify this variable if you’re\nnot sure.\n"
                },
                {
                    "name": "sector-size",
                    "content": "Specify sector size. This header is informative only and it is not used when sfdisk\ncreates a new partition table, in this case the real device specific value is always used\nand sector size from the dump is ignored.\n\nNote that it is only possible to use header lines before the first partition is specified in\nthe input.\n"
                },
                {
                    "name": "Unnamed-fields format",
                    "content": "start size type bootable\n\nwhere each line fills one partition descriptor.\n\nFields are separated by whitespace, comma or semicolon possibly followed by whitespace;\ninitial and trailing whitespace is ignored. Numbers can be octal, decimal or hexadecimal;\ndecimal is the default. When a field is absent, empty or specified as '-' a default value is\nused. But when the -N option (change a single partition) is given, the default for each field\nis its previous value.\n\nThe default value of start is the first non-assigned sector aligned according to device I/O\nlimits. The default start offset for the first partition is 1 MiB. The offset may be followed\nby the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB) then the number is\ninterpreted as offset in bytes.\n\nThe default value of size indicates \"as much as possible\"; i.e., until the next partition or\nend-of-device. A numerical argument is by default interpreted as a number of sectors, however\nif the size is followed by one of the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB,\nZiB and YiB) then the number is interpreted as the size of the partition in bytes and it is\nthen aligned according to the device I/O limits. A '+' can be used instead of a number to\nenlarge the partition as much as possible. Note '+' is equivalent to the default behaviour\nfor a new partition; existing partitions will be resized as required.\n\nThe partition type is given in hex for MBR (DOS) where 0x prefix is optional; a GUID string\nfor GPT; a shortcut or an alias. It’s recommended to use two letters for MBR hex codes to\navoid collision between deprecated shortcut 'E' and '0E' MBR hex code. For backward\ncompatibility sfdisk tries to interpret type as a shortcut as a first possibility in\npartitioning scripts although on other places (e.g. --part-type command) it tries shortcuts\nas the last possibility.\n\nSince v2.36 libfdisk supports partition type aliases as extension to shortcuts. The alias is\na simple human readable word (e.g. \"linux\").\n\nSince v2.37 libfdisk supports partition type names on input, ignoring the case of the\ncharacters and all non-alphanumeric and non-digit characters in the name (e.g. \"Linux /usr\nx86\" is the same as \"linux usr-x86\").\n\nSupported shortcuts and aliases:\n"
                },
                {
                    "name": "L - alias 'linux'",
                    "content": "Linux; means 83 for MBR and 0FC63DAF-8483-4772-8E79-3D69D8477DE4 for GPT.\n"
                },
                {
                    "name": "S - alias 'swap'",
                    "content": "swap area; means 82 for MBR and 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F for GPT\n"
                },
                {
                    "name": "Ex - alias 'extended'",
                    "content": "MBR extended partition; means 05 for MBR. The original shortcut 'E' is deprecated due to\ncollision with 0x0E MBR partition type.\n"
                },
                {
                    "name": "H - alias 'home'",
                    "content": "home partition; means 933AC7E1-2EB4-4F13-B844-0E14E2AEF915 for GPT\n"
                },
                {
                    "name": "U - alias 'uefi'",
                    "content": "EFI System partition, means EF for MBR and C12A7328-F81F-11D2-BA4B-00A0C93EC93B for GPT\n"
                },
                {
                    "name": "R - alias 'raid'",
                    "content": "Linux RAID; means FD for MBR and A19D880F-05FC-4D3B-A006-743F0F84911E for GPT\n"
                },
                {
                    "name": "V - alias 'lvm'",
                    "content": "LVM; means 8E for MBR and E6D6D379-F507-44C2-A23C-238F2A3DF928 for GPT\n\nThe default type value is linux.\n\nThe shortcut 'X' for Linux extended partition (85) is deprecated in favour of 'Ex'.\n\nbootable is specified as [*|-], with as default not-bootable. The value of this field is\nirrelevant for Linux - when Linux runs it has been booted already - but it might play a role\nfor certain boot loaders and for other operating systems.\n"
                },
                {
                    "name": "Named-fields format",
                    "content": "This format is more readable, robust, extensible and allows specifying additional information\n(e.g., a UUID). It is recommended to use this format to keep your scripts more readable.\n\n[device :] name[=value], ...\n\nThe device field is optional. sfdisk extracts the partition number from the device name. It\nallows specifying the partitions in random order. This functionality is mostly used by\n--dump. Don’t use it if you are not sure.\n\nThe value can be between quotation marks (e.g., name=\"This is partition name\"). The currently\nsupported fields are:\n\nstart=number\nThe first non-assigned sector aligned according to device I/O limits. The default start\noffset for the first partition is 1 MiB. The offset may be followed by the multiplicative\nsuffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB) then the number is interpreted as\noffset in bytes.\n\nsize=number\nSpecify the partition size in sectors. The number may be followed by the multiplicative\nsuffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB), then it’s interpreted as size in\nbytes and the size is aligned according to device I/O limits.\n"
                },
                {
                    "name": "bootable",
                    "content": "Mark the partition as bootable.\n\nattrs=string\nPartition attributes, usually GPT partition attribute bits. See --part-attrs for more\ndetails about the GPT-bits string format.\n\nuuid=string\nGPT partition UUID.\n\nname=string\nGPT partition name.\n\ntype=code\nA hexadecimal number (without 0x) for an MBR partition, a GUID for a GPT partition, a\nshortcut as for unnamed-fields format or a type name (e.g. type=\"Linux /usr (x86)\"). See\nabove the section about the unnamed-fields format for more details. For backward\ncompatibility the Id= field has the same meaning.\n"
                }
            ]
        },
        "EMPTY DISK LABEL": {
            "content": "sfdisk does not create partition table without partitions by default. The lines with\npartitions are expected in the script by default. The empty partition table has to be\nexplicitly requested by \"label: <name>\" script header line without any partitions lines. For\nexample:\n\necho 'label: gpt' | sfdisk /dev/sdb\n\ncreates empty GPT partition table. Note that the --append disables this feature.\n",
            "subsections": []
        },
        "BACKING UP THE PARTITION TABLE": {
            "content": "It is recommended to save the layout of your devices. sfdisk supports two ways.\n\nUse the --dump option to save a description of the device layout to a text file. The dump\nformat is suitable for later sfdisk input. For example:\n\nsfdisk --dump /dev/sda > sda.dump\n\nThis can later be restored by:\n\nsfdisk /dev/sda < sda.dump\n\nIf you want to do a full (binary) backup of all sectors where the partition table is stored,\nthen use the --backup option. It writes the sectors to ~/sfdisk-<device>-<offset>.bak files.\nThe default name of the backup file can be changed with the --backup-file option. The backup\nfiles contain only raw data from the device. Note that the same concept of backup files is\nused by wipefs(8). For example:\n\nsfdisk --backup /dev/sda\n\nThe GPT header can later be restored by:\n\ndd  if=~/sfdisk-sda-0x00000200.bak  of=/dev/sda  \\ seek=$0x00000200  bs=1\nconv=notrunc\n\nNote that sfdisk since version 2.26 no longer provides the -I option to restore sectors.\ndd(1) provides all necessary functionality.\n",
            "subsections": []
        },
        "COLORS": {
            "content": "Implicit coloring can be disabled by an empty file /etc/terminal-colors.d/sfdisk.disable.\n\nSee terminal-colors.d(5) for more details about colorization configuration. The logical color\nnames supported by sfdisk are:\n",
            "subsections": [
                {
                    "name": "header",
                    "content": "The header of the output tables.\n"
                },
                {
                    "name": "warn",
                    "content": "The warning messages.\n"
                },
                {
                    "name": "welcome",
                    "content": "The welcome message.\n"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "SFDISKDEBUG=all\nenables sfdisk debug output.\n\nLIBFDISKDEBUG=all\nenables libfdisk debug output.\n\nLIBBLKIDDEBUG=all\nenables libblkid debug output.\n\nLIBSMARTCOLSDEBUG=all\nenables libsmartcols debug output.\n\nLOCKBLOCKDEVICE=<mode>\nuse exclusive BSD lock. The mode is \"1\" or \"0\". See --lock for more details.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "Since version 2.26 sfdisk no longer provides the -R or --re-read option to force the kernel\nto reread the partition table. Use blockdev --rereadpt instead.\n\nSince version 2.26 sfdisk does not provide the --DOS, --IBM, --DOS-extended, --unhide,\n--show-extended, --cylinders, --heads, --sectors, --inside-outer, --not-inside-outer options.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Karel Zak <kzak@redhat.com>\n\nThe current sfdisk implementation is based on the original sfdisk from Andries E. Brouwer.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "fdisk(8), cfdisk(8), parted(8), partprobe(8), partx(8)\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "For bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "The sfdisk command is part of the util-linux package which can be downloaded from Linux\nKernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-07-20                                    SFDISK(8)",
            "subsections": []
        }
    },
    "summary": "sfdisk - display or manipulate a disk partition table",
    "flags": [
        {
            "flag": "-a",
            "long": "--append",
            "arg": null,
            "description": "Don’t create a new partition table, but only append the specified partitions. Note that unused partition maybe be re-used in this case although it is not the last partition in the partition table. See also -N to specify entry in the partition table."
        },
        {
            "flag": "-b",
            "long": "--backup",
            "arg": null,
            "description": "Back up the current partition table sectors before starting the partitioning. The default backup file name is ~/sfdisk-<device>-<offset>.bak; to use another name see option -O, --backup-file. --color[=when] Colorize the output. The optional argument when can be auto, never or always. If the when argument is omitted, it defaults to auto. The colors can be disabled; for the current built-in default see the --help output. See also the COLORS section."
        },
        {
            "flag": "-f",
            "long": "--force",
            "arg": null,
            "description": "Disable all consistency checking."
        },
        {
            "flag": "",
            "long": "--Linux",
            "arg": null,
            "description": "Deprecated and ignored option. Partitioning that is compatible with Linux (and other modern operating systems) is the default. --lock[=mode] Use exclusive BSD lock for device or file it operates. The optional argument mode can be yes, no (or 1 and 0) or nonblock. If the mode argument is omitted, it defaults to \"yes\". This option overwrites environment variable $LOCKBLOCKDEVICE. The default is not to use any lock at all, but it’s recommended to avoid collisions with udevd or other tools."
        },
        {
            "flag": "-n",
            "long": "--no-act",
            "arg": null,
            "description": "Do everything except writing to the device."
        },
        {
            "flag": "",
            "long": "--no-reread",
            "arg": null,
            "description": "Do not check through the re-read-partition-table ioctl whether the device is in use."
        },
        {
            "flag": "",
            "long": "--no-tell-kernel",
            "arg": null,
            "description": "Don’t tell the kernel about partition changes. This option is recommended together with --no-reread to modify a partition on used disk. The modified partition should not be used (e.g., mounted)."
        },
        {
            "flag": "-O",
            "long": "--backup-file",
            "arg": null,
            "description": "Override the default backup file name. Note that the device name and offset are always appended to the file name. --move-data[=path] Move data after partition relocation, for example when moving the beginning of a partition to another place on the disk. The size of the partition has to remain the same, the new and old location may overlap. This option requires option -N in order to be processed on one specific partition only. The optional path specifies log file name. The log file contains information about all read/write operations on the partition data. The word \"@default\" as a path forces sfdisk to use ~/sfdisk-<devname>.move for the log. The log is optional since v2.35. Note that this operation is risky and not atomic. Don’’t forget to backup your data! See also --move-use-fsync. In the example below, the first command creates a 100MiB free area before the first partition and moves the data it contains (e.g., a filesystem), the next command creates a new partition from the free space (at offset 2048), and the last command reorders partitions to match disk order (the original sdc1 will become sdc2). echo '+100M,' | sfdisk --move-data /dev/sdc -N 1 echo '2048,' | sfdisk /dev/sdc --append sfdisk /dev/sdc --reorder"
        },
        {
            "flag": "",
            "long": "--move-use-fsync",
            "arg": null,
            "description": "Use the fsync(2) system call after each write when moving data to a new location by --move-data."
        },
        {
            "flag": "-o",
            "long": "--output",
            "arg": null,
            "description": "Specify which output columns to print. Use --help to get a list of all supported columns. The default list of columns may be extended if list is specified in the format +list (e.g., -o +UUID)."
        },
        {
            "flag": "-q",
            "long": "--quiet",
            "arg": null,
            "description": "Suppress extra info messages."
        },
        {
            "flag": "-u",
            "long": "--unit",
            "arg": null,
            "description": "Deprecated option. Only the sector unit is supported. This option is not supported when using the --show-size command."
        },
        {
            "flag": "-X",
            "long": "--label",
            "arg": null,
            "description": "Specify the disk label type (e.g., dos, gpt, ...). If this option is not given, then sfdisk defaults to the existing label, but if there is no label on the device yet, then the type defaults to dos. The default or the current label may be overwritten by the \"label: <name>\" script header line. The option --label does not force sfdisk to create empty disk label (see the EMPTY DISK LABEL section below)."
        },
        {
            "flag": "-Y",
            "long": "--label-nested",
            "arg": null,
            "description": "Force editing of a nested disk label. The primary disk label has to exist already. This option allows editing for example a hybrid/protective MBR on devices with GPT."
        },
        {
            "flag": "-w",
            "long": "--wipe",
            "arg": null,
            "description": "Wipe filesystem, RAID and partition-table signatures from the device, in order to avoid possible collisions. The argument when can be auto, never or always. When this option is not given, the default is auto, in which case signatures are wiped only when in interactive mode; except the old partition-table signatures which are always wiped before create a new partition-table if the argument when is not never. The auto mode also does not wipe the first sector (boot sector), it is necessary to use the always mode to wipe this area. In all cases detected signatures are reported by warning messages before a new partition table is created. See also the wipefs(8) command."
        },
        {
            "flag": "-W",
            "long": "--wipe-partitions",
            "arg": null,
            "description": "Wipe filesystem, RAID and partition-table signatures from a newly created partitions, in order to avoid possible collisions. The argument when can be auto, never or always. When this option is not given, the default is auto, in which case signatures are wiped only when in interactive mode and after confirmation by user. In all cases detected signatures are reported by warning messages after a new partition is created. See also wipefs(8) command."
        },
        {
            "flag": "-v",
            "long": "--version",
            "arg": null,
            "description": "Display version information and exit."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Display help text and exit."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "fdisk",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/fdisk/8/json"
        },
        {
            "name": "cfdisk",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/cfdisk/8/json"
        },
        {
            "name": "parted",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/parted/8/json"
        },
        {
            "name": "partprobe",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/partprobe/8/json"
        },
        {
            "name": "partx",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/partx/8/json"
        }
    ]
}