# The following solution works on Ubuntu and other
# Debian derived Linux distributions.
# Become root
su
# Find USB devices.
# Search for pattern "sd" i.e.
# :/sd
dmesg | less
# Find out what partitions are currently mounted
df -h | less
# Find out where the different(i.e. Windows,NTFS,ext3) volumes
# are in the partition table
fdisk -l | less
# On my system they are
# dev File System
# ######## ###########
# /dev/sdb ext2
# /dev/sdc ext2
# See properties of sd. devices
udevinfo -a -p `udevinfo -q path -n /dev/sdb` | less
udevinfo -a -p `udevinfo -q path -n /dev/sdc` | less
# ... look for ATTRS{vendor}
# :/ATTRS{vendor}
# Instruct udev to make symlinks for the drives based on the manufactor,
# size, or any number of properties or attributes of the device.
# That symlink will always point to that device. You can modify your
# fstab to use the udev defined symlink which in turn allows you to
# always address the device using the same path.
cat > /etc/udev/rules.d/85-usb-hd-fix.rules <<ENDOFFILE
# backup500
SUBSYSTEM=="block", ATTRS{vendor}=="Maxtor ", SYMLINK+="backup500", GROUP="disk", MODE="0660"
# backup160
SUBSYSTEM=="block", ATTRS{vendor}=="MAXTOR S", SYMLINK+="backup160", GROUP="disk", MODE="0660"
ENDOFFILE
# Change the attributes of the udev rules file
chmod 644 /etc/udev/rules.d/85-usb-hd-fix.rules
# Restart udev
/etc/init.d/udev restart
# Test udev
udevtest /sys/block/sdb block
udevtest /sys/block/sdc block
# Create the mount points
mkdir -p /mnt/backup500
mkdir -p /mnt/backup160
# Append the following to /etc/fstab
/dev/backup500 /mnt/backup500 ext2 rw,auto,user 0 0
/dev/backup160 /mnt/backup160 ext2 rw,auto,user 0 0
# Now, mount all devices defined in /etc/fstab
mount -a
# Or mount individually
mount /mnt/backup500
mount /mnt/backup160
#################### OPTIONAL ####################
# To ensure the drives are always mounted, insert the
# following line to /etc/rc.local before "exit 0"
mount -a
# Change the attributes of the udev rules file
chmod 755 /etc/rc.local
# Reboot
shutdown -r now
#################### OPTIONAL ####################