Raspberry Pi 2で外付けHDDを利用する

Raspberry Pi 2で外付けHDDを利用する。



pi@raspberry ~ $ sudo fdisk -l

を実行すると接続したHDDは/dev/sdaだと確認できたが、WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.という警告が表示されたのでgdiskをインストールして初期化する。

pi@raspberry ~ $ sudo gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.5

Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: present

Found valid MBR and GPT. Which do you want to use?
1 - MBR
2 - GPT
3 - Create blank GPT

Your answer: 2
Using GPT and creating fresh protective MBR.

Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y

Command (? for help): n
Partition number (1-128, default 1):
First sector (34-976773134, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-976773134, default = 976773134) or {+-}size{KMGTP}:
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'

Command (? for help): p
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): D595477B-ABF6-4B84-BF36-2BD97357CE4D
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number Start (sector) End (sector) Size Code Name
1 2048 976773134 465.8 GiB 8300 Linux filesystem

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sda.
The operation has completed successfully.



pi@raspberry ~ $ sudo mkfs.ext4 /dev/sda1



pi@raspberry ~ $ sudo mkdir /workspace
pi@raspberry ~ $ sudo mount /dev/sda1 /workspace

/dev/sda1 /workspace ext4 defaults 0 0


メールアドレスが公開されることはありません。 * が付いている欄は必須項目です