Ubuntu 18.04 の Disk 拡張

Ubuntu 18.04 の Disk 拡張したのでめも

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$ 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を調べてめも

1
2
$ sudo blkid
/dev/sdc: UUID="00000000-0000-0000-0000-000000000000" BLOCK_SIZE="4096" TYPE="ext4"

/etc/fstab の UUID を更新しとく

resize2fs で拡張して終わり

1
2
3
4
5
$ 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.
最終更新 2024-04-29 00:44 +0900
Built with Hugo
テーマ StackJimmy によって設計されています。