USB接続のHDDをフォーマットします。
デバイス名を調べる:
sudo fdisk -l
/dev/sdaがターゲットの場合:
sudo fdisk /dev/sda
現状のディスク情報を確認して、パーティション・テーブルを作り直して、ディスク全体のパーティションを1つ作成する。NTFSのIDもつける。
command (m for help): p
Disk /dev/sda: 128.0 GB, 128035676160 bytes
30 heads, 63 sectors/track, 132312 cylinders, total 250069680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2e36d3b5
Device Boot Start End Blocks Id System
/dev/sda1 2048 250069679 125033816 83 Linux
command (m for help): o で、DOSパーティション・テーブル作成
command (m for help): n パーティション1を作成
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 7 =NTFSのタイプ番号
Command (m for help): w 書き込み
The partition table has been altered!
NTFSの必要パッケージ:
sudo apt-get install ntfsprogs
ntfsでフォーマットする:
$ sudo mkntfs /dev/sda1
ちなみに、2TB以上のHDDの場合は、DOSのパーティション・テーブルでは2TBまでしか、認識してくれない。
Partedを使って、GPT(EFI)のパーティション・テーブルを作成する。