Possible to remount external drive without unplugging/replugging

I have an external usb hard drive. If I click “eject” it removes it from the list of removable devices, but say I forgot something and need to reconnect it. Is there a way to have it show up again in the list to Mount without having to unplug it and plug it back in? Like something on the command-line?

It would be nice if it didn’t completely remove it from the list but left it there to reconnect. Is there a setting somewhere to do that?

You can mount with (for example):
sudo mount /dev/sdXY /mnt where X is the letter of the block device (sda, sdb, sdc, etc) and Y is the number of partition (usually 1 if your USB only have 1 partition for data).

Regards

I use a script to rescan the usb bus.

#!/bin/sh

SYSXHCI=/sys/bus/pci/drivers/xhci_hcd

if [ “$(id -u)” != 0 ] ; then
echo This must be run as root!
exit 1
fi

if ! cd $SYSXHCI ; then
echo Weird error. Failed to change directory to $SYSXHCI
exit 1
fi

for dev_id in ???:??:??.? ; do
printf “${dev_id}” > unbind
printf “${dev_id}” > bind
done

Tony