Rescan scsi

From Attie's Wiki
(Difference between revisions)
Jump to: navigation, search
m
m
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
 
This will rescan all SCSI LUNs. Useful after hotplugging.
 
This will rescan all SCSI LUNs. Useful after hotplugging.
  
 +
Run as root:
 
<source lang="bash">
 
<source lang="bash">
for host in /sys/class/scsi_host/host*; do echo '- - -' > $host/scan; echo $host/scan; done
+
for host in /sys/class/scsi_host/host*; do
 +
  echo "- - -" > $host/scan;
 +
  echo $host/scan;
 +
done
 +
</source>
 +
 
 +
==Rescan Disk==
 +
Helps to get the updated size... e.g: in a VM
 +
 
 +
Run as root:
 +
<source lang="bash">
 +
echo 1 > /sys/block/sdX/device/rescan
 
</source>
 
</source>

Latest revision as of 10:06, 13 July 2017

This will rescan all SCSI LUNs. Useful after hotplugging.

Run as root:

for host in /sys/class/scsi_host/host*; do
  echo "- - -" > $host/scan;
  echo $host/scan;
done

[edit] Rescan Disk

Helps to get the updated size... e.g: in a VM

Run as root:

echo 1 > /sys/block/sdX/device/rescan
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox