[Solved] Mounting two NTFS disks

So, I have two HDDs connected to my Archer C7 V2 running OpenWrt 18.06.02.

Each disk has only 1 NTFS partition, mounted on boot by rc.local

ntfs-3g /dev/sda1 /HP -o rw,sync
ntfs-3g /dev/sdb1 /WD -o rw,sync

Now the thing is that I may sometimes remove WD disk, but I would like HP to remain working, even after rebooting the router, without me having to change anything in the config. The problem is that the WD disk seems to be ready before the other disk, so it appears to take /dev/sda1, and leave /dev/sdb1 for the HP disk.

I'm aware of the bug with the UUID for NTFS disks, as reported by more than one user (e.g. Automount NTFS HDD on boot using UUID), so using UUID for mounting the disk doesn't seem like a solution.

root@C7:~# block info
/dev/mtdblock2: UUID="1748d829-b790e1c0-4aac514d-aa6fd187" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock3: MOUNT="/overlay" TYPE="jffs2"
/dev/sda1: UUID="0000001800000048" TYPE="ntfs"
/dev/sdb1: UUID="0000001800000048" TYPE="ntfs"
opkg update
opkg install blkid
blkid
mount.ntfs -o "${OPTIONS}" "$(blkid --uuid "${UUID}")" "${DIR}"
2 Likes

Thanks @vgaetera

So I understand I should put that in rc.local instead of ntfs-3g

Why I don't understand is how to pass these parameters to the command. Excuse my little Linux knowledge.

I tried mount.ntfs -o rw,sync blkid --uuid "7CAE4640AE45F2E6" /WD
and mount.ntfs -o "rw,sync" "(blkid --uuid 7CAE4640AE45F2E6)" "/WD"
It didn't like it.

Thanks

mount.ntfs -o "rw,sync" "$(blkid --uuid 7CAE4640AE45F2E6)" "/WD"
2 Likes

Great. Many thanks @vgaetera

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.