Delete Set public Set private Add tags Delete tags
  Add tag   Cancel
  Delete tag   Cancel
  • • DevOps notes •
  •  
  • AI
  • Tags
  • Login

Logical Volume Management (LVM)/shaare/PaqQSg

  • linux
  • linux

LVM (Logical Volume Management)

  • Combine disk together by software

  • Add new HDD on the fly to extend disk space

  • Set LVM in Linux install

  • Desired capacity: all → set last partition to space left

  • /boot → 500 MB LVM ⚠ always

  • fdisk /dev/sdc

    • n → new partition
    • t → change partition system ID
    • 8e → change to Linux LVM
  • pvcreate /dev/sdc1 → create physical volume

  • pvdisplay → infos

  • vgcreate vg /dev/sdc1 → create volume group

  • vgdisplay → show info

  • lvcreate -n lv --size 500 vg

  • lvdisplay → show info

  • mkfs.xfs /dev/vg/lv → format logical volume

Extend LVM → create LVM partition

  • pvcreate /dev/sd01
  • vgextend vg /dev/sd01
  • lvextend -L +100M /dev/mapper/vg-vg
  • xfs_growfs /dev/mapper/vg-vg

Add / Extend Swap Space

  • System will not boot if set incorrect

  • Recommended: 2x size of RAM

  • dd if=/dev/zero of=/newswap bs=1M count=1024

    • Extract disk space from HDD to swap
  • chmod go-r /newswap

    • Make file non-readable for others
  • mkswap /newswap

    • Make swap file
  • swapon /newswap

    • Activate swap (add with the rest)
  • nano fstab

/newswap swap swap defaults 0 0

xfs_info → display detailed information

  • xfs_info /dev/mapper/cs-root
    • Debug info about main XFS partition
2 months ago Permalink
cluster icon
  • Alias and command history : alias l="ls -al" → define alias unalias l → remove alias Persistent Alias Config User-specific: ~/.bashrc Global: /etc/bashrc Add: alias l="ls -a...
  • SED: Stream Editor for Text Manipulation : Basic Replace Syntax: sed -i 's/KENNY/LENNY/g' filename Substitute all occurrences of "KENNY" with "LENNY" Delete Line Containing String: s...
  • Linux filesystem : Directory Description /boot Grub.cfg /root home of root /dev system device (mouse, keyboard) /etc configuration files /bin → /usr/bin e...
  • Apache and Nginx : Apache Web Server dnf install httpd nano /etc/httpd/conf/httpd.conf nano /var/www/html/index.html systemctl restart httpd systemctl stop firewalld N...
  • Navigating File System / Linux filetypes : ls -l → List pwd → Print working directory dr-xr-xr-x | directories -rw-r--r-- | file Linux File Types Symbol Type - Regular file d Dire...


(97)
Filter untagged links
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community