Ubuntu 18.04 の Disk 拡張
Ubuntu 18.04 の Disk 拡張したのでめも
$ sudo parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 107GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB bios_grub
2 2097kB 42.9GB 42.9GB ext4
(parted) resizepart 2
Warning: Partition /dev/sda2 is being used. Are you sure you want to continue?
Yes/No? y
End? [42.9GB]? 100%
(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 107GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB bios_grub
2 2097kB 107GB 107GB ext4
(parted) q
Information: You may need to update /etc/fstab.
/etc/fstab
を更新
下記のコマンドで、 ext4 の UUIDを調べてめも
$ blkid
/etc/fstab
の UUID を更新しとく
resize2fs で拡張して終わり
$ sudo resize2fs /dev/sda2
resize2fs 1.44.1 (24-Mar-2018)
Filesystem at /dev/sda2 is mounted on /; on-line resizing required
old_desc_blocks = 5, new_desc_blocks = 13
The filesystem on /dev/sda2 is now 26213883 (4k) blocks long.