In this article, i will give an overview about paseudo filesystem.

A regular files system is a method of lying out file and folders on a hard disk. A pseudo file system does not exist on a physical hard disk, it actually created by linux kernel when the computer boots up and this file system exist on RAM. Once you shut down the computer this will be removed. System will recreate the files and folders in respective directory during the startup as per the present system conditions.

  • pseudo - means fake or not real
  • Only exist in RAM

There are multiple pseudo files system that are used with in Linux.

Two primary pseudo file locations in Linux are

/proc

/sys

/proc

Holds information about the processes running on a system. Processes are listed by PID, with hardware and process data both in the same directory structure.

/proc

All blue coloured item in the above list are directory which contain information about each process running in the system. The folder name denotes the PID. On the right side you can see the files which holds the informations related to CPU, Memory, Version, Uptime, partitions etc.

Let us check one of the file Eg: cpuinfo

[cloud_user@learncloud3c proc]$ cat cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 63
model name      : Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz
stepping        : 2
microcode       : 0x43
cpu MHz         : 2400.111
cache size      : 30720 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt
bogomips        : 4800.14
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

[cloud_user@learncloud3c proc]$

Lets check what is the content inside folder 1 which is the systemd or init process

[cloud_user@learncloud3c proc]$ cd /1

This folder contain information about the particular process.

The file called cmdline refers to the command line command of the actual process run in PID 1 which is systemd

[cloud_user@learncloud3c 1]$ cat cmdline 
/usr/lib/systemd/systemd--switched-root--system--deserialize22

/sys

This folder contains  information about system's hardware and kernel modules. No process related information is available here.

/sys

fs folder contains information about file systems. Particular folders in fs directory holds the information about files systems currently used.

[cloud_user@learncloud3c sys]$ ll fs/
total 0
dr-xr-xr-x.  2 root root   2 Aug 18 08:11 bpf
drwxr-xr-x. 13 root root 340 Aug 18 07:19 cgroup
drwxr-xr-x.  2 root root   0 Aug 18 07:19 pstore
drwxr-xr-x.  2 root root   0 Aug 18 08:11 resctrl
drwxr-xr-x.  7 root root   0 Aug 18 07:19 selinux
drwxr-xr-x.  4 root root   0 Aug 18 08:11 xfs

Lets look at xfs filesystem which is the default filesystem used by this server. You can find two folders inside this. stat - statistics about the current hard drive and xvda1  - the partitions which the system currently sits on.

[cloud_user@learncloud3c xfs]$ tree
.
├── stats
│   ├── stats
│   └── stats_clear
└── xvda1
    ├── error
    │   ├── fail_at_unmount
    │   └── metadata
    │       ├── default
    │       │   ├── max_retries
    │       │   └── retry_timeout_seconds
    │       ├── EIO
    │       │   ├── max_retries
    │       │   └── retry_timeout_seconds
    │       ├── ENODEV
    │       │   ├── max_retries
    │       │   └── retry_timeout_seconds
    │       └── ENOSPC
    │           ├── max_retries
    │           └── retry_timeout_seconds
    ├── log
    │   ├── log_head_lsn
    │   ├── log_tail_lsn
    │   ├── reserve_grant_head
    │   └── write_grant_head
    └── stats
        ├── stats
        └── stats_clear

10 directories, 17 files
[cloud_user@learncloud3c xfs]$

This is where you can find the detailed  hardware  informations. let's check the information about xvda1 filesystem.

[cloud_user@learncloud3c sys]$ cat fs/xfs/xvda1/stats/stats
extent_alloc 242 21412 193 20277
abt 0 0 0 0
blk_map 114620 6771 862 260 477 123219 0
bmbt 0 0 0 0
dir 61471 603 487 7545
trans 0 12926 0
ig 7377 543 0 6834 0 86 288
log 284 4911 3 381 124
push_ail 13153 0 74120 2362 0 942 0 3049 0 123
xstrat 195 0
rw 4947 274783
attr 13270 593 202 0
icluster 1752 843 3055
vnodes 6748 0 0 0 436 436 436 0
buf 62620 2356 60302 69 40 2318 0 3919 2299
abtb2 437 3532 140 136 0 0 9 0 0 0 0 0 0 0 55945
abtc2 685 5405 307 303 0 0 0 0 0 0 0 0 0 0 93955
bmbt2 40 270 3 0 0 0 0 0 0 0 0 0 0 0 0
ibt2 2114 17704 0 0 0 0 98 0 0 0 0 0 0 0 0
fibt2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
qm 0 0 0 0 0 0 0 0
xpc 87511040 40734360 599795803
debug 0
[cloud_user@learncloud3c stats]$ 

Conclusion

This is how you can find various informations about your computer.