Get some base Linux info in QNAP TS-210 using console
QNAPs runs on (sometimes heavily modified) Debian distributions. But, what about kernel version etc.?
There several ways of getting this information from console. Out of them following works on TS-210:
uname -a
cat /etc/issue
cat /proc/version
If you ever need more information on this then… LMGIFY.
In this article I’ll show you the very basic commands that can be used on QNAP TS-210 (modified Debian Linux) to obtain system release, version, hardware info etc.
Contents
uname
You can get following information out of this (description + example output on TS-210):
uname -r
— the operating system release (turns out to be release version —1 Sat Mar 27 16:27:06 CST 2021
)uname -v
— the operating system version (turns out to be release date —3.4.6
)uname -n
— the machine’s network hostname (QNAP
)uname -m
— the machine hardware type (armv5tel
)uname -s
— the operating system name (Linux
)uname -p
— the host processor type (unknown
)
And for uname -a
you are getting everything above, so:
Linux QNAP 3.4.6 #1 Sat Mar 27 16:27:06 CST 2021 armv5tel unknown
cat /etc/?
The /etc/
folder contains configuration files for many system services, but also a dump files containing some interesting system or hardware information.
Things that are included in TS-210 that you may find interesting includes:
cat /etc/filesystems
— available filesystems (examples:ext3
,ext2
,iso9660
,vfat
,msdos
,hfs
)cat /etc/fstab
— static file system informationcat /etc/group
— groups and users (examples:administrators:x:0:admin
,everyone:x:100:admin
)cat /etc/hostname
— the machine’s network hostname (=uname -n
)cat /etc/hosts
— classic hosts file (same you’ll find in many systems, i.e. in Windows), base for hacking, includes:127.0.0.1 localhost
— local loopback IP addressxxx.xxx.xxx.xxx QNAP
— base IP address set on or assigned to your QNAP
cat /etc/hostname
— the machine’s network hostname (=uname -n
)cat /etc/inittab
— startup, shutdown etc. list, includes:- items with
sysinit
action — performed during startup sequence - items with
shutdown
action — stuff to do before rebooting - some more
- items with
cat /etc/issue
— some extra system info (i.e.Welcome to TS-210(192.168.1.2), QNAP Systems, Inc.
)cat /etc/mtab
— mounted devices, processes, filesystems etc. (i.e. main disks, USB disks, system partition etc.)cat /etc/passwd
— extended version ofcat /etc/group
— groups, users, ids, home dirs, shells and some morecat /etc/protocols
— network protocols available within your boxcat /etc/raidtab
— current RAID configurationcat /etc/services
— bunch of info on network services, including: name, listening port, protocol etc.; examples:ftp 21/tcp
http 80/tcp
https 443/tcp
mysql 3306/tcp
postgres 5432/tcp
cat /etc/tzlist
— timezones (only those available on your device?)
These are just system information providers (and not all of them, of course). But, in general, the /etc
folder is used to store configuration files for many system services and daemons, etc.
Including (just a few):
smb.conf
— Samba file sharing serviceupnpd.conf
— uPNP protocol’s daemonrsyncd.conf
— rSync daemon’s configurationmy.cnf
— MySQL database’s configuration- and more
These are all core Linux (Debian) configuration files. For QNAP-specific configuration you should rather look into /etc/config
folder, which a symbolic link to /mnt/HDA_ROOT/.config/
folder.
cat /proc/?
In general, the proc/
folder stores information (in form of folders and sub folders) about each process currently running.
So, if you know such process PID (you can get it by executing top
, which give you an output quite similar to Task Manager in Windows), you can execute:
ls -ls /proc/PID/
to see list of sub-folders for particular process, service, application or program running- and then execute
cat /proc/PID/subfolder
to get detailed information about that process.
But, we are not here for that.
Some cool information that you can get also here (just a few):
cat /proc/cpuinfo
— detailed information about installed processor(s)cat /proc/filesystems
— list of all supported filesystems withnodev
note, if no device is using givencat /proc/meminfo
— detailed information about memory usagecat /proc/version
— a bit more detailed system information (pity that a one-line garbage)cat /proc/uptime
— info about moment since last restart
I’ve listed just the few. Some more are waiting to be discovered by you.
The last value is given as Unix timestamp and relative to Unix Epoch (January 1, 1970 00:00:00). So, to get the actual value of how long your box is running since last restart you must:
- Get the value returned by
cat /proc/uptime
i.e.5877840.93
- Convert it from Unix timestamp to standard date time, i.e.
5877840.93
→Tue Mar 10 1970 00:44:00
- Substrat it (or generally compare it) to Thu Jan 01 1970 00:00:00
Only then you’ll be able to get the information that your box is running for i.e. 2 months, 9 days and 44 minutes or 68 days, 0 hours, 44 minutes and 0 seconds.