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.

72 lines
1.3 KiB
Markdown

3 years ago
# Ubuntu Quick Guide
## Resize VM storage
* [Reference](https://rdr-it.com/en/ubuntu-extend-lvm-partition-and-disk/)
* [Details](https://homenetyth.ddnsking.com/how-to/ubuntu-admin)
```bash
# 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
3 years ago
```
## Set static IP
- [Reference](https://learnubuntu.com/set-static-ip)
```bash
# 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
```
```txt
network: {config: disabled}
```
- update the file
```bash
$ /etc/netplan/00-installer-config.yaml
```
```txt
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
```
```bash
# apply the new ip config
$ sudo netplan apply
# wait a few seconds, check the updated IP
$ hostname -I
3 years ago
```