# Useful Linux command for daily operation
## System
### Check uptime
`uptime -p` total uptime
`uptime -s` system up since
## Local Disk
### Un-mount busy disk
`umount <path> -l`
### Mount all disk in `/etc/fstab`
`mount -a`
### Create new ext4 disk partition
`sudo fdisk /dev/sda`
Press `n` for new partition
Follow default
Press `p` to confirm
Press `w` to write change
Press `q` to quit
`sudo mkfs.ext4 /dev/sda1`
## LVM
## Proxmox LVM
### Mount Guest Disk
```
apt-get install kpartx
kpartx -a /dev/pve/vm-103-disk-1
ls /dev/mapper/
# Mount the disk and do something
# Undo
umount /mnt
kpartx -d /dev/pve/vm-103-disk-1
```
## Networking
### Disable/Enable Network Interface
`ip link set <interface> up`
`ip link set <interface> down`
### Set IP for an Interface
`ifconfig <interface> 192.168.1.0/24`
## Docker
### Recreate/rebuild container
`docker-compose up --force-recreate --build -d`