2013-02-02

partedでGPTのHDDのパーティションを切る

これも雑記。新しいHDDの増設の仕方も。

(番外編)ノードファイルを作る

普通は必要ないのですが、うちの環境は特殊なので(正規の順序で起動しなくなってしまったので)、起動するたびにノードファイルを手動で作っています。
今回も新しく追加したデバイスのノードファイルも作ります。デバイスファイルの場所はdmesgから、最後の引数は/proc/partitionsから持ってきます。
# mknod /dev/sdd b 8 48
# mknod /dev/sdd1 b 8 49

(番外編)景気付けにgdiskでGPTという事にする

これも本当は必要ないかもしれませんが、partedにいう事を聞かせるためにやりました。
gdisk /dev/sdd
GPT fdisk (gdisk) version 0.8.5
Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: not present
Creating new GPT entries.
Command (? for help): p
Disk /dev/sdd: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): F37079F4-4B19-4A05-ACC8-124B81FFE2BF
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 2048-sector boundaries
Total free space is 5860533101 sectors (2.7 TiB)
Number  Start (sector)    End (sector)  Size       Code  Name
Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y
Command (? for help): p
Disk /dev/sdd: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): A6BEDAB2-1243-44DB-8AE0-0F9DB1E0D6AD
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 2048-sector boundaries
Total free space is 5860533101 sectors (2.7 TiB)
Number  Start (sector)    End (sector)  Size       Code  Name
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdd.
The operation has completed successfully.
partedでパーティションを切る

それで、今回増設するHDDは最近の流れに乗ってGPT対応なので、速度が無駄に遅くならないように、4kB境界で使い始めるように設定していきます。

(parted) unit s                                                           
(parted) mkpart primary 2048s -1s                                      
Warning: You requested a partition from 2048s to 5860533167s.          
The closest location we can manage is 2048s to 5860533134s.
Is this still acceptable to you?
Yes/No? y                                                              
(parted) print                                                          
Model: ATA WDC WD30EFRX-68A (scsi)
Disk /dev/sdd: 5860533168s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number  Start  End          Size         File system  Name     Flags
 1      2048s  5860533134s  5860531087s               primary

作成したパーティションをフォーマット
今回はext4で作ります。
# mkfs.ext4 /dev/sdd1
あとはマウントしやすいように/etc/fstabに書いたりして完了。

0 件のコメント:

コメントを投稿