You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.3 KiB

Ubuntu Quick Guide

Resize VM storage

# Expand volume from vmWare, then launch the vm and apply following command
$ grow disk
$ df -h

# list partitions
$ sudo lsblk

# resize sda3 partition
$ sudo growpart /dev/sda 3

# extend PhisycalVolume volume
$ sudo pvresize /dev/sda3

# extend LogicalVolume to all available space
$ sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv

# resize filesystem
$ sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

Set static IP

# check cloud-init if disable / present
$ apt-cache pkgnames | grep cloud-init

# edit the file to disable clound-init
$ sudo nano /etc/cloud/cloud.cfg.d/99-disable-cloud-init.cfg
$ sudo reboot
network: {config: disabled}
  • update the file
$ /etc/netplan/00-installer-config.yaml
network:
  ethernets:
    enp1s0:
      dhcp4: no
      addresses:
        - 10.0.0.129/24
      gateway4: 10.0.0.2
      nameservers:
        addresses: [8.8.8.8, 10.0.0.2]
  version: 2
# apply the new ip config
$ sudo netplan apply

# wait a few seconds, check the updated IP
$ hostname -I