Linux fdisk コマンド
Linux fdisk は、パーティションテーブルを作成および保守するプログラムです。DOS タイプのパーティションテーブル、BSD または SUN タイプのディスクリストと互換性があります。
構文
fdisk [必要参数][选择参数]
必須パラメータ:
- -l すべてのパーティションテーブルを一覧表示します
- -u と-l組み合わせて使用し、パーティション数を表示します
任意パラメータ:
- -s<パーティション番号> パーティションを指定します
- -v バージョン情報
メニュー操作の説明
- m : メニューとヘルプ情報を表示します
- a : アクティブパーティションのマーク/起動パーティション
- d : パーティションを削除します
- l : パーティションタイプを表示します
- n : 新しいパーティションを作成します
- p : パーティション情報を表示します
- q : 保存せずに終了します
- t : パーティション番号を設定します
- v : パーティションをチェックします
- w : 変更を保存します
- x : 拡張機能、高度な機能
例
現在のパーティション状況を表示:
# fdisk -l Disk /dev/sda: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 1305 10377990 8e Linux LVM Disk /dev/sdb: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table
SCSIハードディスクの各パーティションの状況を表示します
# fdisk -lu Disk /dev/sda: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders, total 20971520 sectors Units = sectors of 1 * 512 = 512 bytes Device Boot Start End Blocks Id System /dev/sda1 * 63 208844 104391 83 Linux /dev/sda2 208845 20964824 10377990 8e Linux LVM Disk /dev/sdb: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders, total 10485760 sectors Units = sectors of 1 * 512 = 512 bytes Disk /dev/sdb doesn't contain a valid partition tableその他の拡張
Linux コマンド大全