Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone have a more comprehensive /etc/auto.disks script for autofs that takes into consideration all mounted disks, even NTFS, FAT32? So all that's needed to mount any attached drive is ls /mnt/sda1 or ls /mnt/sdb2?

This guide along the line of what I'm looking for, except this guy only accesses ext3 drives.

share|improve this question
up vote 1 down vote accepted

Here's what I came up with:

#!/bin/bash
key="$1"
[ -b /dev/${key} ] && {
        fstype=`sudo blkid -s TYPE "/dev/$key" -o value`
        opts="-fstype=$fstype,rw"
        echo "$opts :/dev/${key}";
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.