I've got a Ravpower RP-WD009 and want to put logs on an external flash device. Unfortunately, when a SD card or USB drive is installed, nothing shows up in /dev. Do they show up somewhere else? Thanks!
https://openwrt.org/docs/guide-user/storage/usb-drives-quickstart
This has some good info. It also links to a more detailed guide for more information.
Ok, I installed all the listed packages, I do see the drive, somewhat. In /dev, I see mmcblk0 and mmcblk0p1. In luci, mount points, I created a new mount point based on the label of the drive (Which shows up properly). However, under mounted filesystems I don't see it. In Overlay/work, I don't see it either. What am I doing wrong?
Also:
root@OpenWrt:/# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 3.8M 3.8M 0 100% /rom
tmpfs 27.9M 108.0K 27.8M 0% /tmp
/dev/mtdblock10 8.1M 2.0M 6.1M 24% /overlay
overlayfs:/overlay 8.1M 2.0M 6.1M 24% /
tmpfs 512.0K 0 512.0K 0% /dev
Thanks!
What file system is the drive?
It doesn't look right. Your /overlay seems to be the same size of the original flash "partition". If your goal is to increase the /overlay partition, you should follow the Extroot configuration. For data partition, this is what I normally do. Create the mount point under the root partition (/dataSD, for example) through SSH and then at LuCI Mount Points tab, select the SD partition and custom mount point - enter /dataSD and must hit the "enter" key before "Save". (Be sure to hit the "enter" key; there were too many times I missed the enter key and wondered why it didn't work.)
It's FAT32
I noticed the size didn't seem right. I tried to remove everything and start over but /overlay was still present. I edited fstab and removed reference to the drive but it was still there. I'm not even sure if I should be mounting it in overlay, this is all new to me. I want to save logs to the MicroSD. How would I create the mount point under the root partition?
I believe I MIGHT have made progress, but still not working.
First, I reset OpenWRT to defaults, reinstalled packages, went to the Mount tab. Under mount points, I saw my SD card. Size was right. It was mmcblk0p1. There was a check box next to it to enable. I selected the check box. After rebooting I looked in /mnt and saw mmcblk0p1. I thought it worked, even though I didn't see the test.txt file I put on the root of the SD card. I configure logs to save there. When I go to mmcblk0p1/log I see and can read the log file. However, when I shut down and put the SD card in my laptop, all I see is the test.txt file I made, no logs. Where did I go wrong?
If you put it back into your OpenWrt device and mount it, do the log files still show and can you view them?
Show us the output of lsblk -f
or mount
.
Thanks for the help!
lsblk -f outputs this:
mtdblock0
mtdblock1
mtdblock2
mtdblock3
mtdblock4
mtdblock5
mtdblock6
mtdblock7
mtdblock8
mtdblock9
squash 0 100% /rom
mtdblock10
6.1M 25% /ove rlay
mtdblock11
mmcblk0
└─mmcblk0p1
vfat 2GB 3820-A084
mount shows this:
/dev/root on /rom type squashfs (ro,relatime,errors=continue)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mtdblock10 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,noexec,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
bpffs on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
If it helps, these are the packages I'm installing:
block-mount e2fsprogs kmod-usb-storage-uas kmod-usb3 luci-app-hd-idle kmod-fs-ext4 nano
For fat32 you need to install kmod-fs-vfat.
https://openwrt.org/docs/guide-user/storage/filesystems-and-partitions#fat32
The format of your output looks a bit different than what I expected but I think there is enough to work with.
With the header, it should look something like this:
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
mmcblk0
└─mmcblk0p1 vfat 2GB 3820-A084
To mount mmcblk0p1
, you should mount it under /mnt/
and not as /mnt/
.
You can give the mountpoint, which looks like a directory name a more meaningful name if you like.
For your sd-card, I'll use sd-logs
in my example.
It is recommended to use the UUID as the target identifier rather than the path under /dev for the mount.
As @d687r02j8g pointed out, you need kernel module kmod-fs-vfat
installed. To confirm that, on the ssh
command line, issue command ls /lib/modules/*/vfat*
and you should see someting for vfat
like /lib/modules/6.6.73/vfat.ko
.
With the sd-card inserted, verify that it is seen with block info
. Note the UUID.
In luci -> System -> Mount Points, check that it is not mounted in the "Mounted file systems section".
In the "Mount Points" section, is it there or not? If there, is the "enabled" check box not checked?
If it is not there then try the following.
To add the vfat filesystem of partition 1 of the sd-card with UUID 3820-A084
as a mount at /mnt/sd-logs
:
Click the "Add" button in the "Mount Points" section,
Select UUID 3820-A084
in the UUID field,
In the "Mount point" field, click "Please choose" and select "-- custom --"
Enter "/mnt/sd-logs" and check the "Enabled" check box near the top if it is unchecked, then click "Save".
Back at the "Mount points" page, scroll to the bottom and click "Save & Apply".
After the confirmation message, the mount point should show on the page.
If it does, try using it.
On ssh command-line,
cd /mnt/sd-logs
ls
touch test.txt
Maybe copy a text file to it.
If you intend to move the sd-card to a pc, be sure to close all files on the sd-card filesystem and unmount
the filesystem before removing the card.
You can do a very similar process with a usb flash drive but you may also need usb drivers installed. You could use a mountpoint name like /mnt/usb-logs
and again, be sure to unmount the filesystem before physically removing so you don't wind up with a corrupt filesystem. Ask if you want some more specific directions.
Thanks everyone for the help! I got access to it, log files writing properly.