Add extra disk without rebooting
Quote from moshe on 23/04/2022, 2:40 pmProblem
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
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
Uploaded files: