Mounting USB: block info block detect not able to see exFAT [solved]

I am running 17.01 Snapshot r3032 on WRT1900ACS
I am a bit lost in mounting my usb device. I followed the wiki page, but have no idea how to mount an item that cannot be seen in block info

I don't know how to properly set it up in LEDE

System can locate USB drive I plugged in, as sda (see below)
I have installed/compile kmod-fs-exfat kmod-usb-core kmod-usb-storage
When I try block info and block detect, it does not show the device like the wiki page shown. I use the linux way to check if it is has to do with some kmod or file system package, and can see the file in the USB by using the following commands

mkdir test
mount /dev/sda1 test
ls test

So I unmount it.

Then I try the following command again

root@WRT:~# block info
/dev/ubiblock0_0: UUID="-deleted-in-this-post-1" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/ubi0_1: UUID="-deleted-in-this-post-2" VERSION="w4r0" MOUNT="/overlay" TYPE="ubifs"
/dev/ubi1_0: UUID="-deleted-in-this-post-3" VERSION="w4r0" TYPE="ubifs"
root@WRT:~# block detect
config 'global'
	option	anon_swap	'0'
	option	anon_mount	'0'
	option	auto_swap	'1'
	option	auto_mount	'1'
	option	delay_root	'5'
	option	check_fs	'0'

It does not show the UUID, nor detect the sda1

Below are the System Log during boot up (to show it detected the device)

[    1.771674] usb 3-1: new SuperSpeed USB device number 2 using xhci-hcd
[    1.798065] usb-storage 3-1:1.0: USB Mass Storage device detected
[    1.804286] scsi host2: usb-storage 3-1:1.0
[    2.553437] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
[    2.560738] Freeing unused kernel memory: 268K (c062f000 - c0672000)
[    2.774061] init: Console is alive
[    2.777543] init: - watchdog -
[    3.040870] exFAT: Version 1.2.9
[    3.047244] scsi 2:0:0:0: Direct-Access     Samsung  Flash Drive      1100 PQ: 0 ANSI: 6
[    3.052403] init: - preinit -
[    3.059551] sd 2:0:0:0: [sda] 62652416 512-byte logical blocks: (32.1 GB/29.9 GiB)
[    3.067562] sd 2:0:0:0: [sda] Write Protect is off
[    3.072395] sd 2:0:0:0: [sda] Mode Sense: 43 00 00 00
[    3.072790] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    3.085204]  sda: sda1
[    3.089376] sd 2:0:0:0: [sda] Attached SCSI removable disk

I also tried edit /etc/config/fstab to add the following:

config 'mount'
        option 'target'   '/mnt/sda1'
        option 'device'   '/dev/sda1'
        option 'fstype'   'exFAT'
        option 'options'  'rw,sync'
        option 'enabled'  '0'

then create the folder by mkdir /mnt/sda1
then /etc/init.d/fstab restart
returned: this file has been obsoleted. please call "/sbin/block mount" directly
So I /sbin/block mount
it return:

block: /dev/ubiblock0_0 is already mounted on /rom
block: /dev/ubi0_1 is already mounted on /overlay

I try to get another older non-exFAT USB. It is a vfat. Following the wiki can get it mount successfully.

So the procedures I am using should be okay.

Is it a bug on the exFAT? Do I need to turn switches on when compiling the firmware?

I could not get exfat running under cc15.05.1 and also used vfat with no issues.

The block mount package (part of fstools") does not support exFAT
You need to manually mount it with a command like

mount /dev/sda1 /mnt

I looked into this a few weeks ago when I tested my router's USB3 port with a large exFAT memory stick.

If you have permanently attached the drive to your router, you can e.g. place that mount command into /etc/rc.local that gets run at the end of the boot process.

But fstab (and block) will not work until support for exFAT has been added to fstools.

1 Like

Sadly there's no exFAT support, I was too slow to add it when there was a patch that still applied.
Issue #2 is that is mixes NTFS support with exFAT I have no idea how to distinguish these two in code unless it's obvious.
https://github.com/lede-project/source/pull/423/commits/b0e4c53a22a429a70a2d7d1f3bff049543406483#diff-c4a1f7c43d580eb3b8a83a1cd60a072a

You can ofc mount it manually but no blockmount support...

If someone wants to give this a go please do, it's on my wishlist.

@RangerZ @hnyman Thanks for your confirmation. At least it is something I know I can't do it on my own. I just also looked at the openwrt forum and found the script in one of the post you involved on using rc.local to mount the exFAT

@diizzy do you mean there was once a patch that seems work (on fstools), but because we missed the chance to apply that patch, something changed and it can no longer work, and need to wait until the patch come up from someone else next time?

If you install libblkid, the block executable should be able to detect exFat filesystems.

2 Likes

Thanks for hint, Jo.
It worked. After installing libblkid with "opkg install libblkid" the drive was detected when inserted to USB port.

Strangely though, on the first attempt it was automounted and dismounted and disappeared completely. Manual mount did not work either. Removing and reinserting the stick into the USB port made it to properly automount:

[53392.530626] usb 4-1: new SuperSpeed USB device number 2 using xhci-hcd
[53392.553320] usb-storage 4-1:1.0: USB Mass Storage device detected
[53392.555138] scsi host1: usb-storage 4-1:1.0
[53393.624371] scsi 1:0:0:0: Direct-Access     SanDisk  Ultra            1.00 PQ: 0 ANSI: 6
[53393.626650] sd 1:0:0:0: [sda] 60751872 512-byte logical blocks: (31.1 GB/29.0 GiB)
[53393.632753] sd 1:0:0:0: [sda] Write Protect is off
[53393.638931] sd 1:0:0:0: [sda] Mode Sense: 43 00 00 00
[53393.644585] sd 1:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[53393.675370]  sda: sda1
[53393.677912] sd 1:0:0:0: [sda] Attached SCSI removable disk
[53435.000693] [EXFAT] trying to mount...
[53435.260813] [EXFAT] mounted successfully
[53514.580078] [EXFAT] trying to unmount...
[53514.580298] [EXFAT] unmounted successfully
[53516.503821] usb 4-1: USB disconnect, device number 2
...
[59371.134386] usb 3-1: new high-speed USB device number 2 using xhci-hcd
[59371.278828] usb-storage 3-1:1.0: USB Mass Storage device detected
[59371.280671] scsi host2: usb-storage 3-1:1.0
[59372.286221] scsi 2:0:0:0: Direct-Access     SanDisk  Ultra            1.00 PQ: 0 ANSI: 6
[59372.289611] sd 2:0:0:0: [sda] 60751872 512-byte logical blocks: (31.1 GB/29.0 GiB)
[59372.294910] sd 2:0:0:0: [sda] Write Protect is off
[59372.300785] sd 2:0:0:0: [sda] Mode Sense: 43 00 00 00
[59372.306342] sd 2:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[59372.337654]  sda: sda1
[59372.340310] sd 2:0:0:0: [sda] Attached SCSI removable disk
[59373.808515] [EXFAT] trying to mount...
[59373.975663] [EXFAT] mounted successfully

root@lede:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 6144      6144         0 100% /rom
tmpfs                   239420      1628    237792   1% /tmp
/dev/ubi0_1              17316       244     16152   1% /overlay
overlayfs:/overlay       17316       244     16152   1% /
tmpfs                      512         0       512   0% /dev
/dev/sda1             30359840  10465248  19894592  34% /mnt/sda1
root@lede:~# block detect
config 'global'
        option  anon_swap       '0'
        option  anon_mount      '0'
        option  auto_swap       '1'
        option  auto_mount      '1'
        option  delay_root      '5'
        option  check_fs        '0'

config 'mount'
        option  target  '/mnt/sda1'
        option  uuid    '1E33-5319'
        option  enabled '0'

thanks @jow It works :grinning:

@hnyman How to get the USB auto mount when you pluged in?
I pluged in and the system detected it, but I will need to use command block mount , or in web Generate Config. If I don't do anything, it stoped at Attached SCSI removable disk

Mon Jan 30 12:40:27 2017 kern.info kernel: [35783.765863] usb 3-1: new SuperSpeed USB device number 4 using xhci-hcd
Mon Jan 30 12:40:27 2017 kern.info kernel: [35783.792276] usb-storage 3-1:1.0: USB Mass Storage device detected
Mon Jan 30 12:40:27 2017 kern.info kernel: [35783.798514] scsi host4: usb-storage 3-1:1.0
Mon Jan 30 12:40:28 2017 kern.notice kernel: [35785.030963] scsi 4:0:0:0: Direct-Access     Samsung  Flash Drive      1100 PQ: 0 ANSI: 6
Mon Jan 30 12:40:28 2017 kern.notice kernel: [35785.039994] sd 4:0:0:0: [sda] 62652416 512-byte logical blocks: (32.1 GB/29.9 GiB)
Mon Jan 30 12:40:28 2017 kern.notice kernel: [35785.048000] sd 4:0:0:0: [sda] Write Protect is off
Mon Jan 30 12:40:28 2017 kern.debug kernel: [35785.052812] sd 4:0:0:0: [sda] Mode Sense: 43 00 00 00
Mon Jan 30 12:40:28 2017 kern.notice kernel: [35785.058315] sd 4:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Mon Jan 30 12:40:28 2017 kern.info kernel: [35785.070562]  sda: sda1  
Mon Jan 30 12:40:28 2017 kern.notice kernel: [35785.074972] sd 4:0:0:0: [sda] Attached SCSI removable disk

Enable also anon_mount in your /etc/config/fstab

It enables mounting also previously unseen drives.

Many thanks. Now it run smooth :smiley:

deleted, was wrong