Storage
This section provides an overview of commands and configurations related to disk storage management.
Rescan disk without bootting
echo "- - -" | tee /sys/class/scsi_host/host*/scan
Rescue disk
dd if=/dev/sdc of=/home/mako/damaged_P300_disk.img bs=64K conv=noerror,sync
Disk extension
This subsection explains how to check and extend disk partitions.
check
Checks the current disk and partition sizes.
Output example:extend partition
Explains how to extend the partition size.
Checks the updated partition sizes. Output example: Checks the file system disk space usage. Output example: Resizes the file system to use the extended partition space. Checks the updated file system disk space usage.ISCSI
This subsection covers the installation and management of iSCSI targets.
Install
Installs the necessary packages for iSCSI.
list
Discovers available iSCSI targets from the specified IP/DNS.
connect
Connects to the discovered iSCSI targets.
show
Shows the current iSCSI sessions and lists SCSI devices.
automatic start
logout
Logout from iSCSI targets.
iscsiadm --mode node --target ${IQN} --portal ${IP/DNS} --logout
iscsiadm --mode node --logoutall=all
At boot
samba/cifs
//192.168.1.10/SMB_share_name /mnt/nas cifs uid=0,credentials=/root/.rasp,iocharset=utf8,vers=3.0,noperm,noserverino,nofail 0 0
Swap
Create
fallocate -l 2G /swap
chmod 600 /swap
mkswap /swap
Activate
swapon /swap
swapon --show
Permanent
cp /etc/fstab /etc/fstab.bak
echo '/swap none swap sw 0 0' | tee -a /etc/fstab
Threshold (volatile)
cat /proc/sys/vm/swappiness
sysctl vm.swappiness=10
Threshold (permanent)
vi /etc/sysctl.conf
vm.swappiness=10
sysctl -p
Troubleshoot
apt install smem