CFDISK(8) Linux Programmer’s Manual CFDISK(8)
名前
cfdisk - Linux 用のパーティションテーブル操作ツール (curses 版)
書式
cfdisk [ -agvz ] [ -c cylinders ] [ -h heads ] [ -s sectors-per-track ]
[ -P opt ] [ device ]
説明
cfdisk は、ハードディスクドライブのパーティション分割をする curses ベー
スのプログラムである。 device 引き数の典型的な値は、以下のものがある:
/dev/hda [default]
/dev/hdb
/dev/sda
/dev/sdb
/dev/sdc
/dev/sdd
パ ーティションテーブルを書き込むために、 cfdisk はディスクの「ジオメト
リ」と呼ばれるものを必要とする: ジオメトリとは、「ヘッド数」と「1 ト ラ
ック当たりのセクタ数」である。 Linux はジオメトリを使わないので、ディス
クが他のオペレーティングシステムからアクセスされることが な け れ ば 、
cfdisk が選んだデフォルトを受け入れても安全である。 cfdisk が使うジオメ
トリは、次のようにして見付ける。初めにパーティションテーブルを調べる 。
こ れは、以前にジオメトリを変更したプログラムがどのようなジオメトリを使
ったかを見るためである。パーティションテーブルが空である・ゴミを含ん で
い る・整合性の取れたジオメトリを指していない、といった場合は、カーネル
から情報をもらう。うまく動かない場合は、ヘッド数 255, トラック当たり の
セクタ数 63 を仮定する。ジオメトリは、コマンドラインまたは ‘g’ コマンド
を使って上書きできる。大容量の最近のディスクを何も書かれていない状態 か
ら パーティション分割する場合、通常はヘッド数 255, トラック当たりのセク
タ数 63 を選ぶのが良い。 cfdisk はディスクサイズを知っているので、シ リ
ンダ数を設定する必要はない。
次 に cfdisk はディスクドライブからパーティションテーブルを読み込みこも
うとする。パーティションテーブルが検出できなかった場合は、エラーを表 示
し てプログラムが終了する。これは間違ったジオメトリ情報によっても起こる
ことなので、コマンドライン上から上書きすることができる。この問題を回 避
するもう 1 つの方法は、 -z オプションを使うことである。このオプションに
より、ディスクのパーティションテーブルは無視される。
メインの表示画面は 4 つのセクションから構成される: 上から順に、ヘッダ・
パ ーティション・コマンド行・警告行がある。ヘッダには、プログラム名・バ
ージョン番号・ディスクドライブ・ジオメトリが書かれている。パーティシ ョ
ン のセクションには、現在のパーティションテーブルが常に表示される。コマ
ンド行は、コマンドとテキストが入力される場所である。使用できるコマン ド
は 、通常、大括弧の中に表示される。警告行は、表示すべき重要な情報がある
とき以外、通常は何も表示されない。現在選択しているパーティションは反 転
してハイライト表示される (-a オプションが指定された場合は、矢印で示され
る)。パーティション毎に適用される全てのコマンドは、現在選択されているパ
ーティションに適用される。
パ ーティションセクションにあるパーティションテーブルのフォーマットは、
左から右へ、名前・フラグ・パーティションタイプ・ファイルシステムタイ プ
・ (訳註: ラベル)・サイズのようになっている。名前はパーティションのデバ
イス名である。フラグは、ブート可能パーティションを表す ブート、ま た は
「DOS や OS/2 と互換性がない (Not Compatible) 」 ことを表す NC である。
DOS, OS/2 では (もしかしたら他の OS でも)、第 2 ヘッドを起こすために 、
デ ィスクの第 1 パーティションと全ての論理パーティションの第 1 セクタを
必要とする。これは第 1 ヘッドの第 1 トラックにある第 2 セクタから最終セ
クタまでを無駄にしている (第 1 セクタはパーティションテーブル自身に使用
される)。 cfdisk は、この「失われた」セクタを最大化 (maximize) コマンド
(m) で回復させることができる。 注意: fdisk(8) と幾つかの初期バージョン
の DOS は、セクタ数を最大化した状態で全パーティションを作成する。より詳
細 な情報は、後述の最大化コマンドを参照すること。パーティションタイプは
、 基本 (Primary) または 論理 (Logical) のどちらかである。ドライブ内 の
割り当てられていない領域では、そのパーティションタイプは、 基本/論理 、
または (その領域を使用していないのであれば) 空白にしておくことができ る
。 もし既知のファイルシステムである場合は、ファイルシステムタイプのセク
ションにパーティションで使われているファイルシステム名が表示される。 不
明の場合は、 不明という文字列とファイルシステムタイプを示す 16 進数の値
が表示される。 (全ての基本パーティションが使われているために) ディス ク
ド ライブのセクタが使用できない、という特殊なケースがある。この様なケー
スを検知した場合、ファイルシステムタイプは 使用不可と表示される。サイズ
フィールドには、パーティションのサイズが (デフォルトでは) MB 単位で表示
される。サイズをセクタ数やシリンダ数で表示することもできる (以下の単 位
変 更コマンドを参照すること)。アスタリスク (*) がサイズの後に表示されて
いる場合、パーティションがシリンダの境界線上に並んでいないことを示す。
DOS 6.x 向けの警告
DOS 6.x の FORMAT コマンドはパーティションのデータエリアの第一セクタ か
ら ある種の情報を検索し、これをパーティションテーブルにある情報より信頼
できるものとして扱う。 DOS の FORMAT は、容量が変更されたときには最初の
512 バイト分のデータ領域が DOS 版 FDISK によってクリアされていることを
仮定している。 DOS の FORMAT はこの拡張情報を /U フラグを指定した場合で
も 見ようとする - これは DOS FORMAT と DOS FDISK のバグであると我々は考
える。
結局のところ、 cfdisk や fdisk を用いて DOS パーティションの容量を変 更
したときは、 DOS FORMAT を使ってパーティションをフォーマットする前に dd
を使って先頭の 512 バイトを 0 で埋めなければならない、というわけであ る
。 例えば cfdisk を用いて /dev/hda1 の DOS パーティションのテーブルエン
トリを作成した場合には、(fdisk または cfdisk を終了し、 Linux をリブ ー
トしてパーティションテーブルの情報を有効にしたあとで) 先頭の 512 バイト
をゼロにするために "dd if=/dev/zero of=/dev/hda1 bs=512 count=1" などと
実行する必要がある。注意点:
dd コマンドを使う場合には特に注意すること。ちょっとしたタイプミスで、デ
ィスク上のすべてのデータがパーになる可能性もある。
できるだけ問題を起こしたくなければ、常に OS 固有のパーティションテー ブ
ル用プログラムを用いることである。例えば DOS パーティションは DOS FDISK
プログラムで作り、 Linux のパーティションは Linux の fdisk ま た は
cfdisk で作るべきなのである。
コマンド
cfdisk コマンドは、キーを押すことで入力できる (コマンドの後に Enter を
押す必要はない)。使用可能なコマンドは、以下の通りである:
b 選択しているパーティションのブート可能フラグを切替える。このコマ
ンドにより、ドライブ上でどの基本パーティションをブート可能にする
かを選択できる。
d 選択しているパーティションを削除する。このコマンドは、パーティシ
ョンを空き領域に変換し、そのパーティションのすぐ前後にある空き領
域と統合する。既に空き領域とマークされているパーティションや、既
に使用不能と使用不可パーティションは、削除できない。
g ディスクジオメトリ (シリンダ数・ヘッド数・トラック当たりのセクタ
数) を変更する。 警告: このコマンドは、何をしているかを理解し て
いる人のみが使うべきである。ディスクジオメトリを変更するコマンド
ラインオプションもある。ディスクジオメトリを変更するコマンドライ
ンでは、シリンダ数の変更 (c), ヘッダ数の変更 (h), トラック当たり
のセクタ数の変更 (s) を選ぶことができる。単純に Enter キーを押す
と、使用できるデフォルトの値がプロンプトに表示される。また、 ESC
キーを押して変更せずに終了することもできる。デフォルトの値を変更
し たい場合は、希望する値を入力し、 Enter を押すだけでよい。変更
されたディスクパラメータの値は、 (ディスクジオメトリ変更のコマン
ドラインで Enter または ESC を押して) メインメニューに戻るまで反
映されない。ディスク容量が大きくなるようにジオメトリを変更した場
合、余分のセクタがディスクの終りに空き領域として追加される。ディ
スク容量が小さくなるようにした場合、新たな最終セクタより後のパー
ティションは削除され、ドライブの最後のパーティション (またはドラ
イブの終りにある空き領域) が新たな最終セクタになる。
h ヘルプ画面を表示する。
m 選択されているパーティションのディスク使用量を最大化する。このコ
マンドは、パーティションテーブルとパーティションの先頭の間にある
未使用領域を回復する (訳注: 利用できるようにする)。しかし、パ ー
ティションが DOS, OS/2, その他の OS との互換性を失うというコスト
を伴う。このコマンドは、ディスク使用量を最大にするの か 、 DOS,
OS/2 などと互換性のあるディスクを使用するのかを切替える。パーテ
ィションを作成する場合、デフォルトでは DOS, OS/2 などと互換性 の
あるパーティションを作成する。
n 空き領域から新しいパーティションを作成する。パーティションのタイ
プが、 基本領域または 論理領域の場合、そのタイプのパーティション
が作成される。しかし、 基本/論理の場合、作成するパーティションタ
イプを質問される。 (1) プライマリパーティションは 4 スロットしか
使 用できない。 (2) 全ての論理ドライブを収める拡張パーティション
は 1 つしか使用できないので、全ての論理ドライブは (基本パーテ ィ
ションを挟まずに) 連続していなければならない。という点を知ってお
くこと。次に cfdisk は、作成するパーティションのサイズを聞いてく
る。選択されている空き領域全体のサイズと同じデフォルトのサイズが
、 MB 単位で表示される。デフォルトのサイズにするには Enter を 押
せばいいし、別のサイズにするにはプロンプトで望みのサイズを入力す
ればよい。 cfdisk は、サイズ数の直後に (M, K, C, S) を付けて入力
す ることにより、サイズを (デフォルトの) メガバイト (M) ・キロバ
イト (K) ・シリンダ (C) ・セクタ (S) で設定することができる。 パ
ーティションが使用可能な空き領域を埋める場合は、パーティションが
作成された後にメインのコマンドラインに戻る。そうでない場合は、パ
ー テ ィションが空き領域の最初または最後に作成されることになり、
cfdisk はパーティションをどこに配置するかを聞いてくる。パーテ ィ
ションが作成された後、全ての基本パーティションが使われている場合
には、 cfdisk は他のパーティションのタイプを自動的に調整する。
p パーティションテーブルを画面またはファイルに出力する。以下に示す
いくつかの異なるフォーマットから選択できる:
r 生データフォーマット (ディスクに書き込まれる正確な形式)
s セクタ順フォーマットのパーティションテーブル
t 生データフォーマットのパーティションテーブル
生 データフォーマットは、 write コマンドが選択された場合に、ディ
スクに書き込まれるセクタを表示する。最初に基本パーティションテー
ブルが表示され、続いて各論理パーティションに関連づけられたパーテ
ィションテーブルが表示される。データはバイト単位で 1 行に 16 バ
イトずつ 16 進数で表示される。
セクタ順フォーマットのパーティションテーブルは、セクタ番号で並べ
たパーティションテーブルを表示する。フィールドは、左から右に、パ
ーティション番号・パーティションタイプ・最初のセクタ・最後のセク
タ・パーティションの最初のセクタからデータの始まりまでのオフセッ
ト ・ パーティションの長さ・ファイルシステムタイプ (括弧内にその
16 進数の値が表示される)・フラグ (括弧内にその 16 進数の値が表示
される) がある。基本パーティションと論理パーティションに加え、空
き領域と使用不可領域が表示される。拡張パーティションは、最初の論
理パーティションの前に表示される。
パーティションがシリンダの境界で始まるか終るかしていない場合、ま
たはパーティションの長さがシリンダサイズで表示できない場合、並ん
でいないセクタ番号/カウントの後にアスタリスク (*) が表示される。
通常、これは、パーティションをシリンダ境界に並べて作成され な い
OS か、異なるディスクジオメトリ情報を使う OS によってパーティシ
ョンが作成されたことを示す。他の OS のディスクジオメトリが分かる
場 合には、ジオメトリ変更コマンド (g) を使ってジオメトリ情報を入
力することができる。
ディスクの最初のパーティションと全ての論理パーティションでは、パ
ーティションの先頭からのオフセットがトラック当たりのセクタ数に一
致しない場合 (つまり、データが最初のヘッドから始まっていな い 場
合)、番号記号 (#) がオフセットの後に表示される。残りのパーティシ
ョンでは、オフセットが 0 でない場合、番号記号がオフセットの後 に
表示される。これは、メイン画面のパーティションセクションにおける
NC フラグに対応する。
生データフォーマットのパーティションテーブルでは、パーティション
の番号順にパーティションテーブルが表示される。この場合、全ての使
用不可領域と空き領域は無視される。フィールドは、左から右へ、パー
ティション番号・(16 進数の) フラグ・最初のヘッド・セクタとシリン
ダ・(16 進数の) ファイルシステム ID・最後のヘッド・セクタとシ リ
ンダ・パーティションの最初のセクタとパーティション内のセクタ数と
なっている。このテーブルの情報は、直接 生データフォーマットに 変
換される。
パーティションテーブルのエントリは、最初と最後のシリンダを表すの
に 10 ビットしか使用できない。よって、最初 (最後) のセクタの絶対
的なセクタ番号がシリンダ数で 1023 を超える場合、最初 (最後) のヘ
ッド・セクタ・シリンダの最大値が表示される。これは OS/2 で使われ
ている方法で、このフォーマットで書かれていない場合でも、 OS/2 の
fdisk によるパーティションテーブルの再書き込みに関連する問題を修
正 する。 Linux と OS/2 は絶対的なセクタカウントを使うので、最初
と最後のヘッド・セクタ・シリンダの値は使われない。
q プログラムを終了する。このコマンドは、データをディスクに書き込ま
ずにプログラムを終了する。
t ファイルシステムタイプを変更する。デフォルトでは、新しいパーティ
ションは Linux パーティションとして作成されるが、 cfdisk は他 の
OS 用のパーティションも作成できるので、パーティションタイプの変
更では希望するファイルシステムを 16 進数で入力できる。ファイルシ
ステムタイプをプロンプトで入力することも、デフォルトのファイルシ
ステムタイプ [Linux] を受け入れることもできる。
u パーティションサイズ表示の単位を変更する。単位はメガバイト・セク
タ・シリンダと切り替わる。
W パーティションテーブルをディスクに書き込む (大文字 W を入力しな
ければならない)。このコマンドはディスク上のデータを破壊するか も
し れないので、 ‘yes’ または ‘no’ を入力して、書き込みを承認する
か拒否するかしなければならない。 ‘yes’ を入力した場合 、 cfdisk
はパーティションテーブルをディスクに書き込み、カーネルに対してデ
ィスクからパーティションテーブルを再読み込みするように指示する。
ほとんどの場合、パーティションテーブルの再読み込みはうまく動作す
るが、失敗するのを見たこともある。 (このようになっても) 慌てない
こと。システムを再起動した後で改訂されるだろう。全ての場合で、--
安全のために -- システムを再起動することを勧める。
上矢印 (↑)
下矢印 (↓)
カーソルを前または次のパーティションに移動する。画面上に表示でき
る 以 上のパーティションがある場合、画面に表示されている最後 (最
初) のパーティションで下 (上) に移動することで、次 (前) のパーテ
ィションセットを表示できる。
CTRL-L 画面を再描画する。何か問題が発生し、何も表示が読めなくなった場合
、メインコマンドラインから画面をリフレッシュすることができる。
? ヘルプ画面を表示する。
全てのコマンドは大文字でも小文字でも入力できる (Writes は例外である) 。
サブメニューやファイル名を入力するプロンプトにいる場合、 ESC キーを入力
することでメインコマンドラインに戻ることができる。
オプション
-a 選択しているパーティションをハイライトするために、反転表示ではな
く、矢印カーソルを使う。
-g ディスクドライバが与えるジオメトリを使わず、パーティションテーブ
ルからジオメトリを推測する。
-v バージョン番号と著作権を表示する。
-z 白紙のパーティションテーブルで起動する。このオプションは、ディス
ク 全体を再分割する場合に役立つ。 注意: このオプションはディスク
のパーティションを白紙にするわけではない; 白紙にすると言うよりは
、単に既存のパーティションテーブルを読み込ませずにプログラムを起
動するだけである。
-c cylinders
-h heads
-s sectors-per-track
BIOS から読み込んだシリンダ数・ヘッド数・トラック当たりのセク タ
数を上書きする。 BIOS やアダプタがこれらの情報を提供しない場合や
、間違った情報を提供する場合、ディスクジオメトリの値を設定するた
めにこれらのオプションを使うこと。
-P opt 指 定されたフォーマットでパーティションテーブルを表示する。 opt
は "r", "s", "t" のうちの 1 つまた複数で指定する。表示フォーマッ
トのより詳細な情報は、(上記の) print コマンドを参照すること。
終了状態
0: エラーなし; 1: 起動エラー; 2: I/O エラー; 3: ジオメトリが取得できな
い; 4: ディスクのパーティションテーブルが不正である
関連項目
fdisk(8), mkfs(8), parted(8), sfdisk(8)
バグ
現在のバージョンでは、複数のディスクをサポートしていない。
著者
Kevin E. Martin (martin@cs.unc.edu)
翻訳者謝辞
この man ページの翻訳にあたり、
CFDISK(8) Linux Programmer’s Manual CFDISK(8) NAME cfdisk - Curses based disk partition table manipulator for Linux SYNOPSIS cfdisk [-agvz] [-c cylinders] [-h heads] [-s sectors-per-track] [-P opt] [device] DESCRIPTION cfdisk is a curses based program for partitioning any hard disk drive. Typical values of the device argument are: /dev/hda [default] /dev/hdb /dev/sda /dev/sdb /dev/sdc /dev/sdd Note that cfdisk does not align partitions to block device I/O limits. This functionality is provided by fdisk(8). In order to write the partition table cfdisk needs something called the ‘geometry’ of the disk: the number of ‘heads’ and the number of ‘sec- tors per track’. Linux does not use any geometry, so if the disk will not be accessed by other operating systems, you can safely accept the defaults that cfdisk chooses for you. The geometry used by cfdisk is found as follows. First the partition table is examined, to see what geometry was used by the previous program that changed it. If the par- tition table is empty, or contains garbage, or does not point at a con- sistent geometry, the kernel is asked for advice. If nothing works 255 heads and 63 sectors/track is assumed. The geometry can be overridden on the command line or by use of the ‘g’ command. When partitioning an empty large modern disk, picking 255 heads and 63 sectors/track is always a good idea. There is no need to set the number of cylinders, since cfdisk knows the disk size. Next, cfdisk tries to read the current partition table from the disk drive. If it is unable to figure out the partition table, an error is displayed and the program will exit. This might also be caused by incorrect geometry information, and can be overridden on the command line. Another way around this problem is with the -z option. This will ignore the partition table on the disk. The main display is composed of four sections, from top to bottom: the header, the partitions, the command line and a warning line. The header contains the program name and version number followed by the disk drive and its geometry. The partitions section always displays the current partition table. The command line is the place where com- mands and text are entered. The available commands are usually dis- played in brackets. The warning line is usually empty except when there is important information to be displayed. The current partition is highlighted with reverse video (or an arrow if the -a option is given). All partition specific commands apply to the current parti- tion. The format of the partition table in the partitions section is, from left to right: Name, Flags, Partition Type, Filesystem Type and Size. The name is the partition device name. The flags can be Boot, which designates a bootable partition or NC, which stands for "Not Compatible with DOS or OS/2". DOS, OS/2 and possibly other operating systems require the first sector of the first partition on the disk and all logical partitions to begin on the second head. This wastes the second through the last sector of the first track of the first head (the first sector is taken by the partition table itself). cfdisk allows you to recover these "lost" sectors with the maximize command (m). Note: fdisk(8) and some early versions of DOS create all partitions with the number of sectors already maximized. For more information, see the maximize command below. The partition type can be one of Primary or Logical. For unallocated space on the drive, the partition type can also be Pri/Log, or empty (if the space is unusable). The filesystem type section displays the name of the filesystem used on the partition, if known. If it is unknown, then Unknown and the hex value of the filesystem type are displayed. A special case occurs when there are sections of the disk drive that cannot be used (because all of the pri- mary partitions are used). When this is detected, the filesystem type is displayed as Unusable. The size field displays the size of the par- tition in megabytes (by default). It can also display the size in sec- tors and cylinders (see the change units command below). If an aster- isk (*) appears after the size, this means that the partition is not aligned on cylinder boundaries. DOS 6.x WARNING The DOS 6.x FORMAT command looks for some information in the first sec- tor of the data area of the partition, and treats this information as more reliable than the information in the partition table. DOS FORMAT expects DOS FDISK to clear the first 512 bytes of the data area of a partition whenever a size change occurs. DOS FORMAT will look at this extra information even if the /U flag is given -- we consider this a bug in DOS FORMAT and DOS FDISK. The bottom line is that if you use cfdisk or fdisk to change the size of a DOS partition table entry, then you must also use dd to zero the first 512 bytes of that partition before using DOS FORMAT to format the partition. For example, if you were using cfdisk to make a DOS parti- tion table entry for /dev/hda1, then (after exiting fdisk or cfdisk and rebooting Linux so that the partition table information is valid) you would use the command "dd if=/dev/zero of=/dev/hda1 bs=512 count=1" to zero the first 512 bytes of the partition. Note: BE EXTREMELY CAREFUL if you use the dd command, since a small typo can make all of the data on your disk useless. For best results, you should always use an OS-specific partition table program. For example, you should make DOS partitions with the DOS FDISK program and Linux partitions with the Linux fdisk or Linux cfdisk program. COMMANDS cfdisk commands can be entered by pressing the desired key (pressing Enter after the command is not necessary). Here is a list of the available commands: b Toggle bootable flag of the current partition. This allows you to select which primary partition is bootable on the drive. d Delete the current partition. This will convert the current partition into free space and merge it with any free space imme- diately surrounding the current partition. A partition already marked as free space or marked as unusable cannot be deleted. g Change the disk geometry (cylinders, heads, or sectors-per- track). WARNING: This option should only be used by people who know what they are doing. A command line option is also avail- able to change the disk geometry. While at the change disk geometry command line, you can choose to change cylinders (c), heads (h), and sectors per track (s). The default value will be printed at the prompt which you can accept by simply pressing the Enter key, or you can exit without changes by pressing the ESC key. If you want to change the default value, simply enter the desired value and press Enter. The altered disk parameter values do not take effect until you return to the main menu (by pressing Enter or ESC at the change disk geometry command line). If you change the geometry such that the disk appears larger, the extra sectors are added at the end of the disk as free space. If the disk appears smaller, the partitions that are beyond the new last sector are deleted and the last partition on the drive (or the free space at the end of the drive) is made to end at the new last sector. h Print the help screen. m Maximize disk usage of the current partition. This command will recover the unused space between the partition table and the beginning of the partition, but at the cost of making the parti- tion incompatible with DOS, OS/2 and possibly other operating systems. This option will toggle between maximal disk usage and DOS, OS/2, etc. compatible disk usage. The default when creat- ing a partition is to create DOS, OS/2, etc. compatible parti- tions. n Create new partition from free space. If the partition type is Primary or Logical, a partition of that type will be created, but if the partition type is Pri/Log, you will be prompted for the type you want to create. Be aware that (1) there are only four slots available for primary partitions and (2) since there can be only one extended partition, which contains all of the logical drives, all of the logical drives must be contiguous (with no intervening primary partition). cfdisk next prompts you for the size of the partition you want to create. The default size, equal to the entire free space of the current par- tition, is displayed in megabytes. You can either press the Enter key to accept the default size or enter a different size at the prompt. cfdisk accepts size entries in megabytes (M) [default], kilobytes (K), cylinders (C) and sectors (S) by entering the number immediately followed by one of (M, K, C or S). If the partition fills the free space available, the parti- tion is created and you are returned to the main command line. Otherwise, the partition can be created at the beginning or the end of the free space, and cfdisk will ask you to choose where to place the partition. After the partition is created, cfdisk automatically adjusts the other partitions’ partition types if all of the primary partitions are used. p Print the partition table to the screen or to a file. There are several different formats for the partition that you can choose from: r Raw data format (exactly what would be written to disk) s Partition table in sector order format t Partition table in raw format The raw data format will print the sectors that would be written to disk if a write command is selected. First, the primary par- tition table is printed, followed by the partition tables asso- ciated with each logical partition. The data is printed in hex byte by byte with 16 bytes per line. The partition table in sector order format will print the parti- tion table ordered by sector number. The fields, from left to right, are the number of the partition, the partition type, the first sector, the last sector, the offset from the first sector of the partition to the start of the data, the length of the partition, the filesystem type (with the hex value in parenthe- sis), and the flags (with the hex value in parenthesis). In addition to the primary and logical partitions, free and unus- able space is printed and the extended partition is printed before the first logical partition. If a partition does not start or end on a cylinder boundary or if the partition length is not divisible by the cylinder size, an asterisk (*) is printed after the non-aligned sector num- ber/count. This usually indicates that a partition was created by an operating system that either does not align partitions to cylinder boundaries or that used different disk geometry infor- mation. If you know the disk geometry of the other operating system, you could enter the geometry information with the change geometry command (g). For the first partition on the disk and for all logical parti- tions, if the offset from the beginning of the partition is not equal to the number of sectors per track (i.e., the data does not start on the first head), a number sign (#) is printed after the offset. For the remaining partitions, if the offset is not zero, a number sign will be printed after the offset. This cor- responds to the NC flag in the partitions section of the main display. The partition table in raw format will print the partition table ordered by partition number. It will leave out all free and unusable space. The fields, from left to right, are the number of the partition, the flags (in hex), the starting head, sector and cylinder, the filesystem ID (in hex), the ending head, sec- tor and cylinder, the starting sector in the partition and the number of sectors in the partition. The information in this ta- ble can be directly translated to the raw data format. The partition table entries only have 10 bits available to rep- resent the starting and ending cylinders. Thus, when the abso- lute starting (ending) sector number is on a cylinder greater than 1023, the maximal values for starting (ending) head, sector and cylinder are printed. This is the method used by OS/2, and thus fixes the problems associated with OS/2’s fdisk rewriting the partition table when it is not in this format. Since Linux and OS/2 use absolute sector counts, the values in the starting and ending head, sector and cylinder are not used. q Quit program. This will exit the program without writing any data to disk. t Change the filesystem type. By default, new partitions are cre- ated as Linux partitions, but since cfdisk can create partitions for other operating systems, change partition type allows you to enter the hex value of the filesystem you desire. A list of the know filesystem types is displayed. You can type in the filesystem type at the prompt or accept the default filesystem type [Linux]. u Change units of the partition size display. It will rotate through megabytes, sectors and cylinders. W Write partition table to disk (must enter an upper case W). Since this might destroy data on the disk, you must either con- firm or deny the write by entering ‘yes’ or ‘no’. If you enter ‘yes’, cfdisk will write the partition table to disk and the tell the kernel to re-read the partition table from the disk. The re-reading of the partition table does not work in some cases, for example for device-mapper devices. In particular case you need to inform kernel about new partitions by part- probe(8), kpartx(8) or reboot the system. Up Arrow Down Arrow Move cursor to the previous or next partition. If there are more partitions than can be displayed on a screen, you can dis- play the next (previous) set of partitions by moving down (up) at the last (first) partition displayed on the screen. CTRL-L Redraws the screen. In case something goes wrong and you cannot read anything, you can refresh the screen from the main command line. ? Print the help screen. All of the commands can be entered with either upper or lower case let- ters (except for Writes). When in a sub-menu or at a prompt to enter a filename, you can hit the ESC key to return to the main command line. OPTIONS -a Use an arrow cursor instead of reverse video for highlighting the current partition. -g Do not use the geometry given by the disk driver, but try to guess a geometry from the partition table. -v Print the version number and copyright. -z Start with zeroed partition table. This option is useful when you want to repartition your entire disk. Note: this option does not zero the partition table on the disk; rather, it simply starts the program without reading the existing partition table. -c cylinders -h heads -s sectors-per-track Override the number of cylinders, heads and sectors per track read from the BIOS. If your BIOS or adapter does not supply this information or if it supplies incorrect information, use these options to set the disk geometry values. -P opt Prints the partition table in specified formats. opt can be one or more of "r", "s" or "t". See the print command (above) for more information on the print formats. EXIT STATUS 0: No errors; 1: Invocation error; 2: I/O error; 3: cannot get geome- try; 4: bad partition table on disk. SEE ALSO fdisk(8), sfdisk(8), mkfs(8), parted(8), partprobe(8), kpartx(8) BUGS The current version does not support multiple disks. AUTHOR Kevin E. Martin (martin@cs.unc.edu) AVAILABILITY The cfdisk command is part of the util-linux-ng package and is avail- able from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/. The BOGUS Linux Release 3 June 1995 CFDISK(8)
コロナウイルスの日ごとの感染者数・死者数をグラフ化してみました。どの国が増加傾向にあり、どの国が終息に向かっているかを視覚化しています。
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa