You can do this by extending these rules as your need -
# Start at sdb to avoid system harddrive.
KERNEL!="sd[b-z][0-9]", GOTO="media_by_label_auto_mount_end"
# Import FS infos
IMPORT{program}="/sbin/blkid -o udev -p %N"
# Get a label if present, otherwise specify one
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"
# Global mount options
ACTION=="add", ENV{mount_options}="defaults,relatime"
# Filesystem-specific mount options
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"
# Mount the device
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}"
# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"
# Exit
LABEL="media_by_label_auto_mount_end"
Take a closer look at the rules. It is not working for hard disk drives. KERNEL!="sd[b-z][0-9]", GOTO="media_by_label_auto_mount_end"
says if device name is sda* (if not sdb* or sdc*) go to the label media_by_label_auto_mount_end
ie. to the end of the rules. So Edit the line as you want. But don't forget about the system drive. Add an exception for it.
If your system drive is /dev/sda7 then first couple of line should be
KERNEL=="sda7" GOTO="media_by_label_auto_mount_end" #sda7 is system drive, so go to end.
#KERNEL!="sd[b-z][0-9]", GOTO="media_by_label_auto_mount_end"
If you need to run additional command(s) concatenate them with RUN
.
For more on udev rules click here
nautilus-open-terminal
Log out and log back in. Now you can right click inside any folder and open a terminal in the current folder path. 2. Linking: Theln -s
command can help you create a symbolic link of a folder to the root filesystem. sudo ln -s /media/myfolder /m1 ls -l /m1/
dir. That's the point