Quote:
Originally Posted by ShadowOfGed
Here's a better way to do the probe, that mimics how Apple's ntfs.util behaves:
Code:
function Probe() {
DEVICE="/dev/$2"
LABEL=`/usr/local/sbin/ntfslabel -n ${DEVICE}`
RESULT=$?
if [ $RESULT -ne 0 ]; then
# Reading the label failed, so it's not NTFS
exit -2 # FSUR_UNRECOGNIZED
else
# Reading label succeeded, so it's NTFS
echo -n "${LABEL}"
exit -1
fi
} Run Apple's ntfs.util on an unmounted, but present NTFS volume, and see how it's output acts.
|
But what happens if the volume doesn't have a label?
Quote:
This mimics it exactly, and might perhaps get name detection down.
|
Name detection is fine, actually:
Code:
`/usr/local/sbin/ntfslabel -fq $device 2>/dev/null`
I've had that for a while; I just removed it temporarily while other mounting stuff was in the way.