ubi:rootfs_ubifs
uses the character device /dev/ubi0_0
, if that's what you're asking.That I know, but I'm confused as to why some folders in / or /tmp are persistent and some not across system reboots.Enterdf
, then you will find it has been mounted as root/
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.# 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
# 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
/root
directs to /tmp/home/root
:admin@RT-AX86U:/# cd /root
admin@RT-AX86U:/tmp/home/root#
/opt
is linked to it:# 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.In the example below anything intmpfs
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
So something likeRich (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
/root
directs to/tmp/home/root
:
When Entware is installed on an external USB driveRich (BB code):admin@RT-AX86U:/# cd /root admin@RT-AX86U:/tmp/home/root#
/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
/opt -> /tmp/opt -> /tmp/mnt/ClickUSB1
There is a command calledIs 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
realpath
but it's not part of the firmware, although it can be added from Entware.# opkg install coreutils-realpath
# realpath /opt
/tmp/mnt/ClickUSB1/entware
I don't think that works.So you are looking for a command like:
find ./ -type dl -print0 | xargs -0 ls -plah
?
-type dl
is an invalid parameter.find
doesn't support -type
at all (you'd need to install Entware's version):# 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/
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!