Logbook/(CentOS 6.10) さくらの VPS でディスク拡張した作業ログ
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
* (CentOS 6.10) さくらの VPS でディスク拡張した作業ログ [...
[[さくらのVPS]] から独立記事。
さくらの VPS v4 がスペックアップで SSD サイズ 30GB → 50GB...
ルートパーティション拡張はできなさそうなので、parted で G...
8 Parted Commands to Create and Manage Partitions in Linux
https://www.tecmint.com/parted-command-create-linux-parti...
$ cat /etc/redhat-release
CentOS release 6.10 (Final)
$ uname -a
Linux localhost.localdomain 2.6.32-754.35.1.el6.x86_64 #...
parted でパーティション一覧を出すと、GPT の修正を提案され...
$ parted
$ (parted) print
Warning: Not all of the space available to /dev/vda appe...
fix the GPT to use all of the space (an extra 41943040 b...
the current setting?
Fix/Ignore? # F
まだパーティションの合計は 30GB のときのまま。
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name ...
1 1049kB 263MB 262MB ext4 Linux fi...
2 263MB 2411MB 2147MB linux-swap(v1) Linux swap
3 2411MB 32.2GB 29.8GB ext4 Linux fi...
新しいパーティションを作る。
$ (parted) mkpart
Partition name? []? # data
File system type? [ext2]? # ext2
Start? # 32.2GB
End? # 53.7GB
ext4 は対応していないようで怒られてしまった。
No Implementation: Support for creating ext4 file system...
警告が出るけど気にしない。
Warning: WARNING: the kernel failed to re-read the parti...
As a result, it may not reflect all of your changes unti...
パーティション一覧を再表示。
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name ...
1 1049kB 263MB 262MB ext4 Linux fi...
2 263MB 2411MB 2147MB linux-swap(v1) Linux swap
3 2411MB 32.2GB 29.8GB ext4 Linux fi...
4 32.2GB 53.7GB 21.5GB ext2 data
パーティションが追加されたので parted を閉じる。ありがた...
$ (parted) quit
Information: You may need to update /etc/fstab.
パーティションテーブルが再読み込みできなかったそうなので...
その後 /dev/vda4 が追加されているか確認する。
ext4 にするには以下を入力してまたリブート。
mkfs.ext4 /dev/vda4
fstab に作成したパーティションを追加する。
mkdir /data
id=$(blkid -o value -s UUID /dev/vda4)
echo "UUID=${id} /data ext4 defaults 0 2" | sudo tee /et...
終了行:
* (CentOS 6.10) さくらの VPS でディスク拡張した作業ログ [...
[[さくらのVPS]] から独立記事。
さくらの VPS v4 がスペックアップで SSD サイズ 30GB → 50GB...
ルートパーティション拡張はできなさそうなので、parted で G...
8 Parted Commands to Create and Manage Partitions in Linux
https://www.tecmint.com/parted-command-create-linux-parti...
$ cat /etc/redhat-release
CentOS release 6.10 (Final)
$ uname -a
Linux localhost.localdomain 2.6.32-754.35.1.el6.x86_64 #...
parted でパーティション一覧を出すと、GPT の修正を提案され...
$ parted
$ (parted) print
Warning: Not all of the space available to /dev/vda appe...
fix the GPT to use all of the space (an extra 41943040 b...
the current setting?
Fix/Ignore? # F
まだパーティションの合計は 30GB のときのまま。
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name ...
1 1049kB 263MB 262MB ext4 Linux fi...
2 263MB 2411MB 2147MB linux-swap(v1) Linux swap
3 2411MB 32.2GB 29.8GB ext4 Linux fi...
新しいパーティションを作る。
$ (parted) mkpart
Partition name? []? # data
File system type? [ext2]? # ext2
Start? # 32.2GB
End? # 53.7GB
ext4 は対応していないようで怒られてしまった。
No Implementation: Support for creating ext4 file system...
警告が出るけど気にしない。
Warning: WARNING: the kernel failed to re-read the parti...
As a result, it may not reflect all of your changes unti...
パーティション一覧を再表示。
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name ...
1 1049kB 263MB 262MB ext4 Linux fi...
2 263MB 2411MB 2147MB linux-swap(v1) Linux swap
3 2411MB 32.2GB 29.8GB ext4 Linux fi...
4 32.2GB 53.7GB 21.5GB ext2 data
パーティションが追加されたので parted を閉じる。ありがた...
$ (parted) quit
Information: You may need to update /etc/fstab.
パーティションテーブルが再読み込みできなかったそうなので...
その後 /dev/vda4 が追加されているか確認する。
ext4 にするには以下を入力してまたリブート。
mkfs.ext4 /dev/vda4
fstab に作成したパーティションを追加する。
mkdir /data
id=$(blkid -o value -s UUID /dev/vda4)
echo "UUID=${id} /data ext4 defaults 0 2" | sudo tee /et...
ページ名: