| OpenWrt File System Hierarchy | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Flash Storage Partitioning (TP-Link WR1043ND) | Main Memory Usage | ||||||||
| Hardware | m25p80 spi0.0: m25p64 8192 KiB | main memory 32 768 KiB | |||||||
| Layer1 | @#de401d:mtd0 u-boot 128 KiB | @#25540b:mtd5 firmware 8000 KiB | @#1dbade:mtd4 art 64 KiB | @#ff00ff:Kernel space 3828 KiB | @#00ffff:User space 28 940 KiB | ||||
| Layer2 | @#de401d: | @#a11dde:mtd1 kernel 1280 KiB | @#378712:mtd2 rootfs 6720 KiB | @#1dbade: | @#ff00ff: | @#00ffff:up to 50% | @#00ffff:512 KiB | @#00ffff:remaining | |
| mountpoint | @#de401d: | @#a11dde: | @#378712:/ | @#1dbade: | @#ff00ff: | @#00ffff: | @#00ffff: | @#00ffff: | |
| filesystem | @#de401d: | @#a11dde: | @#378712:filesystems#overlayfs | @#1dbade: | @#ff00ff: | @#00ffff: | @#00ffff: | @#00ffff: | |
| Layer3 | @#de401d: | @#a11dde: | @#dea11d:1536 KiB | @#5ade1d:mtd3 rootfs_data 5184 KiB | @#1dbade: | @#ff00ff: | @#00ffff: | @#00ffff: | @#00ffff: |
| mountpoint | @#de401d:none | @#a11dde:none | @#dea11d:/rom | @#5ade1d:/overlay | @#1dbade:none | @#ff00ff: | @#00ffff:/tmp | @#00ffff:/dev | @#00ffff: |
| filesystem | @#de401d:none | @#a11dde:none | @#dea11d:SquashFS | @#5ade1d:JFFS2 | @#1dbade:none | @#ff00ff: | @#00ffff:tmpfs | @#00ffff:tmpfs | @#00ffff: |
/</color> this is your entire root filesystem, it comprises /rom and /overlay. Please ignore /rom and /overlay and use exclusively / for your daily routines!/rom</color> contains all the basic files, like busybox, dropbear or iptables. It also includes default configuration files used when booting into OpenWrt Failsafe mode. It does not contain the Linux kernel. All files in this directory are located on the SqashFS partition, and thus cannot be altered or deleted. But, because we use overlay_fs filesystem, so called overlay-whiteout-symlinks can be created on the JFFS2 partition./overlay</color> is the writable part of the file system that gets merged with /rom to create a uniform /-tree. It contains anything that was written to the router after installation, e.g. changed configuration files, additional packages installed with opkg, etc. It is formated with JFFS2.#!/bin/sh
# shows all overlay-whiteout symlinks in the directory /overlay
find /overlay -type l | while read FILE
do
[ -z "$FILE" ] && break
if ls -la "$FILE" 2>&- | grep -q '(overlay-whiteout)'; then
echo "$FILE"
fi
done
/tmp</color> is a tmpfs-partition#!/bin/sh
# shows current size of the tmpfs-partition mounted to /tmp
calc_tmpfs_size() {pi_size=$(awk '/MemTotal:/ {l=10485760;mt=($2*1024);print((s=mt/2)<l)&&(mt>l)?mt-l:s}' /proc/meminfo)}}
echo $pi_size
/dev</color> Driver Core: devtmpfs - kernel-maintained tmpfs-based /dev