Take the 2-minute tour ×
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.

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
add comment

1 Answer 1

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
add comment

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.