Problem
User wants to add extra disk to the Linux. But when running fdisk -l to list all the partitions the new device is not available
Solution
Run hardware scan to detect the new installed disk
echo "- - -" | tee /sys/class/scsi_host/host*/scan
or
for host in /sys/class/scsi_host/*; do echo "- - -" | sudo tee $host/scan; ls /dev/sd* ; done
When see a list of disk not initialized for example
Disk /dev/sdb: 85.9 GB, 85899345920 bytes, 167772160 sectors
you can mount it directlry
first run
fdisk /dev/sdb
create new partition
then format the disk
mkfs.xfs /dev/sdb1
then mount the disk
mount /dev/sdb1 /mnt
Attachment: commands.txt
another option
echo "- - -" >> /sys/class/scsi_host/host_$i/scan
We do this for a living.
Kubernetes, DevOps and platform engineering, delivered in days — not another weekend lost to a stack trace.
Start a project →