What's new

How do we reach ubi:rootfs_ubifs as we do with other /dev/* devices

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

What do you mean by "reach"? Can you explain what it is you're trying to do.

It may vary depending on model and firmware but on my router ubi:rootfs_ubifs uses the character device /dev/ubi0_0, if that's what you're asking.
 
Last edited:
Enter df, then you will find it has been mounted as root /
 
Last edited:
Enter df, then you will find it has been mounted as root /
That I know, but I'm confused as to why some folders in / or /tmp are persistent and some not across system reboots.
Everything under /tmp is traditionally a RAMdrive of sorts, at least back when I used OpenWRT on an old 4 MB flash, 32 MB RAM wifi router I used to have. /root gets wiped on reboot, yet /opt/* is kept etc but it's not part of /jffs from any ls -l I've done in the folders.
I must be missing something, because I managed to install something on /opt/* (part of / that didn't use up /jffs space and didn't show up as a /tmp/ folder either in ls -l lookups.

Heh, I'd like to understand the folder setup is setup, because my Linux knowledge can't figure out this stuff.
 
In the example below anything in tmpfs is not persistent. However quite a few other directories may be linked to /tmp, /var or some other storage device (e.g. USB) otherwise they wouldn't be able to be written to.
Rich (BB code):
# df -h
Filesystem        Size  Used Avail Use% Mounted on
ubi:rootfs_ubifs   78M   74M  4.0M  95% /
devtmpfs          456M     0  456M   0% /dev
tmpfs             457M  1.1M  455M   1% /var
tmpfs             457M  1.3M  455M   1% /tmp
ubi1:data         4.5M   64K  4.2M   2% /data
/dev/mtdblock9     47M  3.8M   44M   8% /jffs
/dev/sda2          15G  5.7G  8.8G  40% /tmp/mnt/ClickUSB2
/dev/sda1          15G  4.5G  9.0G  34% /tmp/mnt/ClickUSB1
Rich (BB code):
# ls -l /
drwxr-xr-x    2 admin    root          9800 Mar 25 15:12 bin
drwxr-xr-x    2 admin    root           160 Mar 25 15:12 cifs1
drwxr-xr-x    2 admin    root           160 Mar 25 15:12 cifs2
drwxr-xr-x    2 admin    root           392 Mar 25 17:58 data
lrwxrwxrwx    1 admin    root            16 Mar 25 15:12 debug -> sys/kernel/debug
drwxr-xr-x    5 admin    root          3640 Apr 25 22:33 dev
lrwxrwxrwx    1 admin    root             7 Mar 25 15:12 etc -> tmp/etc
lrwxrwxrwx    1 admin    root             8 Mar 25 15:12 home -> tmp/home
drwxr-xr-x   15 admin    root             0 Apr 28 23:11 jffs
drwxrwxr-x    5 admin    root          5584 Mar 25 15:12 lib
drwxrwxr-x    2 admin    root           384 Mar 25 15:12 lib64
drwxr-xr-x    2 admin    root           160 Mar 25 15:12 mmc
lrwxrwxrwx    1 admin    root             7 Mar 25 15:11 mnt -> tmp/mnt
lrwxrwxrwx    1 admin    root             7 Mar 25 15:12 opt -> tmp/opt
dr-xr-xr-x  173 admin    root             0 Jan  1  1970 proc
drwxr-xr-x    9 admin    root          2680 Mar 25 15:11 rom
lrwxrwxrwx    1 admin    root            13 Mar 25 15:12 root -> tmp/home/root
drwxr-xr-x    2 admin    root         12720 Mar 25 15:11 sbin
dr-xr-xr-x   12 admin    root             0 Jan  1  1970 sys
drwxr-xr-x    2 admin    root           160 Mar 25 15:12 sysroot
drwxrwxrwx   19 admin    root          1460 Apr 28 23:12 tmp
drwxr-xr-x   12 admin    root           880 Mar 25 15:12 usr
drwxrwxrwt   18 admin    root           460 Apr 28 23:08 var
drwxrwxr-x   16 admin    root         29832 Mar 25 15:12 www
So something like /root directs to /tmp/home/root:
Rich (BB code):
admin@RT-AX86U:/# cd /root
admin@RT-AX86U:/tmp/home/root#
When Entware is installed on an external USB drive /opt is linked to it:
Rich (BB code):
# ls -l /opt
lrwxrwxrwx    1 admin    root             7 Mar 25 15:12 /opt -> tmp/opt
# ls -l /tmp/opt
lrwxrwxrwx    1 admin    root            26 Apr 25 22:34 /tmp/opt -> /tmp/mnt/ClickUSB1/entware
 
Last edited:
In the example below anything in tmpfs is not persistent. However quite a few other directories may be linked to /tmp, /var or some other storage device (e.g. USB) otherwise they wouldn't be able to be written to.
Rich (BB code):
# df -h
Filesystem        Size  Used Avail Use% Mounted on
ubi:rootfs_ubifs   78M   74M  4.0M  95% /
devtmpfs          456M     0  456M   0% /dev
tmpfs             457M  1.1M  455M   1% /var
tmpfs             457M  1.3M  455M   1% /tmp
ubi1:data         4.5M   64K  4.2M   2% /data
/dev/mtdblock9     47M  3.8M   44M   8% /jffs
/dev/sda2          15G  5.7G  8.8G  40% /tmp/mnt/ClickUSB2
/dev/sda1          15G  4.5G  9.0G  34% /tmp/mnt/ClickUSB1
Rich (BB code):
# ls -l /
drwxr-xr-x    2 admin    root          9800 Mar 25 15:12 bin
drwxr-xr-x    2 admin    root           160 Mar 25 15:12 cifs1
drwxr-xr-x    2 admin    root           160 Mar 25 15:12 cifs2
drwxr-xr-x    2 admin    root           392 Mar 25 17:58 data
lrwxrwxrwx    1 admin    root            16 Mar 25 15:12 debug -> sys/kernel/debug
drwxr-xr-x    5 admin    root          3640 Apr 25 22:33 dev
lrwxrwxrwx    1 admin    root             7 Mar 25 15:12 etc -> tmp/etc
lrwxrwxrwx    1 admin    root             8 Mar 25 15:12 home -> tmp/home
drwxr-xr-x   15 admin    root             0 Apr 28 23:11 jffs
drwxrwxr-x    5 admin    root          5584 Mar 25 15:12 lib
drwxrwxr-x    2 admin    root           384 Mar 25 15:12 lib64
drwxr-xr-x    2 admin    root           160 Mar 25 15:12 mmc
lrwxrwxrwx    1 admin    root             7 Mar 25 15:11 mnt -> tmp/mnt
lrwxrwxrwx    1 admin    root             7 Mar 25 15:12 opt -> tmp/opt
dr-xr-xr-x  173 admin    root             0 Jan  1  1970 proc
drwxr-xr-x    9 admin    root          2680 Mar 25 15:11 rom
lrwxrwxrwx    1 admin    root            13 Mar 25 15:12 root -> tmp/home/root
drwxr-xr-x    2 admin    root         12720 Mar 25 15:11 sbin
dr-xr-xr-x   12 admin    root             0 Jan  1  1970 sys
drwxr-xr-x    2 admin    root           160 Mar 25 15:12 sysroot
drwxrwxrwx   19 admin    root          1460 Apr 28 23:12 tmp
drwxr-xr-x   12 admin    root           880 Mar 25 15:12 usr
drwxrwxrwt   18 admin    root           460 Apr 28 23:08 var
drwxrwxr-x   16 admin    root         29832 Mar 25 15:12 www
So something like /root directs to /tmp/home/root:
Rich (BB code):
admin@RT-AX86U:/# cd /root
admin@RT-AX86U:/tmp/home/root#
When Entware is installed on an external USB drive /opt is linked to it:
Rich (BB code):
# ls -l /opt
lrwxrwxrwx    1 admin    root             7 Mar 25 15:12 /opt -> tmp/opt
# ls -l /tmp/opt
lrwxrwxrwx    1 admin    root            26 Apr 25 22:34 /tmp/opt -> /tmp/mnt/ClickUSB1/entware
Is there a Linux command that can output every jump of a symlink chain like THAT? Purpose would be to eliminate the headache of locating real paths or certain files or directories.
Example: /opt -> /tmp/opt -> /tmp/mnt/ClickUSB1

Or maybe a "list only symlinks in a tree style visual output that shows a branch of every recursive symlink etc."mount" and "df" commands sure don't tell the whole story by themselves.

Thank you for taking the time to answer my questions either way. I am very grateful.
 
So you are looking for a command like:
find ./ -type dl -print0 | xargs -0 ls -plah
?
 
Is there a Linux command that can output every jump of a symlink chain like THAT? Purpose would be to eliminate the headache of locating real paths or certain files or directories.
Example: /opt -> /tmp/opt -> /tmp/mnt/ClickUSB1
There is a command called realpath but it's not part of the firmware, although it can be added from Entware.
Code:
# opkg install coreutils-realpath
# realpath /opt
/tmp/mnt/ClickUSB1/entware

So you are looking for a command like:
find ./ -type dl -print0 | xargs -0 ls -plah
?
I don't think that works. -type dl is an invalid parameter.

You're probably thinking of something like this but the router's built-in version of find doesn't support -type at all (you'd need to install Entware's version):
Code:
# find / -path /proc -prune -o -path /sys -prune -o -type l -print0 | xargs -0 ls -lp | grep '/$'
lrwxrwxrwx    1 admin    root            16 Mar 25 15:12 /debug -> sys/kernel/debug/
lrwxrwxrwx    1 admin    root             7 Mar 25 15:12 /etc -> tmp/etc/
lrwxrwxrwx    1 admin    root             8 Mar 25 15:12 /home -> tmp/home/
lrwxrwxrwx    1 admin    root             7 Mar 25 15:11 /mnt -> tmp/mnt/
lrwxrwxrwx    1 admin    root             7 Mar 25 15:12 /opt -> tmp/opt/
lrwxrwxrwx    1 admin    root            13 Mar 25 15:12 /root -> tmp/home/root/
lrwxrwxrwx    1 admin    root            27 Apr 26 01:00 /tmp/diag_db_cloud/download/conn_diag_1650931200.db -> /tmp/diag_db_cloud/download/
lrwxrwxrwx    1 admin    root            27 Apr 27 01:00 /tmp/diag_db_cloud/download/conn_diag_1651017600.db -> /tmp/diag_db_cloud/download/
lrwxrwxrwx    1 admin    root            27 Apr 28 01:00 /tmp/diag_db_cloud/download/conn_diag_1651104000.db -> /tmp/diag_db_cloud/download/
lrwxrwxrwx    1 admin    root            27 Apr 29 01:00 /tmp/diag_db_cloud/download/conn_diag_1651190400.db -> /tmp/diag_db_cloud/download/
lrwxrwxrwx    1 admin    root            13 Jan  1  1970 /tmp/etc/adsl -> /rom/etc/adsl/
lrwxrwxrwx    1 admin    root            13 Jan  1  1970 /tmp/etc/dhcp -> /rom/etc/dhcp/
lrwxrwxrwx    1 admin    root            15 Jan  1  1970 /tmp/etc/init.d -> /rom/etc/init.d/
lrwxrwxrwx    1 admin    root            17 Jan  1  1970 /tmp/etc/iproute2 -> /rom/etc/iproute2/
lrwxrwxrwx    1 admin    root            12 Jan  1  1970 /tmp/etc/ppp -> /rom/etc/ppp/
lrwxrwxrwx    1 admin    root            14 Jan  1  1970 /tmp/etc/rc3.d -> /rom/etc/rc3.d/
lrwxrwxrwx    1 admin    root            12 Jan  1  1970 /tmp/etc/ssl -> /rom/etc/ssl/
lrwxrwxrwx    1 admin    root            12 Jan  1  1970 /tmp/etc/web -> /rom/etc/web/
lrwxrwxrwx    1 admin    root            13 Jan  1  1970 /tmp/etc/wlan -> /rom/etc/wlan/
lrwxrwxrwx    1 admin    root            26 Apr 25 22:34 /tmp/opt -> /tmp/mnt/ClickUSB1/entware/
lrwxrwxrwx    1 admin    root            10 Mar 25 15:12 /usr/local/share -> /tmp/share/
lrwxrwxrwx    1 admin    root            10 Mar 25 15:12 /usr/share/share -> /tmp/share/
lrwxrwxrwx    1 admin    root             6 Mar 25 15:12 /usr/tmp -> ../tmp/
lrwxrwxrwx    1 admin    root            15 Mar 25 15:12 /www/ext -> /tmp/var/wwwext/
lrwxrwxrwx    1 admin    root            15 Mar 25 15:12 /www/user -> /tmp/var/wwwext/
 
Last edited:

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top