OpenWRT Notes
Console Details, Root Details
Useful to see console details, but also root partition details.
root@allie:~# cat /proc/cmdline
earlyprintk console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=auto rootwait
Only 105MB Root Partition in Turris Omnia
Stock OpenWRT for Turris Omnia is a bit weird and does not utilize whole 8GB of space of MMC storage. I wasn't successful (so far) to change root size to include also free space and also exroot didn't work.
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 35327 33280 16.3M c W95 FAT32 (LBA)
/dev/mmcblk0p2 36864 250367 213504 104.3M 83 Linux
Disk /dev/mmcblk0: 7.28 GiB, 7818182656 bytes, 15269888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x415c862a
root@allie:~# dmesg | grep mmc
[ 0.000000] Kernel command line: earlyprintk console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=auto rootwait
[ 2.046853] mmc0: SDHCI controller on f10d8000.sdhci [f10d8000.sdhci] using ADMA
[ 2.166186] mmc0: new high speed MMC card at address 0001
[ 2.171945] mmcblk0: mmc0:0001 008G30 7.28 GiB
[ 2.177684] mmcblk0: p1 p2
[ 2.180812] mmcblk0boot0: mmc0:0001 008G30 4.00 MiB
[ 2.186196] mmcblk0boot1: mmc0:0001 008G30 4.00 MiB
[ 2.191405] mmcblk0rpmb: mmc0:0001 008G30 4.00 MiB, chardev (247:0)
[ 7.716201] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[ 7.723501] F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 1th superblock
[ 7.732178] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x6020601)
[ 7.739953] F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 2th superblock
DNS resolv.conf
File Location
Files in /rom
are from a image and cannot be modified, /etc
are overlay files, /tmp
are files created dynamically and will go away on reboot.
root@allie:~# find / -iname '*resolv*'
/etc/ppp/resolv.conf
/etc/resolv.conf
/overlay/upper/etc/uci-defaults/50-dnsmasq-migrate-resolv-conf-auto.sh
/rom/etc/ppp/resolv.conf
/rom/etc/resolv.conf
/rom/etc/uci-defaults/50-dnsmasq-migrate-resolv-conf-auto.sh
/tmp/resolv.conf
/tmp/resolv.conf.d
/tmp/resolv.conf.d/resolv.conf.auto
resolv.conf.auto
is the resolv used to set or forward DNS queries for WAN interface. In my case DHCP will set DNS servers of my ISP which I might or might not want. It's better to have own DNS server in OpenWRT just to not provide info to third parties or to bypass DNS blacklist from a government/ISP.
root@allie:~# cat /tmp/resolv.conf.d/resolv.conf.auto
# Interface wan
nameserver 192.168.1.10
nameserver 1.2.3.4
nameserver 5.6.7.8
Show Mounts
root@allie:~# cat /etc/mtab
/dev/root /rom squashfs ro,relatime,errors=continue 0 0
proc /proc proc rw,nosuid,nodev,noexec,noatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,noatime 0 0
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0
/dev/loop0 /overlay f2fs rw,lazytime,noatime,background_gc=on,nodiscard,no_heap,user_xattr,inline_xattr,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,checkpoint_merge,fsync_mode=posix,discard_unit=block 0 0
overlayfs:/overlay / overlay rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work 0 0
tmpfs /dev tmpfs rw,nosuid,noexec,noatime,size=512k,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,noatime,mode=600,ptmxmode=000 0 0
debugfs /sys/kernel/debug debugfs rw,noatime 0 0
bpffs /sys/fs/bpf bpf rw,nosuid,nodev,noexec,noatime,mode=700 0 0
/dev/sda2 /mnt/vsetko f2fs rw,lazytime,relatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=default,checkpoint_merge,fsync_mode=posix,discard_unit=block 0 0
Show Network Connections
UDP in this case.
root@allie:~# netstat -ulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 0 0 0.0.0.0:67 0.0.0.0:* 4200/dnsmasq
udp 0 0 0.0.0.0:54967 0.0.0.0:* 2830/transmission-d
udp 0 0 0.0.0.0:38090 0.0.0.0:* 2830/transmission-d
udp 0 0 :::546 :::* 3049/odhcp6c
udp 0 0 :::54967 :::* 2830/transmission-d
data.mdb
data.mdb
can fill all available free space and then stuff will stop working properly.
-rw-r----- 1 root root 100.0M Oct 6 21:37 data.mdb
I think it is removed like this:
rm /overlay/upper/data.mdb
ash: /usr/libexec/sftp-server: not found
Dropbear as SSH server won't handle SFTP. In addition to Dropbear, OpenSSH SFTP server needs to be installed.
opkg install openssh-sftp-server
And that's all for now.
Add Comment