Skip to content

Instantly share code, notes, and snippets.

@maiha
Last active August 29, 2015 14:25
Show Gist options
  • Save maiha/f56371314ae27f458cdb to your computer and use it in GitHub Desktop.
Save maiha/f56371314ae27f458cdb to your computer and use it in GitHub Desktop.
2015/07/27 parted /dev/sda
# parted /dev/sda
(parted) print
モデル: VMware, VMware Virtual S (scsi)
ディスク /dev/sda: 107GB
セクタサイズ (論理/物理): 512B/512B
パーティションテーブル: msdos
番号 開始 終了 サイズ タイプ ファイルシステム フラグ
1 1049kB 43.1GB 43.1GB primary ext4 boot
2 43.1GB 53.7GB 10.6GB extended
5 43.1GB 53.7GB 10.6GB logical linux-swap(v1)
(parted) p free
モデル: VMware, VMware Virtual S (scsi)
ディスク /dev/sda: 107GB
セクタサイズ (論理/物理): 512B/512B
パーティションテーブル: msdos
番号 開始 終了 サイズ タイプ ファイルシステム フラグ
32.3kB 1049kB 1016kB 空き容量
1 1049kB 43.1GB 43.1GB primary ext4 boot
43.1GB 43.1GB 1048kB 空き容量
2 43.1GB 53.7GB 10.6GB extended
5 43.1GB 53.7GB 10.6GB logical linux-swap(v1)
53.7GB 107GB 53.7GB 空き容量
# swapoff -a
# parted /dev/sda
(parted) print
モデル: VMware, VMware Virtual S (scsi)
ディスク /dev/sda: 107GB
セクタサイズ (論理/物理): 512B/512B
パーティションテーブル: msdos
番号 開始 終了 サイズ タイプ ファイルシステム フラグ
1 1049kB 43.1GB 43.1GB primary ext4 boot
2 43.1GB 53.7GB 10.6GB extended
(parted) rm 2
(parted) print
モデル: VMware, VMware Virtual S (scsi)
ディスク /dev/sda: 107GB
セクタサイズ (論理/物理): 512B/512B
パーティションテーブル: msdos
番号 開始 終了 サイズ タイプ ファイルシステム フラグ
1 1049kB 43.1GB 43.1GB primary ext4 boot
# fdisk /dev/sda
コマンド (m でヘルプ): d 1
選択したパーティション 1
コマンド (m でヘルプ): n // → あとは最大値で作成(リターン連打)
コマンド (m でヘルプ): w
# reboot // mount中に編集したので再起動させる(→反映される)
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 40G 34G 3.9G 90% /
(拡張分はまだ含まれてない)
# resize2fs /dev/sda1
resize2fs 1.42.9 (4-Feb-2014)
Filesystem at /dev/sda1 is mounted on /; on-line resizing required
old_desc_blocks = 3, new_desc_blocks = 7
The filesystem on /dev/sda1 is now 26214144 blocks long.
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 99G 34G 61G 36% /
(反映された)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment