Windowsで利用していたUSB接続のストレージをRaspbianでマウントしてストレージとして利用する際、ファイルシステムをext4に変更する方法を紹介します。
Windows側でやること
diskpartコマンドで綺麗にcleanする。
やり方は下記の方法と全く同じです。間違えてCドライブをcleanしない様に気を付けてください。
Raspberry Pi 用のSDカードを初期化する方法
Raspbian側でやること
下記を実行します。
wipefs -a /dev/sda 実行結果 /dev/sda: 2 bytes were erased at offset 0x000001fe (dos): 55 aa /dev/sda: calling ioctl to re-read partition table: Success
パーティションを作成
fdisk /dev/sda
nと入力してエンターキーを押す
Command (m for help): n
pと入力してエンターキーを押す
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
何も入力せずエンターキーを押す
Partition number (1-4, default 1):
何も入力せずエンターキーを押す
First sector (2048-63389695, default 2048):
何も入力せずエンターキーを押す
Last sector, +sectors or +size{K,M,G,T,P} (2048-63389695, default 63389695):
Created a new partition 1 of type 'Linux' and of size 30.2 GiB.
Partition #1 contains a vfat signature.
Yと入力してエンターキーを押す
Do you want to remove the signature? [Y]es/[N]o: Y
The signature will be removed by a write command.
wと入力してエンターキーを押すと設定が反映される
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
qを押してエンターキーを押すとfdiskを終了
Command (m for help): q
ここで再起動
reboot
ext4形式でフォーマット
mkfs.ext4 /dev/sda1
マウントの状態を確認
fdisk -l 一番最後に/dev/sda1が表示され、TypeがLinuxになっていればOk。 Device Boot Start End Sectors Size Id Type /dev/sda1 2048 63389695 63387648 30.2G 83 Linux
