Skip to main content

Commands

Extend partition size

    1. Get PV (Physical Volume) name (Ex: /dev/sda1)
      sudo pvs
    2. Resize the PV
      sudo pvresize /dev/sda1
    3. Get root logical volume name (Filesystem value of / row; ex: /dev/mapper/ubuntu--vg-root)
      df -h
    4. Expand logical volume
      sudo lvextend -r -l +100%FREE /dev/mapper/ubuntu--vg-root

Source:

Create sudo user

First create the user:

adduser sammy

Add user to the sudo group:

usermod -aG sudo sammy

Then either logout and log back in, or switch to the user:

su - sammy

Source: