2
votes

I am new to OpenWrt and Linux/Unix shell. Prior to this, was using dd-wrt for 2 years. Recently switched to OpenWrt and got the basic setup done(wifi/internet working). I need to install transmission my router. But, USB device won't mount.

The Details of the router are as follows:

Router Model: Asus RT-N13U B1

Image flashed: chaos_calmer 15.05.1 (openwrt-15.05.1-ramips-rt305x-rt-n13u-squashfs-sysupgrade.bin)

Usb Details: Crusier Blade 16GB usb 2.0 Formatted to ext4 using GParted bootable cd

Drivers Installed:

  • kmod-usb-core(preinstalled)
  • kmod-usb-dwc2(preinstalled)
  • kmod-usb2
  • kmod-usb-storage
  • kmod-fs-ext4
  • kmod-scsi-core(preinstalled)

Here are permissions for dev/sda, /dev/sda1 and /mnt (set 777 manually):

~#ls -l /dev
brwxrwxrwx    1 root     root        8,   0 Jan 17 21:56 sda
brwxrwxrwx    1 root     root        8,   1 Jan 17 21:56 sda1

~#ls -l ..
drwxrwxrwx    2 root     root             0 Jan 16 21:28 mnt

Error while mounting:

~# mount -t ext4 /dev/sda1 /mnt
mount: mounting /dev/sda1 on /mnt failed: No such file or directory

echo $?
255

sda1 is present inside dev and /mnt directory exists. Still it shows an error.

I have tried installing/reinstalling and then mounting, but for the same result. Also when I disconnect the USB sda and sda1 folders disappear and then reappear when USB is reconnected so I guess the device is being detected successfully.

What is it, that I am missing?

Edit: Added edits as suggested in the comments.

dmesg output (The output is very big so linked it)

Edit 2: Switched to LEDE 17. Is more stable and have had zero issues in the past week.

1
Check again if /mnt does really exist.Ipor Sircer
Yes I even tried cd /mnt. The path changes to /mnt#Saurabh Harwande
"[ 11.550000] EXT4-fs (sda1): Cannot load crc32c driver."Ignacio Vazquez-Abrams
@IgnacioVazquez-Abrams So does it mean the driver is missing or some other problem.Saurabh Harwande

1 Answers

1
votes

the critical part of the dmesg output is

[ 9.410000] mount_root: loading kmods from internal overlay

[ 9.940000] SCSI subsystem initialized

[ 9.960000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

[ 9.980000] ehci-platform:EHCI generic platform driver [ 9.990000] usb-storage 1-1:1.0: no of_node; not parsing pinctrl DT

[ 9.990000] usb-storage 1-1:1.0: USB Mass Storage device detected

[ 10.010000] scsi host0: usb-storage 1-1:1.0

[ 10.020000] usbcore: registered new interface driver usb-storage

[ 10.100000] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab

[ 10.120000] block: extroot: not configured

[ 10.130000] mount_root: switching to jffs2 overlay

[ 10.180000] procd: - early -

[ 11.020000] scsi 0:0:0:0: Direct-Access SanDisk Cruzer Blade 1.27 PQ: 0 ANSI: 6

[ 11.030000] sd 0:0:0:0: no of_node; not parsing pinctrl DT

[ 11.050000] sd 0:0:0:0: [sda] 30529536 512-byte logical blocks: (15.6 GB/14.5 GiB)

[ 11.070000] sd 0:0:0:0: [sda] Write Protect is off

[ 11.070000] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00

[ 11.090000] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA

[ 11.120000] sda: sda1

[ 11.130000] sd 0:0:0:0: [sda] Attached SCSI removable disk

[ 11.550000] EXT4-fs (sda1): Cannot load crc32c driver

oh no, this seems to be a bug

Bug#819725: ext4 missing softdep on crc32c module

https://lists.debian.org/debian-kernel/2016/04/msg00013.html

the following workaround is not applicable because initramfs is a native file system at startup time (https://en.wikipedia.org/wiki/Initramfs) and has no influence when the system is fully up (rootfs is mounted):

Until this is fixed in the kernel package, you can work around it by either:

  • Setting base-installer/initramfs-tools/driver-policy to "most" instead of "dep"
  • Setting base-config/late_command to a script that adds crc32c to /etc/initramfs-tools/modules

post the stack trace anyway, maybe there is another workaround

this is overcomplicated stuff...

here is maybe a solution https://forum.openwrt.org/viewtopic.php?id=69175

download kmod-lib-crc32c and kmod-crypto-crc32c

if this is not working maybe the easiest solution is to format the USB stack as VFAT and to wait for a new kernel...


this is not a permissions error. a permission error would return EPERM -> error code 1 Operation not permitted

it would be interesting to know what exit code the mount returns. The 'exit behavior is very different in the several mount version' i.e. mount(2) and mount(8)

for getting the return value, type in a shell the command

mount /dev/sda1 /mnt

then

echo $?

the number is the returned exit code of the mount (the 255 means 'exit status out of range' in this case '-1', http://www.tldp.org/LDP/abs/html/exitcodes.html#EXITCODESREF)

a listing of the mount(8) exit codes is i.e. in http://www.stackoverflow.com/questions/33167585/what-are-the-return-codes-values-of-linux-umount

http://www.becane.com/2014/09/02/understanding-exit-codes-and-how-to-use-them-in-a-bash-script

beside the return value mount(2) also sets an error code in errno (http://man7.org/linux/man-pages/man3/errno.3.html). printing errno in shell is a bit difficult it is easier to get a reference like http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Errors/unix_system_errors.html and search for the error string, in this case No such file or directory

the string No such file or directory is system error ENOENT

As a system error ENOENT means A pathname was empty or had a nonexistent component. (http://man7.org/linux/man-pages/man2/mount.2.html)

try sudo mount -t ext4 /dev/sda1 /mnt because the stick is formatted in ext4

if this is not working dmesg output would be interesting

detach usb device, reattach usb device, type dmesg and see the output. in the output of dmesg you also see which drivers are loaded for the device

https://wiki.openwrt.org/doc/howto/usb.storage says that you need several more drivers (block-mount, kmod-scsi-core,...) because a usb stick (USB Mass Storage class) is also a SCSI and a block device...

(linux system error codes are in http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Errors/unix_system_errors.html)

print a stack trace sudo strace -f mount -t ext4 -o default /dev/sda1 /mnt and post it