Connecting to a USB Drive
Ideally you want a system where USB devices are recognised and mounted to the server whenever they are connected, and can simply be removed when you have finished without having to explicitly 'un-mount'. This is possible with the auto-mount package...
To detect what USB drives you have connected:
First connect your USB storage drive (external hard drive or USB stick) to the servers' USB port, the login as root with PuTTY and enter:
blkid
This will list all attached drive storage, take a note of the line that details your USB device, specifically the "/dev/xxxx" information. If you're not using SATA drives in your server the USB device address location will most probably be "/dev/sda1", but if you are, the address location will be different (as /dev/sda1 will probably be a SATA hard drive).
More information on attached USB devices can be found with the following commands: lsusb and dmesg | grep -i "SCSI device"
To Automatically Mount a USB Drive:
First install the auto-mount "autofs" package, login as root with PuTTY and enter:
apt-get update
apt-get clean
apt-get install autofs
Login with WinSCP and double click on the '/etc/auto.master' file to edit and add the following line to the bottom of the file:
/mnt/USB /etc/auto.usb --timeout=5 --ghost
Then create a file /etc/auto.usb either by navigating to the /etc directory with WinSCP and selecting "File-New-File...", or from PuTTY enter:
touch /etc/auto.usb
With WinSCP, double click on the '/etc/auto.usb' file to edit and add the following line to the bottom of the file:
USB_device_name -fstype=auto :/dev/xxxx
You can include multiple USB devices in this file, each device will have an individual directory created at /mnt/USB/, (obviously replace dev/xxxx with the location of the USB device and 'USB_device_name' with an appropriate device name).
Then for this to take effect restart the autofs service, with PuTTY enter:
service autofs restart
The benefit of this method is the USB device will only be mounted to the server when it is present and required, after a period of inactivity (the --timeout=5 command) the USB device is automatically un-mounted until it is required again. This is very important for 'hot swappable' devices like USB drives and pen sticks.