Reload drive without Reboot.

Recently I found myself wanting to reload a disk that had been unplugged by somebody from our linux devbox. The whole process seemed tedious since I wanted to check my training results and just couldn’t. I’ve documented the solution below for future use.

To fix this, the first thing you need to do is rescan the SCSI controller sudo echo "- - -" > sudo /sys/class/scsi_host/host0/scan. The host0 in the above command should be replaced by the appropriate host for your disk. You can check the appropriate host using dmesg or just cycle through all the hosts listed in /sys/class/scsi_host/. After rescanning you can again run dmesg to see if the rescan found and loaded anything or not. An interesting command to use here is lsblk which lists all the patitions of the loaded drives. You should see your new drive with all its partitions listed here.

Now, you can run the mount command sudo mount -o remount,rw -t auto /dev/sdb1 /mnt/new-drive. Notice that you would need to mount the right partition with the right filetype for the mount to work.