Setup Fat16/32 Partions
#!/bin/bash
# this script checks for vfat partions and adds mount points to them in fstab
# with ownership given to the primary user (eg. 500)
# the partions will be mounted automatically on boot
# superuser privelages are required to run this script
first_letter=143 # letter 'c'
last_letter=172 # letter 'z'
cur_letter=$first_letter
gid=500
uid=500
for device in $(/sbin/fdisk -l | awk '/FAT32/ { print $1 }');
do
echo -ne "Adding drive \\$cur_letter" ":"
drive_path=$(echo -e "/mnt/drive\\$cur_letter")
echo -e $device " " "$drive_path" " vfat rw,auto,uid=$uid,gid=$gid 0 0" >> /etc/fstab
mkdir $drive_path
echo " [ OK ]"
if [[ $cur_letter < $last_letter ]]
then
((cur_letter++))
fi
done
http://www.pembo13.com/scripts/bash/setup-vfat.sh
Setup Fat16/32 Partions