I wished to use a usb flash drive retaining the original fat 32 format and after reading the advice on the forum concocted the following.
#SSH into the router.
# Copy/paste each line below, then press Return
opkg update && opkg install block-mount e2fsprogs kmod-fs-ext4 kmod-usb3 kmod-usb2 kmod-usb-storage kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1
#Attach usb drive now
block detect > /etc/config/fstab
uci set fstab.@mount[0].enabled='1' && uci set fstab.@global[0].check_fs='1' && uci commit
/sbin/block mount && service fstab enable
I ran this and it completed albeit with an error (?) resulting from the last command
root@OpenWrt:~# /sbin/block mount && service fstab enable
block: /dev/ubiblock0_1 is already mounted on /rom
block: /dev/ubi0_2 is already mounted on /overlay
block: check_filesystem: /usr/sbin/dosfsck not found
However having logged into the router using LuCi the drive was mounted on /dev/sda and having installed samba it was available on the network and functioned normally.
Should I be concerned that it did not mount an /dev/sda1 for example and if so what would be the best way to rectify this?
I am new to OpenWRT and somewhat technically challenged so please take that into account when replying!
Thanks
Keith
Hi there, you did the steps as it was written but the problem is those steps are not for everyone, meaning everyone's use-case would be different.
Now first you need to make sure how many partitions are on the USB drive? USB will be identified as /dev/sda and the partitions will be listed as /dev/sda1,/dev/sda2` etc.
I believe you have 1 partition on the USB so this is how you do it:
Install any required packages according to your needs -- block-mount kmod-usb2 kmod-usb-uhci kmod-usb-ohci kmod-usb-storage kmod-fs-* (* here tells you whatever filesystem you want, so for you that would be vfat, you may only need kmod-usb2 if you have USB 2.0 and kmod-usb3 if you have USB 3.0).
Once installed, connect the USB and issue block detect > /etc/config/fstab, this will create the fstab config and then you will need to edit the /etc/config/fstab to enable the auto mount of USB on boot. Use vi editor for editing the file. (Google for any tutorials)
Then create a folder for your USB drive to access the files, lets say, data, issue mkdir /data to create the folder and then issue mount /dev/sda1 /data. This will mount the USB drive to data directory and now you can access your device in the /data folder.
There should not be any problems. But it is strongly recommended to use ext4 as filesystem. Because FAT32 has obvious problems.
The drive was not "mounted" on "/dev/sda", that is the device identifier; execute "mount" to see where it was really mounted (and what was mounted, because it is probably "/dev/sda1" instead).
Hi thanks for both replies!
If I understand correctly running the command "mkfs.ext4 /dev/sda1", which I did when creating an ext4 formatted drive, therefore creates the file system to be mounted as sda1.
I did run the mount command with the following results:
root@OpenWrt:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/ubi0_2 on /overlay type ubifs (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
/dev/sda on /mnt/sda type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
So that seems to confirm that the device itself is mounted.
many thanks
Keith
First please use the code blocks (</> icon) to put commands and their output here.
Secondly, as far as I know, there seems to be a problem with your USB. For any USB drive, it should be mounted as /dev/sda* (* = 1,2,3...) but in your case it is being mounted on /dev/sda. It means that probably drive does not have a partition in it, although I could be wrong. Doing ls /dev/ might show you possible connected devices.
If you can use a computer to format the drive the way you want, ext4 or fat32 and make sure it has a partition where you can keep data. Then connect to router again. Once connected, issue mount /dev/sda1 /data to mount the drive on /data directory.
There is something really wrong with that setup of yours: you claim to have created an ext4 filesystem on the first partition, yet you have mounted the whole drive as a vfat partition...
Hi to all,
Sorry I am new to OpenWRT, linux etc.
I do have WRT3200ACM with this nice firmware.
PROBLEM I face is write/delete files and folders from mounted 64GB USB key via WindowsExplorer. I alway get fatal errors, permission denied because of disk is write-protected..
However I do see files preloaded from Windows. I can execute them and read.
MY SETTINGS:
First I went to menu System/MountPoints and mounted drive to /mnt/sda1. Checkbox Enabled.
Second went to menu Services/NetworkShares->SharedDirectories
Name: VIDEO
Path: mnt/sda1
Browseable: yes
Read only: no
ForceRoot: yes (otherwise I can't acces drive at all)
Allowed users: [empty]
Allow guests: yes
Guests only: yes (no difference Yes or No selected)
Inherit owner: yes (no difference Yes or No selected)
Create mask: 0666
Directory mask: 0777
Vfs objects: [empty]
Apple time...: [empty]
Time machine...: [empty]
I assume problem related to permissions, but 0666 and 0777 seems OK as far I have googled.
Any help?