home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 15 / boot-disc-1997-11.iso / Debian / Docs / cfdisk.txt < prev    next >
Text File  |  1997-09-15  |  20KB  |  463 lines

  1.  
  2.  
  3.  
  4. CFDISK(8)          Linux Programmer's Manual            CFDISK(8)
  5.  
  6.  
  7. NAME
  8.        cfdisk - Curses based disk partition table manipulator for
  9.        Linux
  10.  
  11. SYNOPSIS
  12.        cfdisk [ -avz ] [ -c cylinders ] [ -h heads ]  [ -s  sec_
  13.        tors-per-track ] [ -P opt ] [ device ]
  14.  
  15. DESCRIPTION
  16.        cfdisk  is  a curses based program for partitioning a hard
  17.        disk drive.  The device can be any one of the following:
  18.  
  19.               /dev/hda [default]
  20.               /dev/hdb
  21.               /dev/sda
  22.               /dev/sdb
  23.               /dev/sdc
  24.               /dev/sdd
  25.  
  26.        cfdisk first tries to read the geometry of the hard  disk.
  27.        If  it  fails,  an  error  message is displayed and cfdisk
  28.        exits.  This should only happen when partitioning  a  SCSI
  29.        drive on an adapter without a BIOS.  To correct this prob
  30.        lem, you can set the  cylinders, heads   and  sectors-per-
  31.        track on the command line.  Next, cfdisk tries to read the
  32.        current partition table from the disk  drive.   If  it  is
  33.        unable to figure out the partition table, an error is dis
  34.        played and the program will  exit.   This  might also  be
  35.        caused by incorrect geometry information, and can be over
  36.        ridden on the command line.  Another way around this prob
  37.        lem is with the -z option.  This will ignore the partition
  38.        table on the disk.
  39.  
  40.        The main display is composed of four sections, from top to
  41.        bottom: the header, the partitions, the command line and a
  42.        warning line.  The header contains the  program  name  and
  43.        version  number  followed by the disk drive and its geome
  44.        try.  The partitions section always displays  the  current
  45.        partition table. The command line is the place where com
  46.        mands and text are entered.  The available  commands  are
  47.        usually  displayed  in brackets. The warning line is usu
  48.        ally empty except when there is important  information  to
  49.        be  displayed.   The current partition is highlighted with
  50.        reverse video (or an arrow if the  -a  option  is  given).
  51.        All  partition specific commands apply to the current par
  52.        tition.
  53.  
  54.        The format of the partition table in the partitions  sec
  55.        tion  is, from left to right: Name, Flags, Partition Type,
  56.        Filesystem Type and  Size.   The name  is  the   partition
  57.        device  name.   The  flags can be Boot, which designates a
  58.        bootable partition or NC, which stands for "Not Compatible
  59.        with DOS or OS/2".  DOS, OS/2 and possibly other operating
  60.        systems require the first sector of the first partition on
  61.  
  62.  
  63.  
  64. The BOGUS Linux Release 3 June 1995                             1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CFDISK(8)          Linux Programmer's Manual            CFDISK(8)
  71.  
  72.  
  73.        the disk and all logical partitions to begin on the second
  74.        head.  This wastes the second through the last  sector  of
  75.        the  first  track  of  the first head (the first sector is
  76.        taken by the partition table itself).  cfdisk  allows  you
  77.        to  recover these "lost" sectors with the maximize command
  78.        (m).  Note: fdisk(8) and some early versions of DOS create
  79.        all  partitions  with  the number of sectors already maxi
  80.        mized.  For more information,  see  the  maximize  command
  81.        below.   The partition type can be one of Primary or Logi_
  82.        cal.  For unallocated space on the  drive,  the  partition
  83.        type  can also be Pri/Log, or empty (if the space is unus
  84.        able).  The filesystem type section displays the name  of
  85.        the  filesystem used on the partition, if known. If it is
  86.        unknown, then Unknown and the hex value of the  filesystem
  87.        type  are displayed.  A special case occurs when there are
  88.        sections of the disk drive that cannot  be  used (because
  89.        all  of  the  primary  partitions are used).  When this is
  90.        detected, the filesystem type is displayed  as   Unusable.
  91.        The  size  field displays  the   size  of the partition in
  92.        megabytes (by default).  It can also display the size  in
  93.        sectors  and  cylinders  (see  the  change  units  command
  94.        below).  If an asterisks (*) appears after the size,  this
  95.        means that the partition is not aligned on cylinder bound
  96.        aries.
  97.  
  98. DOS 6.x WARNING
  99.        The DOS 6.x FORMAT command looks for some  information  in
  100.        the  first  sector  of the data area of the partition, and
  101.        treats this information as more reliable than the informa
  102.        tion in the partition table.  DOS FORMAT expects DOS FDISK
  103.        to clear the first 512 bytes of the data area of a  parti
  104.        tion  whenever a size change occurs.  DOS FORMAT will look
  105.        at this extra information even if the /U flag is given  --
  106.        we consider this a bug in DOS FORMAT and DOS FDISK.
  107.  
  108.        The  bottom  line  is  that  if you use cfdisk or fdisk to
  109.        change the size of a DOS partition table entry,  then  you
  110.        must  also use dd to zero the first 512 bytes of that par
  111.        tition before using DOS FORMAT to  format  the  partition.
  112.        For example, if you were using cfdisk to make a DOS parti
  113.        tion table entry for /dev/hda1, then (after exiting  fdisk
  114.        or  cfdisk and rebooting Linux so that the partition table
  115.        information is  valid)  you  would  use  the  command  "dd
  116.        if=/dev/zero  of=/dev/hda1  bs=512  count=1"  to zero the
  117.        first 512 bytes of the partition.  BE EXTREMELY CAREFUL if
  118.        you use the dd command, since a small typo can make all of
  119.        the data on your disk useless.
  120.  
  121.        BE EXTREMELY CAREFUL if you use the dd  command, since   a
  122.        small  typo can make all of the data on your disk useless.
  123.  
  124.        For best resutls, you should  always  use  an  OS-specific
  125.        partition table program. For example, you should make DOS
  126.        partitions with the DOS FDISK program and Linux partitions
  127.  
  128.  
  129.  
  130. The BOGUS Linux Release 3 June 1995                             2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CFDISK(8)          Linux Programmer's Manual            CFDISK(8)
  137.  
  138.  
  139.        with the Linux fdisk or Linux cfdisk program.
  140.  
  141.  
  142. COMMANDS
  143.        cfdisk commands can be entered by pressing the desired key
  144.        (pressing Enter after the command is not necessary).  Here
  145.        is a list of the available commands:
  146.  
  147.        b      Toggle  bootable  flag  of  the  current partition.
  148.               This allows you to select which  primary  partition
  149.               is bootable on the drive.
  150.  
  151.        d      Delete  the  current  partition.  This will convert
  152.               the current partition into free space and merge  it
  153.               with  any free  space  immediately surrounding the
  154.               current partition.  A partition already  marked  as
  155.               free space or marked as unusable cannot be deleted.
  156.  
  157.        g      Change the disk geometry (cylinders, heads, or sec
  158.               tors-per-track).  WARNING: This option should only
  159.               be used by people who know what they are doing.   A
  160.               command line option is also available to change the
  161.               disk geometry.  While at the change  disk geometry
  162.               command  line,  you  can choose to change cylinders
  163.               (c), heads (h), and sectors  per  track  (s).   The
  164.               default  value  will be printed at the prompt which
  165.               you can accept by simply pressing the Enter key, or
  166.               you  can  exit  without changes by pressing the ESC
  167.               key.  If you want to change the default value, sim
  168.               ply  enter  the desired value and press Enter.  The
  169.               altered disk parameter values do  not  take  effect
  170.               until  you  return the main menu (by pressing Enter
  171.               or ESC at the change disk geometry  command  line.
  172.               If  you  change  the  geometry  such  that the disk
  173.               appears larger, the extra sectors are added at  the
  174.               end of the disk as free space.  If the disk appears
  175.               smaller, the partitions that  are beyond  the  new
  176.               last  sector  are deleted and the last partition on
  177.               the drive (or the free space  at  the  end  of  the
  178.               drive) is made to end at the new last sector.
  179.  
  180.        h      Print the help screen.
  181.  
  182.        m      Maximize disk usage of the current partition.  This
  183.               command will recover the the unused  space  between
  184.               the partition table and the beginning of the parti
  185.               tion, but at  the cost  of  making  the   partition
  186.               incompatible  with  DOS,  OS/2  and  possibly other
  187.               operating systems.  This option will toggle between
  188.               maximal  disk  usage and DOS, OS/2, etc. compatible
  189.               disk usage.  The default when creating a  partition
  190.               is to create DOS, OS/2, etc. compatible partitions.
  191.  
  192.        n      Create new  partition  from  free space.  If  the
  193.  
  194.  
  195.  
  196. The BOGUS Linux Release 3 June 1995                             3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CFDISK(8)          Linux Programmer's Manual            CFDISK(8)
  203.  
  204.  
  205.               partition type  is Primary or Logical, a partition
  206.               of that type will be created, but if the  partition
  207.               type  is Pri/Log, you will be prompted for the type
  208.               you want to create.  Be aware that  (1)  there  are
  209.               only  four  slots available for primary partitions
  210.               and (2) since there can be only one extended parti
  211.               tion, which contains all of the logical drives, all
  212.               of the logical drives must be contiguous  (with  no
  213.               intervening   primary   partition).    cfdisk  next
  214.               prompts you for the size of the partition you  want
  215.               to  create.   The default size, equal to the entire
  216.               free space of the current partition, is display  in
  217.               megabytes.   You  can either press the Enter key to
  218.               accept the default size or enter a  different  size
  219.               at  the  prompt.  cfdisk  accepts  size entries in
  220.               megabytes (M) [default], kilobytes  (K),  cylinders
  221.               (C)  and sectors (S) by entering the number immedi
  222.               ately followed by one of (M, K, C or  S). If  the
  223.               partition fills the free space available, the par
  224.               tition is created and you are returned to the  main
  225.               command line.  Otherwise, the partition can be cre
  226.               ated at the beginning or the end of the free space,
  227.               and  cfdisk  will ask you to choose where to place
  228.               the partition.  After  the  partition  is created,
  229.               cfdisk  automatically adjusts the other partition's
  230.               partition types if all of the  primary  partitions
  231.               are used.
  232.  
  233.        p      Print  the  partition  table  to the screen or to a
  234.               file. There are several different formats for  the
  235.               partition that you can choose from:
  236.  
  237.  
  238.               r Raw data format (exactly what would be writ
  239.                      ten to disk)
  240.  
  241.               s Partition table in sector order format
  242.  
  243.               t Partition table in raw format
  244.  
  245.               The raw data format will  print  the  sectors  that
  246.               would  be written  to  disk  if a write command is
  247.               selected. First, the primary  partition   table  is
  248.               printed,  followed  by the partition tables associ
  249.               ated with each  logical  partition.   The data  is
  250.               printed in hex byte by byte with 16 bytes per line.
  251.  
  252.               The partition table in  sector  order  format  will
  253.               print the partition table ordered by sector number.
  254.               The fields, from left to right, are the  number  of
  255.               the  partition,  the partition type, the first sec
  256.               tor, the last sector, the offset  from  the  first
  257.               sector  of  the partition to the start of the data,
  258.               the length of the partition,  the filesystem  type
  259.  
  260.  
  261.  
  262. The BOGUS Linux Release 3 June 1995                             4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. CFDISK(8)          Linux Programmer's Manual            CFDISK(8)
  269.  
  270.  
  271.               (with  the hex value in parenthesis), and the flags
  272.               (with the hex value in parenthesis).   In addition
  273.               to  the  primary  and  logical partitions, free and
  274.               unusable space is printed and the extended  parti
  275.               tion is printed before the first logical partition.
  276.  
  277.               If a partition does not start or end on a cylinder
  278.               boundary  or if the partition length is not divisi
  279.               ble by the  cylinder  size,  an  asterisks  (*)  is
  280.               printed  after the non-aligned sector number/count.
  281.               This usually indicates that a partition was created
  282.               by  an  operating system that either does not align
  283.               partitions to cylinder boundaries or that used dif
  284.               ferent  disk geometry information.  If you know the
  285.               disk geometry of the other  operating  system,  you
  286.               could  enter  the geometry  information   with  the
  287.               change geometry command (g).
  288.  
  289.               For the first partition on the  disk  and for  all
  290.               logical  partitions,  if the offset from the begin
  291.               ning of the partition is not equal to the number of
  292.               sectors per track (i.e., the data does not start on
  293.               the first head), a number sign (#) is printed after
  294.               the  offset.   For the remaining partitions, if the
  295.               offset is not zero, a number sign will  be  printed
  296.               after  the offset.  This corresponds to the NC flag
  297.               in the partitions section of the main display.
  298.  
  299.               The partition table in raw format will  print  the
  300.               partition table   ordered by partition number.  It
  301.               will leave out all free and  unusable  space.   The
  302.               fields,  from  left to right, are the number of the
  303.               partition, the flags (in hex), the  starting  head,
  304.               sector  and  cylinder,  the filesystem ID (in hex),
  305.               the ending head, sector and cylinder, the starting
  306.               sector  in  the partition and the number of sectors
  307.               in the partition. The information  in  this  table
  308.               can  be directly translated to the raw data format.
  309.  
  310.               The partition  table  entries  only  have 10  bits
  311.               available to  represent   the  starting  and ending
  312.               cylinders.  Thus, when the absolute starting  (end
  313.               ing)  sector  number  is on a cylinder greater than
  314.               1023, the maximal  values  for  starting  (ending)
  315.               head, sector and cylinder are printed.  This is the
  316.               method used by OS/2, and thus  fixes  the problems
  317.               associated  with  OS/2's fdisk rewriting the parti
  318.               tion table when it is not in  this  format.   Since
  319.               Linux and OS/2 use absolute sector counts, the val
  320.               ues in the starting and  ending  head,  sector  and
  321.               cylinder are not used.
  322.  
  323.        q      Quit  program.   This will exit the program without
  324.               writing any data to disk.
  325.  
  326.  
  327.  
  328. The BOGUS Linux Release 3 June 1995                             5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. CFDISK(8)          Linux Programmer's Manual            CFDISK(8)
  335.  
  336.  
  337.        t      Change the filesystem type.  By default, new parti
  338.               tions  are  created  as Linux partitions, but since
  339.               cfdisk can create partitions  for other   operating
  340.               systems,  change partition type allows you to enter
  341.               the hex value of the filesystem you desire.  A list
  342.               of the know filesystem types is displayed.  You can
  343.               type in the filesystem type at the prompt or accept
  344.               the default filesystem type [Linux].
  345.  
  346.        u      Change  units  of the  partition size display.  It
  347.               will rotate through megabytes, sectors  and  cylin
  348.               ders.
  349.  
  350.        W      Write  partition table to disk (must enter an upper
  351.               case W).  Since this  might  destroy  data  on  the
  352.               disk,  you must either confirm or deny the write by
  353.               entering `yes' or `no'.  If you enter `yes', cfdisk
  354.               will write the partition table to disk and the tell
  355.               the kernel to re-read the partition table from  the
  356.               disk.   The re-reading of the partition table works
  357.               is most cases, but I  have  seen  it  fail.   Don't
  358.               panic.   It  will be  correct after you reboot the
  359.               system.  In all cases, I still recommend  rebooting
  360.               the system--just to be safe.
  361.  
  362.        Up Arrow
  363.  
  364.        Down Arrow
  365.               Move  cursor to the previous or next partition.  If
  366.               there are more partitions than can be displayed  on
  367.               a screen,  you can display the next (previous) set
  368.               of partitions by  moving  down  (up)  at  the  last
  369.               (first) partition displayed on the screen.
  370.  
  371.        CTRL-L Redraws  the  screen.  In case something goes wrong
  372.               and you cannot read anything, you can  refresh  the
  373.               screen from the main command line.
  374.  
  375.        ?      Print the help screen.
  376.  
  377.        All  of  the  commands can be entered with either upper or
  378.        lower case letters (except for Writes).  When  in  a  sub-
  379.        menu  or at a prompt to enter a filename, you can hit the
  380.        ESC key to return to the main command line.
  381.  
  382. OPTIONS
  383.        -a     Use an arrow cursor instead of  reverse  video  for
  384.               highlighting the current partition.
  385.  
  386.        -v     Print the version number and copyright.
  387.  
  388.        -z     Start  with zeroed partition table.  This option is
  389.               useful when you want  to  repartition  your  entire
  390.               disk.    Note:   this  option  does  not  zero  the
  391.  
  392.  
  393.  
  394. The BOGUS Linux Release 3 June 1995                             6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. CFDISK(8)          Linux Programmer's Manual            CFDISK(8)
  401.  
  402.  
  403.               partition table on  the  disk;  rather,  it  simply
  404.               starts  the  program  without  reading the existing
  405.               partition table.
  406.  
  407.        -c cylinders
  408.  
  409.        -h heads
  410.  
  411.        -s sectors-per-track
  412.               Override the number of cylinders, heads and sectors
  413.               per  track  read  from  the  BIOS.  If your BIOS or
  414.               adapter does not supply this information or  if  it
  415.               supplies  incorrect  information, use these options
  416.               to set the disk geometry values.
  417.  
  418.        -P opt Prints the partition table  in  specified formats.
  419.               opt can be one or more of "r", "s" or "t".  See the
  420.               print command (above) for more information  on  the
  421.               print formats.
  422.  
  423. SEE ALSO
  424.        fdisk(8)
  425.  
  426. BUGS
  427.        The  current  version  does  not support  multiple  disks
  428.        (future addition).
  429.  
  430. AUTHOR
  431.        Kevin E. Martin (martin@cs.unc.edu)
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460. The BOGUS Linux Release 3 June 1995                             7
  461.  
  462.  
  463.