最終更新:2023-12-05 (火) 05:19:44 (142d)  

fdisk
Top / fdisk

manipulate disk partition table

fdisk /dev/hda
Command (m for help): m

Help:

  DOS (MBR)
   a   toggle a bootable flag
   b   edit nested BSD disklabel
   c   toggle the dos compatibility flag

  Generic
   d   delete a partition
   F   list free unpartitioned space
   l   list known partition types
   n   add a new partition
   p   print the partition table
   t   change a partition type
   v   verify the partition table
   i   print information about a partition

  Misc
   m   print this menu
   u   change display/entry units
   x   extra functionality (experts only)

  Script
   I   load disk layout from sfdisk script file
   O   dump disk layout to sfdisk script file

  Save & Exit
   w   write table to disk and exit
   q   quit without saving changes

  Create a new label
   g   create a new empty GPT partition table
   G   create a new empty SGI (IRIX) partition table
   o   create a new empty DOS partition table
   s   create a new empty Sun partition table

help

  • Usage:
     fdisk [options] <disk>      change partition table
     fdisk [options] -l [<disk>] list partition table(s)
    
    Display or manipulate a disk partition table.
    
    Options:
     -b, --sector-size <size>      physical and logical sector size
     -B, --protect-boot            don't erase bootbits when creating a new label
     -c, --compatibility[=<mode>]  mode is 'dos' or 'nondos' (default)
     -L, --color[=<when>]          colorize output (auto, always or never)
                                     colors are enabled by default
     -l, --list                    display partitions and exit
     -o, --output <list>           output columns
     -t, --type <type>             recognize specified partition table type only
     -u, --units[=<unit>]          display units: 'cylinders' or 'sectors' (default)
     -s, --getsz                   display device size in 512-byte sectors [DEPRECATED]
         --bytes                   print SIZE in bytes rather than in human readable format
     -w, --wipe <mode>             wipe signatures (auto, always or never)
     -W, --wipe-partitions <mode>  wipe signatures from new partitions (auto, always or never)
    
     -C, --cylinders <number>      specify the number of cylinders
     -H, --heads <number>          specify the number of heads
     -S, --sectors <number>        specify the number of sectors per track
    
     -h, --help                    display this help
     -V, --version                 display version
    
    Available output columns:
     gpt: Device Start End Sectors Size Type Type-UUID Attrs Name UUID
     dos: Device Start End Sectors Cylinders Size Type Id Attrs Boot End-C/H/S
          Start-C/H/S
     bsd: Slice Start End Sectors Cylinders Size Type Bsize Cpg Fsize
     sgi: Device Start End Sectors Cylinders Size Type Id Attrs
     sun: Device Start End Sectors Cylinders Size Type Id Flags
    
    For more details see fdisk(8).

Ubuntu/パッケージ

コマンド

関連