Skip to content

Instantly share code, notes, and snippets.

@tjhartmann
Last active March 5, 2021 23:23
Show Gist options
  • Save tjhartmann/6175104 to your computer and use it in GitHub Desktop.
Save tjhartmann/6175104 to your computer and use it in GitHub Desktop.
Useful Linux storage commands
# concise logical disk enumeration
MegaCli -LDInfo -Lall -aAll | egrep 'Size|State|Number|Adapter|Virtual'
# concise physical disks enumeration
MegaCli -PDList -aALL | egrep 'Enclosure|Raw Size|Slot Number|Device Id|Firmware state|Inquiry|Adapter'
# FC disks
echo "1" > /sys/class/fc_host/host#/issue_lip
# SCSI disks
echo "- - -" > /sys/class/scsi_host/host#/scan
echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan
# rescan partition table (i.e. after running fdisk but w/o rebooting)
partprobe -s
# Extend Volume Group - 2nd argument must be pv
vgextend VolGroup00 /dev/sda3
# Extend LVM logical volume to use all space on VG
lvextend -l +100%FREE /dev/vg0/lv_root
# ext2/3 resize uses the device
resize2fs /dev/vg0/lv_root
# xfs resize uses the mount point
xfs_growfs mount-point
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment