Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

On GNU/Linux with fdisk (util-linux 2.20.1), when using, say fdisk /dev/sda3 there are quite some options and the and even an "expert mode" (x). Most of these are explained through the m option.

But I can't find an documentation on these, neither in the man not the info page. As I don't want to fumble around with my file systems at the moment - any idea?

Just to make this clear: I'm not talking about the "regular" option, e.g. fdisk -v but the ones where fdiskfirst had to be started. My guess was that I might get luck in another, related manpage but I couldn't find anything so far. Did I miss something?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

This page says

 Expert mode can be used to force the drive geometry to match another drive:

 x: Enter expert mode
 c: Change the number of cylinders
 h: Change the number of heads
 r: Return to normal mode

Additionally, fdisk/README.fdisk on source package tells following story:

Extra commands for experts
--------------------------

The eXtra command `x' puts `fdisk' into `expert' mode, in which a
slightly different set of commands is available.  The Active, Delete,
List, New, Type, Verify, and `eXpert' commands are not available in
expert mode.  The commands Write and Quit are available as in ordinary
mode, the Print command is available, but produces output in a slightly
different format, and of course the Menu command prints the expert
menu.  There are several new commands.

  1. The Return command brings you back to the main menu.

  2. The Extended command prints the list of table entries which point
     to other tables.  Ordinary users do not need this information.
     The data is shown as it is stored.  The same format is used for
     the expert Print command.

  3. The dangerous Begin command allows you to move the start of data
     in a partition away from its beginning.  Other systems create
     partitions with this format, and it is sometimes useful to be able
     to reproduce it.

  4. The slightly dangerous Cylinders command allows you to change the
     available number of cylinders.  For SCSI disk owners, note that we
     require not the actual number of physical cylinders, but the
     number of logical cylinders used by DOS and other operating
     systems.

  5. The extremely dangerous Heads and Sectors commands allow you to
     change the number of heads and sectors.  It should not be
     necessary to use these commands unless you have a SCSI disk, whose
     geometry Linux is not always able to determine.  SCSI disk owners
     note that we need not the actual number of heads or of sectors per
     track, but the number believed to exist by DOS and other operating
     systems.  *Warning*: If you set either of these numbers to a bad
     value, you may lose all data on your disk.

Always, after giving any of the commands Begin, Cylinder, Heads, or
Sectors, you should Return to the main menu and give the Verify command.
share|improve this answer
    
yes, I also did some research via search engine and this site was one of the first ;) As I found some of the options but not all and guess that they must be documented somewhere on-board… still, thanks! –  Chirp. Not Luke. Feb 2 at 21:05
2  
@chirp , updated the question; fdisk/README.fdisk apparently had more documentation on that. –  Olli Feb 2 at 21:07
    
+1 for README files… very nice idea! –  Chirp. Not Luke. Feb 2 at 21:16
add comment

The man page is brief. The ultimate documentation is the source, e.g.:

https://www.kernel.org/pub/linux/utils/util-linux/v2.24/

Fortunately, the source provides some friendly documentation. Looking within the source tree at util-linux-2.24-rc1/Documentation/fdisk.txt, the commands are documented as:

 Give the command `m', and you should see this menu:
       Command action
          a   toggle a bootable flag
          d   delete a partition
          l   list known partition types
          m   print this menu
          n   add a new partition
          p   print the partition table
          q   quit without saving changes
          t   change a partition's system id
          u   change display/entry units
          v   verify the partition table
          w   write table to disk and exit
          x   extra functionality (experts only)

       Command (m for help): _

It goes on to provide usage instructions. On the issue of expert commands, it writes:

 The eXtra command `x' puts `fdisk' into `expert' mode, in which a
 slightly different set of commands is available.  The Active, Delete,
 List, New, Type, Verify, and `eXpert' commands are not available in
 expert mode.  The commands Write and Quit are available as in ordinary
 mode, the Print command is available, but produces output in a slightly
 different format, and of course the Menu command prints the expert
 menu.  There are several new commands.

   1. The Return command brings you back to the main menu.

   2. The Extended command prints the list of table entries which point
      to other tables.  Ordinary users do not need this information.
      The data is shown as it is stored.  The same format is used for
      the expert Print command.

   3. The dangerous Begin command allows you to move the start of data
      in a partition away from its beginning.  Other systems create
      partitions with this format, and it is sometimes useful to be able
      to reproduce it.

   4. The slightly dangerous Cylinders command allows you to change the
      available number of cylinders.  For SCSI disk owners, note that we
      require not the actual number of physical cylinders, but the
      number of logical cylinders used by DOS and other operating
      systems.

   5. The extremely dangerous Heads and Sectors commands allow you to
      change the number of heads and sectors.  It should not be
      necessary to use these commands unless you have a SCSI disk, whose
      geometry Linux is not always able to determine.  SCSI disk owners
      note that we need not the actual number of heads or of sectors per
      track, but the number believed to exist by DOS and other operating
      systems.  *Warning*: If you set either of these numbers to a bad
      value, you may lose all data on your disk.

 Always, after giving any of the commands Begin, Cylinder, Heads, or
 Sectors, you should Return to the main menu and give the Verify command.

After hitting x for expert, this is the menu that appears:

Command action
   b   move beginning of data in a partition
   c   change number of cylinders
   d   print the raw data in the partition table
   e   list extended partitions
   f   fix partition order
   g   create an IRIX (SGI) partition table
   h   change number of heads
   i   change the disk identifier
   m   print this menu
   p   print the partition table
   q   quit without saving changes
   r   return to main menu
   s   change number of sectors/track
   v   verify the partition table
   w   write table to disk and exit

Expert command (m for help):_

Note that the expert menu uses many of the same letters as the normal menu but that those letters mean something different. For example, in the normal menu, c means a fairly innocuous "toggle the dos compatibility flag" but in the expert menu, c means "change number of cylinders". User beware.

share|improve this answer
1  
Indeed. I almost wanted to say UTSL, but then I remembered we are in polite company and don't say things like that around here. :) –  samiam Feb 2 at 21:37
    
Just running fdisk, giving x adds a new menu with help. I commend OP's reluctance to run possibly dangerous commands, but not looking at the help option in the menu.. –  vonbrand Feb 3 at 1:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.