#!/bin/bash
disk=0
part=0
sudo mkdir /media/auto
while [ test -e /dev/sd$disk ]
do
    echo sd$disk
    sudo mkdir /media/auto/sd$disk
    while [ test -e /dev/sd$disk$part ]
    do
        echo - sd$disk$part
        sudo mkdir /media/auto/sd$disk/sd$disk$part
        sudo mount /dev/sd$disk$part /media/auto/sd$disk/sd$disk$part
	part=$(expr $part + 1)
    done
    disk=$(expr $disk + 1)
    part=0
done
echo "done"
