Tips for working with disks and storage systems
Linux Software RAID (Multiple Device/MD)
Display all processes busy the RAID md1
shell
lsof +f -- /dev/md1Get speed value of KByte for all RAID disks
shell
sysctl dev.raid.speed_limit_maxSet limit speed value of KByte for all RAIDs
shell
sysctl -w dev.raid.speed_limit_max=80000Set limit speed sync/check only for the RAID md1
shell
echo 80000 > /sys/block/md1/md/sync_speed_maxWill start the RAID md1 check process
shell
echo check > /sys/block/md1/md/sync_actionWill stop the ongoing check, resync, or recovery process for RAID md1
shell
echo idle > /sys/block/md1/md/sync_actionВключить индикацию диода у диска в корзине
shell
apt install ledmonshell
ledctl locate=/dev/sdaAnalytics
Show which processes have written the most data to disk
shell
iotop -oPa -d 1next, find the parent
shell
pstree -asp 12345List of open process files
shell
lsof -p 12345SWAP file
Commands require
Superuserprivileges
Creating a SWAP of 1GB with a greed of 10%
shell
cat /proc/sys/vm/swappiness && \
sysctl vm.swappiness=10 && \
echo "vm.swappiness=10" >> /etc/sysctl.conf && \
fallocate -l 1G /swapfile && \
chmod 600 /swapfile && \
mkswap /swapfile && \
swapon /swapfile && \
echo "/swapfile swap swap defaults 0 0" >> /etc/fstabClearing the SWAP
shell
sudo swapoff -a && sudo swapon -a && free -mWriting an ISO Image to a USB Drive (macOS)
The
ddcommand requiresSuperuserprivileges
shell
diskutil list
diskutil unmountDisk /dev/disk3
sudo dd if="~/Downloads/debian-13-amd64-netinst.iso" of=/dev/rdisk3 bs=1m status=progress
diskutil eject /dev/disk3