0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Linux ( Ubuntu ) の外部ストレージフォーマット

0
Last updated at Posted at 2025-07-30

備忘録。タイトル通り。

.bash
# ハードディスクを確認 (デバイス名 /dev/sdX のXがどういう値になっているか)
sudo parted -l
# パーティションの作成
sudo parted /dev/sdX
# GPTパーティションテーブル作成
(parted) mklabel gpt

ウィンドウズとデュアルブートしてる場合などは、以下のようになりました。ウィンドウズ側から外部ストレージに対して取り出しを行い、いちど電源を切ります。その後外部ストレージのケーブルを抜き、Ubuntuを起動。もう一度外部ストレージを接続。

.bash
# GPTパーティション (失敗)
(parted) mklabel gpt
Warning: Partition(s) on /dev/sda are being used.
Ignore/Cancel? Ignore                                                     
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be
lost. Do you want to continue?
Yes/No? Yes                                                               
Error: Partition(s) 1 on /dev/sda have been written, but we have been unable to inform the kernel of
the change, probably because it/they are in use.  As a result, the old partition(s) will remain in
use.  You should reboot now before making further changes.
Ignore/Cancel?
.bash
# パーティション作成
(parted) mkpart
Partition name?  []? st7pssd
File system type?  [ext2]? ext4
Start? 0%
End? 100%
.bash
# 設定が正しく行われたか確認します
(parted) p
# partedを終了します
(parted) q
# ファイルシステムを指定してパーティションをフォーマット
mkfs.ext4 /dev/sda1

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?