xxxxプログラマのメモ

先人に感謝と敬意:自分の困ったこと調べたことのメモ

ESXi Ubuntu 20.04 システムディスク拡張

tech-mmmm.blogspot.com
www.ytyng.com

拡張は出来たけど、VMディスク拡張+今回の設定だと一部までの拡張しか認識していません。
とりあえず残課題。。。

hiro@hoge:~$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0                       7:0    0 55.4M  1 loop /snap/core18/1944
loop1                       7:1    0 55.4M  1 loop /snap/core18/2066
loop2                       7:2    0 67.6M  1 loop /snap/lxd/20326
loop3                       7:3    0 69.9M  1 loop /snap/lxd/19188
loop4                       7:4    0 31.1M  1 loop /snap/snapd/10707
loop5                       7:5    0 32.1M  1 loop /snap/snapd/11841
sda                         8:0    0  300G  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0  149G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0 74.5G  0 lvm  /
sdb                         8:16   0    1T  0 disk
sr0                        11:0    1 1024M  0 rom
hiro@hoge:~$ sudo parted /dev/sda
GNU Parted 3.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p free
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 322GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
        17.4kB  1049kB  1031kB  Free Space
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  1076MB  1074MB  ext4
 3      1076MB  161GB   160GB
        161GB   322GB   161GB   Free Space

(parted) resizepart 3
End?  [161GB]? 100%
(parted) p free
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 322GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
        17.4kB  1049kB  1031kB  Free Space
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  1076MB  1074MB  ext4
 3      1076MB  322GB   321GB

hiro@hoge:~$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0                       7:0    0 55.4M  1 loop /snap/core18/1944
loop1                       7:1    0 55.4M  1 loop /snap/core18/2066
loop2                       7:2    0 67.6M  1 loop /snap/lxd/20326
loop3                       7:3    0 69.9M  1 loop /snap/lxd/19188
loop4                       7:4    0 31.1M  1 loop /snap/snapd/10707
loop5                       7:5    0 32.1M  1 loop /snap/snapd/11841
sda                         8:0    0  300G  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0  299G  0 part
  └─ubuntu--vg-ubuntu--lv 253:0    0 74.5G  0 lvm  /
sdb                         8:16   0    1T  0 disk
sr0                        11:0    1 1024M  0 rom

- sudo resize2fs /dev/sda3
- sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
- sudo resize2fs /dev/ubuntu-vg/ubuntu-lv


Thanks!