OpenWrt Forum Archive

Topic: NTFS automount/fstab doesn't work

The content of this topic has been archived on 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I upgrade my TP-Link TL-WDR4300 v1, to OpenWrt Barrier Breaker 14.07-rc3.

The automount in fstab works with ext3, but don't work with NTFS.

I have 2 disks in 2 USB ports:

Disk1 - 4TB, NTFS (I connect in other PC and Mac)
Disk2 - 13BG, ext3

Manual mount using ntfs-3g works fine:

mount -t ntfs-3g -o rw,sync /dev/sda1 /mnt/media

My /etc/config/fstab

config global
        option anon_swap '0'
        option anon_mount '0'
        option auto_swap '0'
        option auto_mount '0'
        option delay_root '5'
        option check_fs '0'

#works fine
config mount
        option target '/mnt/pendrive'
        option fstype 'ext3'
        option options 'rw,sync'
        option enabled '1'
        option uuid '365ed0a5-c986-4eef-b594-8ed0650ef01f'

#doesn't work
config mount
        option target '/mnt/media'
        option fstype 'ntfs-3g'
        option options 'rw,sync'
        option enabled '1'
        option device '/dev/sda1'

I already tried setting the various forms since yesterday, with label, uuid, device, fstype 'ntfs-3g', fstype 'ntfs', but I had no success.

Is possible to configure NTFS in fstab?

fstab + ntfs = not work

To mount ntfs on boot, I remove ntfs from fstab and change file:

vi /etc/hotplug.d/block/10-mount 

To:

#!/bin/sh
# Copyright (C) 2011 OpenWrt.org

blkdev=`dirname $DEVPATH`
if [ `basename $blkdev` != "block" ]; then
        device=`basename $DEVPATH`
        case "$ACTION" in
                add)
                        if [ `which fdisk` ]; then
                                isntfs=`fdisk -l | grep $device | grep Microsof$
                        else
                                isntfs=""
                        fi

                        # mount with ntfs-3g if possible, else with default mou$
                        if [ "$isntfs" ]; then
                                ntfs-3g -o rw,sync /dev/$device /mnt/media
                        fi
                ;;
                remove)
                        umount -l /dev/$device
                ;;
        esac
fi

Adjusted from http://wiki.openwrt.org/doc/howto/writable_ntfs. My hotplug script see only ntfs, and my fdisk show NTFS as Microsoft.

The discussion might have continued from here.