In search this blog

Loading

czwartek, 2 lutego 2012

Linux Institute Professional 101


LPIC-1 Linux Institute Professional

Zacząłem już jakiś czas temu przygotowania do tegoż certyfikatu, więc w ramach przypomnień i zrobienia krótkich notatek zamierzam zamieszczać tutaj swoje przemyślenia i informacje.

System Architecture


Detectable Hardware

Linux bazuje na Hardware Abstraction Layer która to zawiera cztery podstawowe komponenty:

  • sysfs - virtual filesystem - tworzy go katalog /sys/ w raz z podkatalogami:
    • block/ - sterownik dla urządzeń blokowych
    • class/ - dla klas urządzeń
    • devices/ - dla hierarchii wykrytych urządzeń
    • firmware/ - dla sterowników
    • modules/ - dla załadowanych modułów w Kernel
  • udev - Kernel devices manager, sprawdza połączenia pomiędzy "zdarzeniami" a urządzeniami czyli np. jeśli mamy zamontowany pendrive i chcemy go od montować udev usuwa pliki, które powstały na skutek montowania tego urządzenia lub też tworzy takie pliki kiedy montujemy.
  • hald - utrzymuje bazę danych z aktualnym sprzętem (działa jako deamon)
  • dbus - jest to proces który jest użyteczny w wykrywaniu urządzeń używających IPC (Interprocess Comunication), umożliwia np. automatyczne zamontowanie pendriva lub innego urządzenia

Dla Ubuntu (debain)

  1. nonus25@localhost:~$ ls -lo /sys/  
  2. total 0  
  3. drwxr-xr-x   2 root 0 2012-02-01 20:14 block  
  4. drwxr-xr-x  20 root 0 2012-02-01 20:14 bus  
  5. drwxr-xr-x  41 root 0 2012-02-01 20:14 class  
  6. drwxr-xr-x   4 root 0 2012-02-01 20:14 dev  
  7. drwxr-xr-x  10 root 0 2012-02-01 20:02 devices  
  8. drwxr-xr-x   4 root 0 2012-02-01 20:14 firmware  
  9. drwxr-xr-x   6 root 0 2012-02-01 20:10 fs  
  10. drwxr-xr-x   6 root 0 2012-02-01 20:02 kernel  
  11. drwxr-xr-x 105 root 0 2012-02-01 20:14 module  
  12. drwxr-xr-x   2 root 0 2012-02-01 20:14 power  

Dla CentOS (wersja RedHat'a dla ubogich)

  1. [nonus25@localhost ~]$ ls -lo /sys/  
  2. total 0  
  3. drwxr-xr-x  31 root 0 Jan 29 21:07 block  
  4. drwxr-xr-x  15 root 0 Jan 29 21:08 bus  
  5. drwxr-xr-x  36 root 0 Jan 29 21:08 class  
  6. drwxr-xr-x  15 root 0 Jan 29 21:07 devices  
  7. drwxr-xr-x   3 root 0 Jan 29 21:07 firmware  
  8. drwxr-xr-x   2 root 0 Jan 29 21:07 fs  
  9. drwxr-xr-x   4 root 0 Jan 29 21:08 kernel  
  10. drwxr-xr-x 138 root 0 Jan 29 21:09 module  
  11. drwxr-xr-x   2 root 0 Jan 29 21:08 power  

Pokrewnym katalogowi sys/ jest katalog proc/ dla dynamicznych ustawień. Zapewnia on dynamiczny dostęp do informacji na twardym dysku i do kernel, poniżej wynik polecenia /proc/cpuinfo dla obu dystrybucji zainstalowanych na VirtualBox'ie

Dla Ubuntu (debain)

  1. nonus25@localhost:~$ cat /proc/cpuinfo   
  2. processor : 0  
  3. vendor_id : GenuineIntel  
  4. cpu family : 6  
  5. model  : 23  
  6. model name : Intel(R) Core(TM)2 Duo CPU     P8600  @ 2.40GHz  
  7. stepping : 6  
  8. cpu MHz  : 2395.160  
  9. cache size : 6144 KB  
  10. fdiv_bug : no  
  11. hlt_bug  : no  
  12. f00f_bug : no  
  13. coma_bug : no  
  14. fpu  : yes  
  15. fpu_exception : yes  
  16. cpuid level : 5  
  17. wp  : yes  
  18. flags  : fpu vme de pse tsc msr mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 constant_tsc up pni monitor ssse3  
  19. bogomips : 4790.32  
  20. clflush size : 64  
  21. cache_alignment : 64  
  22. address sizes : 36 bits physical, 48 bits virtual  
  23. power management:  

Dla CentOS (wersja RedHat'a dla ubogich)

  1. [nonus25@localhost ~]$ cat /proc/cpuinfo   
  2. processor       : 0  
  3. vendor_id       : GenuineIntel  
  4. cpu family      : 6  
  5. model           : 23  
  6. model name      : Intel(R) Core(TM)2 Duo CPU     P8600  @ 2.40GHz  
  7. stepping        : 6  
  8. cpu MHz         : 2395.466  
  9. cache size      : 3072 KB  
  10. physical id     : 0  
  11. siblings        : 1  
  12. core id         : 0  
  13. cpu cores       : 1  
  14. apicid          : 0  
  15. fdiv_bug        : no  
  16. hlt_bug         : no  
  17. f00f_bug        : no  
  18. coma_bug        : no  
  19. fpu             : yes  
  20. fpu_exception   : yes  
  21. cpuid level     : 5  
  22. wp              : yes  
  23. flags           : fpu vme de pse tsc msr mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 constant_tsc up pni monitor ssse3  
  24. bogomips        : 4790.93  

Przeglądając katalog proc/ możemy znaleźć wiele przydatnych informacji o stanie naszego systemu, przede wszystkim polecenia które należy przejrzeć i się z nimi zapoznać to: /proc/modules, /proc/mounts, /proc/meminfo

  • /proc/modules

    Ubuntu:

    1. nonus25@localhost:~$ cat /proc/modules   
    2. btrfs 459002 0 - Live 0xe24b1000  
    3. zlib_deflate 19568 1 btrfs, Live 0xe2415000  
    4. crc32c 2519 1 - Live 0xe2408000  
    5. libcrc32c 875 1 btrfs, Live 0xe23fe000  
    6. ufs 72774 0 - Live 0xe23e3000  
    7. qnx4 6484 0 - Live 0xe23c3000  
    8. hfsplus 70800 0 - Live 0xe23a4000  
    9. hfs 40754 0 - Live 0xe237a000  
    10. minix 25197 0 - Live 0xe235b000  
    11. ntfs 94791 0 - Live 0xe232f000  
    12. vfat 8933 0 - Live 0xe2305000  
    13. msdos 6392 0 - Live 0xe22fa000  
    14. fat 47767 2 vfat,msdos, Live 0xe22ec000  
    15. jfs 172682 0 - Live 0xe205b000  
    16. xfs 515548 0 - Live 0xe1fa1000  
    17. exportfs 3437 1 xfs, Live 0xe08ed000  
    18. reiserfs 225539 0 - Live 0xe1ec9000  
    19. nls_utf8 1069 1 - Live 0xe0977000  
    20. isofs 29250 1 - Live 0xe1a6d000  
    21. vboxvideo 1228 2 - Live 0xe0888000  
    22. drm 162377 3 vboxvideo, Live 0xe1a25000  
    23. agpgart 31724 1 drm, Live 0xe1a04000  
    24. binfmt_misc 6587 1 - Live 0xe0884000  
    25. vboxsf 33688 0 - Live 0xe08e2000  
    26. snd_intel8x0 25588 2 - Live 0xe1ac6000  
    27. snd_ac97_codec 100646 1 snd_intel8x0, Live 0xe1a95000  
    28. ac97_bus 1002 1 snd_ac97_codec, Live 0xe1a6a000  
    29. snd_pcm_oss 35308 0 - Live 0xe1a58000  
    30. snd_mixer_oss 13746 1 snd_pcm_oss, Live 0xe098e000  
    31. snd_pcm 70662 3 snd_intel8x0,snd_ac97_codec,snd_pcm_oss, Live 0xe09e8000  
    32. snd_seq_dummy 1338 0 - Live 0xe08fa000  
    33. snd_seq_oss 26726 0 - Live 0xe08b8000  
    34. snd_seq_midi 4557 0 - Live 0xe0880000  
    35. snd_rawmidi 19056 1 snd_seq_midi, Live 0xe1a0f000  
    36. snd_seq_midi_event 6003 2 snd_seq_oss,snd_seq_midi, Live 0xe09fc000  
    37. snd_seq 47263 6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event, Live 0xe0969000  
    38. snd_timer 19098 2 snd_pcm,snd_seq, Live 0xe0962000  
    39. snd_seq_device 5700 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq, Live 0xe0821000  
    40. ppdev 5259 0 - Live 0xe088e000  
    41. snd 54148 14 snd_intel8x0,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_oss,snd_rawmidi,snd_seq,snd_timer,snd_seq_device, Live 0xe0979000  
    42. fbcon 35102 71 - Live 0xe08ef000  
    43. tileblit 2031 1 fbcon, Live 0xe081b000  
    44. font 7557 1 fbcon, Live 0xe08a8000  
    45. bitblit 4707 1 fbcon, Live 0xe0853000  
    46. softcursor 1189 1 bitblit, Live 0xe081e000  
    47. soundcore 6620 1 snd, Live 0xe088a000  
    48. joydev 8708 0 - Live 0xe0812000  
    49. psmouse 63245 0 - Live 0xe09ba000  
    50. serio_raw 3978 0 - Live 0xe085e000  
    51. parport_pc 25962 0 - Live 0xe0841000  
    52. snd_page_alloc 7076 2 snd_intel8x0,snd_pcm, Live 0xe0824000  
    53. i2c_piix4 8335 0 - Live 0xe0816000  
    54. vboxguest 150464 8 vboxsf, Live 0xe0993000  
    55. vga16fb 11385 1 - Live 0xe0859000  
    56. vgastate 8961 1 vga16fb, Live 0xe084a000  
    57. lp 7028 0 - Live 0xe083d000  
    58. parport 32635 3 ppdev,parport_pc,lp, Live 0xe07ff000  
    59. usbhid 36110 0 - Live 0xe08ad000  
    60. ahci 32200 2 - Live 0xe0892000  
    61. e1000 97396 0 - Live 0xe0860000  
    62. hid 67032 1 usbhid, Live 0xe082a000  

    CentOS:

    1. [nonus25@localhost ~]$ cat /proc/mo  
    2. modules  mounts     
    3. [nonus25@localhost ~]$ cat /proc/modules   
    4. nls_utf8 6209 1 - Live 0xe1db7000  
    5. ipt_MASQUERADE 7617 3 - Live 0xe1d24000  
    6. iptable_nat 10949 1 - Live 0xe1d5b000  
    7. ip_nat 20973 2 ipt_MASQUERADE,iptable_nat, Live 0xe1d9b000  
    8. bridge 68701 0 - Live 0xe1dcd000  
    9. vboxsf 38088 0 - Live 0xe1e36000 (U)  
    10. autofs4 29253 3 - Live 0xe1dae000  
    11. hidp 22977 2 - Live 0xe1d94000  
    12. rfcomm 42457 0 - Live 0xe1da2000  
    13. l2cap 29761 10 hidp,rfcomm, Live 0xe1d40000  
    14. bluetooth 53797 5 hidp,rfcomm,l2cap, Live 0xe1d85000  
    15. lockd 63209 0 - Live 0xe1d4a000  
    16. sunrpc 149373 2 lockd, Live 0xe1d5f000  
    17. ip_conntrack_ftp 11569 0 - Live 0xe1d1a000  
    18. ip_conntrack_netbios_ns 6977 0 - Live 0xe1cf1000  
    19. ipt_REJECT 9537 3 - Live 0xe1d16000  
    20. xt_state 6209 13 - Live 0xe1cfa000  
    21. ip_conntrack 53281 6 ipt_MASQUERADE,iptable_nat,ip_nat,ip_conntrack_ftp,ip_conntrack_netbios_ns,xt_state, Live 0xe1d27000  
    22. nfnetlink 10713 2 ip_nat,ip_conntrack, Live 0xe1d12000  
    23. iptable_filter 7105 1 - Live 0xe1cee000  
    24. ip_tables 17029 2 iptable_nat,iptable_filter, Live 0xe1cf4000  
    25. ip6t_REJECT 9281 1 - Live 0xe1cea000  
    26. xt_tcpudp 7105 34 - Live 0xe1c67000  
    27. ip6table_filter 6849 1 - Live 0xe0ad3000  
    28. ip6_tables 18181 1 ip6table_filter, Live 0xe1c61000  
    29. x_tables 17349 8 ipt_MASQUERADE,iptable_nat,ipt_REJECT,xt_state,ip_tables,ip6t_REJECT,xt_tcpudp,ip6_tables, Live 0xe1c5b000  
    30. be2iscsi 59093 0 - Live 0xe1cfd000  
    31. ib_iser 35609 0 - Live 0xe1ce0000  
    32. rdma_cm 35705 1 ib_iser, Live 0xe1cd6000  
    33. ib_cm 39213 1 rdma_cm, Live 0xe1ccb000  
    34. iw_cm 13125 1 rdma_cm, Live 0xe1c56000  
    35. ib_sa 39093 2 rdma_cm,ib_cm, Live 0xe1cc0000  
    36. ib_mad 37717 2 ib_cm,ib_sa, Live 0xe1c31000  
    37. ib_core 63557 6 ib_iser,rdma_cm,ib_cm,iw_cm,ib_sa,ib_mad, Live 0xe1c6a000  
    38. ib_addr 11717 1 rdma_cm, Live 0xe1c2d000  
    39. iscsi_tcp 20041 0 - Live 0xe0b49000  
    40. bnx2i 43229 0 - Live 0xe1c4a000  
    41. cnic 50261 1 bnx2i, Live 0xe1c3c000  
    42. ipv6 271393 18 ip6t_REJECT,cnic, Live 0xe1c7c000  
    43. xfrm_nalgo 13381 1 ipv6, Live 0xe0b73000  
    44. crypto_api 12609 1 xfrm_nalgo, Live 0xe0b54000  
    45. uio 14793 1 cnic, Live 0xe0b4f000  
    46. cxgb3i 31177 0 - Live 0xe0b6a000  
    47. libcxgbi 54477 1 cxgb3i, Live 0xe0b5b000  
    48. cxgb3 167193 1 cxgb3i, Live 0xe1c03000  
    49. 8021q 25929 1 cxgb3, Live 0xe0af8000  
    50. libiscsi_tcp 22213 3 iscsi_tcp,cxgb3i,libcxgbi, Live 0xe0b00000  
    51. libiscsi2 42693 7 be2iscsi,ib_iser,iscsi_tcp,bnx2i,cxgb3i,libcxgbi,libiscsi_tcp, Live 0xe0ae0000  
    52. scsi_transport_iscsi2 37709 8 be2iscsi,ib_iser,iscsi_tcp,bnx2i,libcxgbi,libiscsi2, Live 0xe0aed000  
    53. scsi_transport_iscsi 6085 1 scsi_transport_iscsi2, Live 0xe0ad6000  
    54. loop 18633 0 - Live 0xe0ada000  
    55. dm_multipath 26957 0 - Live 0xe0abf000  
    56. scsi_dh 12481 1 dm_multipath, Live 0xe0ace000  
    57. video 21193 0 - Live 0xe0ac7000  
    58. backlight 10049 1 video, Live 0xe0a80000  
    59. sbs 18533 0 - Live 0xe0ab3000  
    60. power_meter 16461 0 - Live 0xe0ab9000  
    61. hwmon 7365 1 power_meter, Live 0xe0a73000  
    62. i2c_ec 9025 1 sbs, Live 0xe0aaf000  
    63. dell_wmi 8401 0 - Live 0xe0a84000  
    64. wmi 12137 1 dell_wmi, Live 0xe0aab000  
    65. button 10705 0 - Live 0xe0a3c000  
    66. battery 13637 0 - Live 0xe0aa6000  
    67. asus_acpi 19289 0 - Live 0xe0aa0000  
    68. ac 9157 0 - Live 0xe0a6f000  
    69. lp 15849 0 - Live 0xe0993000  
    70. joydev 13185 0 - Live 0xe0a6a000  
    71. sg 36717 0 - Live 0xe0a76000  
    72. pata_acpi 9665 0 - Live 0xe0a38000  
    73. ata_generic 10565 0 - Live 0xe0a13000  
    74. snd_intel8x0 35421 1 - Live 0xe09fb000  
    75. snd_ac97_codec 93025 1 snd_intel8x0, Live 0xe0a88000  
    76. ac97_bus 6337 1 snd_ac97_codec, Live 0xe09f8000  
    77. snd_seq_dummy 7877 0 - Live 0xe09f5000  
    78. snd_seq_oss 32577 0 - Live 0xe0a61000  
    79. snd_seq_midi_event 11073 1 snd_seq_oss, Live 0xe099f000  
    80. snd_seq 49585 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event, Live 0xe0a05000  
    81. e1000 120285 0 - Live 0xe0a19000  
    82. pcspkr 7105 0 - Live 0xe099c000  
    83. vboxguest 151976 6 vboxsf, Live 0xe09ce000 (U)  
    84. ide_cd 40161 1 - Live 0xe09c3000  
    85. snd_seq_device 11725 3 snd_seq_dummy,snd_seq_oss,snd_seq, Live 0xe0998000  
    86. snd_pcm_oss 42817 0 - Live 0xe094d000  
    87. snd_mixer_oss 19009 1 snd_pcm_oss, Live 0xe098d000  
    88. snd_pcm 72133 3 snd_intel8x0,snd_ac97_codec,snd_pcm_oss, Live 0xe09a3000  
    89. i2c_piix4 13133 0 - Live 0xe0917000  
    90. snd_timer 24517 2 snd_seq,snd_pcm, Live 0xe0975000  
    91. parport_pc 29157 0 - Live 0xe096c000  
    92. snd 55877 11 snd_intel8x0,snd_ac97_codec,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer, Live 0xe097e000  
    93. i2c_core 24897 2 i2c_ec,i2c_piix4, Live 0xe0964000  
    94. parport 37513 2 lp,parport_pc, Live 0xe0959000  
    95. soundcore 11553 1 snd, Live 0xe0949000  
    96. serio_raw 10693 0 - Live 0xe091c000  
    97. snd_page_alloc 14281 2 snd_intel8x0,snd_pcm, Live 0xe08c3000  
    98. tpm_tis 16713 0 - Live 0xe0943000  
    99. tpm 19041 1 tpm_tis, Live 0xe093d000  
    100. tpm_bios 11073 1 tpm, Live 0xe0913000  
    101. cdrom 36577 1 ide_cd, Live 0xe0933000  
    102. dm_raid45 67273 0 - Live 0xe0921000  
    103. dm_message 6977 1 dm_raid45, Live 0xe08c0000  
    104. dm_region_hash 15681 1 dm_raid45, Live 0xe08cf000  
    105. dm_mem_cache 9537 1 dm_raid45, Live 0xe08a7000  
    106. dm_snapshot 23653 0 - Live 0xe08c8000  
    107. dm_zero 6209 0 - Live 0xe08a4000  
    108. dm_mirror 24393 0 - Live 0xe08b9000  
    109. dm_log 14785 3 dm_raid45,dm_region_hash,dm_mirror, Live 0xe08b4000  
    110. dm_mod 63737 11 dm_multipath,dm_raid45,dm_snapshot,dm_zero,dm_mirror,dm_log, Live 0xe08fc000  
    111. ata_piix 24005 0 - Live 0xe08ad000  
    112. ahci 38477 2 - Live 0xe0843000  
    113. libata 156805 4 pata_acpi,ata_generic,ata_piix,ahci, Live 0xe08d4000  
    114. sd_mod 25281 3 - Live 0xe083b000  
    115. scsi_mod 144021 11 be2iscsi,ib_iser,iscsi_tcp,bnx2i,libcxgbi,libiscsi2,scsi_transport_iscsi2,scsi_dh,sg,libata,sd_mod, Live 0xe085e000  
    116. ext3 125769 2 - Live 0xe0884000  
    117. jbd 57705 1 ext3, Live 0xe084e000  
    118. uhci_hcd 25421 0 - Live 0xe0833000  
    119. ohci_hcd 24937 0 - Live 0xe0816000  
    120. ehci_hcd 34125 0 - Live 0xe081e000  
  • /proc/mounts

    Ubuntu:

    1. nonus25@localhost:~$ cat /proc/mounts   
    2. rootfs / rootfs rw 0 0  
    3. none /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0  
    4. none /proc proc rw,nosuid,nodev,noexec,relatime 0 0  
    5. none /dev devtmpfs rw,relatime,size=250416k,nr_inodes=62604,mode=755 0 0  
    6. none /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0  
    7. /dev/disk/by-uuid/778034df-2dc9-42b5-8a74-fc50236809e7 / ext4 rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0  
    8. none /sys/fs/fuse/connections fusectl rw,relatime 0 0  
    9. none /sys/kernel/debug debugfs rw,relatime 0 0  
    10. none /sys/kernel/security securityfs rw,relatime 0 0  
    11. none /dev/shm tmpfs rw,nosuid,nodev,relatime 0 0  
    12. none /var/run tmpfs rw,nosuid,relatime,mode=755 0 0  
    13. none /var/lock tmpfs rw,nosuid,nodev,noexec,relatime 0 0  
    14. none /lib/init/rw tmpfs rw,nosuid,relatime,mode=755 0 0  
    15. binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0  
    16. gvfs-fuse-daemon /home/nonus25/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0  
    17. /dev/sr0 /media/VBOXADDITIONS_3.2.12_68302 iso9660 ro,nosuid,nodev,relatime,uid=1000,gid=1000,iocharset=utf8,mode=0400,dmode=0500 0 0  

    CentOS:

    1. [nonus25@localhost ~]$ cat /proc/mounts   
    2. rootfs / rootfs rw 0 0  
    3. /dev/root / ext3 rw,data=ordered 0 0  
    4. /dev /dev tmpfs rw 0 0  
    5. /proc /proc proc rw 0 0  
    6. /sys /sys sysfs rw 0 0  
    7. none /selinux selinuxfs rw 0 0  
    8. /proc/bus/usb /proc/bus/usb usbfs rw 0 0  
    9. devpts /dev/pts devpts rw 0 0  
    10. /dev/sda1 /boot ext3 rw,data=ordered 0 0  
    11. tmpfs /dev/shm tmpfs rw 0 0  
    12. none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0  
    13. sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0  
    14. /etc/auto.misc /misc autofs rw,fd=7,pgrp=2581,timeout=300,minproto=5,maxproto=5,indirect 0 0  
    15. -hosts /net autofs rw,fd=13,pgrp=2581,timeout=300,minproto=5,maxproto=5,indirect 0 0  
    16. /dev/hdc /media/VBOXADDITIONS_3.2.12_68302 iso9660 ro,nosuid,nodev 0 0  
  • /proc/meminfo

    Ubuntu:

    1. nonus25@localhost:~$ cat /proc/meminfo   
    2. MemTotal:         509276 kB  
    3. MemFree:           11880 kB  
    4. Buffers:           36464 kB  
    5. Cached:           254984 kB  
    6. SwapCached:         2696 kB  
    7. Active:           212760 kB  
    8. Inactive:         243048 kB  
    9. Active(anon):      58592 kB  
    10. Inactive(anon):   115004 kB  
    11. Active(file):     154168 kB  
    12. Inactive(file):   128044 kB  
    13. Unevictable:          16 kB  
    14. Mlocked:              16 kB  
    15. HighTotal:             0 kB  
    16. HighFree:              0 kB  
    17. LowTotal:         509276 kB  
    18. LowFree:           11880 kB  
    19. SwapTotal:        704504 kB  
    20. SwapFree:         686700 kB  
    21. Dirty:                 0 kB  
    22. Writeback:             0 kB  
    23. AnonPages:        162364 kB  
    24. Mapped:            37568 kB  
    25. Shmem:              9264 kB  
    26. Slab:              25264 kB  
    27. SReclaimable:      17328 kB  
    28. SUnreclaim:         7936 kB  
    29. KernelStack:        1848 kB  
    30. PageTables:         4568 kB  
    31. NFS_Unstable:          0 kB  
    32. Bounce:                0 kB  
    33. WritebackTmp:          0 kB  
    34. CommitLimit:      959140 kB  
    35. Committed_AS:     573500 kB  
    36. VmallocTotal:     507960 kB  
    37. VmallocUsed:       27088 kB  
    38. VmallocChunk:     469876 kB  
    39. HardwareCorrupted:     0 kB  
    40. HugePages_Total:       0  
    41. HugePages_Free:        0  
    42. HugePages_Rsvd:        0  
    43. HugePages_Surp:        0  
    44. Hugepagesize:       4096 kB  
    45. DirectMap4k:       12224 kB  
    46. DirectMap4M:      512000 kB  

    CentOS:

    1. [nonus25@localhost ~]$ cat /proc/meminfo   
    2. MemTotal:       514900 kB  
    3. MemFree:         18484 kB  
    4. Buffers:         29392 kB  
    5. Cached:         314436 kB  
    6. SwapCached:          0 kB  
    7. Active:         195716 kB  
    8. Inactive:       264712 kB  
    9. HighTotal:           0 kB  
    10. HighFree:            0 kB  
    11. LowTotal:       514900 kB  
    12. LowFree:         18484 kB  
    13. SwapTotal:     1048568 kB  
    14. SwapFree:      1048568 kB  
    15. Dirty:              16 kB  
    16. Writeback:           0 kB  
    17. AnonPages:      116600 kB  
    18. Mapped:          43372 kB  
    19. Slab:            24884 kB  
    20. PageTables:       4300 kB  
    21. NFS_Unstable:        0 kB  
    22. Bounce:              0 kB  
    23. CommitLimit:   1306016 kB  
    24. Committed_AS:   573672 kB  
    25. VmallocTotal:   507896 kB  
    26. VmallocUsed:     22264 kB  
    27. VmallocChunk:   485108 kB  
    28. HugePages_Total:     0  
    29. HugePages_Free:      0  
    30. HugePages_Rsvd:      0  
    31. Hugepagesize:     4096 kB  

Po wy listowaniu katalogu /proc/ można zauważyć podkatalogi których nazwę tworzą numery, są to nic innego jak procesy naszego systemu, przykład:

Ubuntu:

  1. nonus25@localhost:~$ ls /proc/  
  2. 1      1088  12846  2     45    833        driver         pagetypeinfo  
  3. 10     1094  12847  20    4970  9          execdomains    partitions  
  4. 10057  11    1285   21    5     9535       fb             sched_debug  
  5. 10059  1123  1293   22    5023  9536       filesystems    schedstat  
  6. 10123  1137  1294   23    5025  9537       fs             scsi  
  7. 10124  1168  1299   237   519   9538       interrupts     self  
  8. 10168  1178  13     24    536   9541       iomem          slabinfo  
  9. 1026   1184  1302   2417  542   9542       ioports        softirqs  
  10. 1037   1188  1304   2554  547   9543       irq            stat  
  11. 1043   12    1305   27    564   956        kallsyms       swaps  
  12. 1045   1201  13097  28    568   960        kcore          sys  
  13. 1048   1207  1310   29    569   972        key-users      sysrq-trigger  
  14. 1049   1210  13110  3     6     981        kmsg           sysvipc  
  15. 1052   1219  1314   30    6176  acpi       kpagecount     timer_list  
  16. 1058   1228  1318   31    6180  asound     kpageflags     timer_stats  
  17. 1061   1231  14     32    650   buddyinfo  latency_stats  tty  
  18. 1063   1240  15     36    695   bus        loadavg        uptime  
  19. 1068   1241  154    37    699   cgroups    locks          version  
  20. 1073   1242  158    379   7     cmdline    mdstat         version_signature  
  21. 1075   1243  16     4     706   cpuinfo    meminfo        vmallocinfo  
  22. 1077   1262  17     40    707   crypto     misc           vmstat  
  23. 1080   1263  176    41    710   devices    modules        zoneinfo  
  24. 1081   1275  177    42    716   diskstats  mounts  
  25. 1085   1279  18     43    7827  dma        mtrr  
  26. 1086   1282  19     44    8     dri        net  

CentOS:

  1. [nonus25@localhost ~]$ ls /proc/  
  2. 1     1594  2500  2916  3218  3411  3568       dma          mounts  
  3. 10    1684  2510  2917  3223  3413  3599       driver       mtrr  
  4. 11    1962  2520  294   3224  3416  3601       execdomains  net  
  5. 117   2     2541  2980  3255  3429  3602       fb           partitions  
  6. 118   2076  2581  2985  3257  3444  3651       filesystems  schedstat  
  7. 119   2078  2665  299   3260  3470  382        fs           scsi  
  8. 120   2099  2684  3     3264  3474  4          ide          self  
  9. 121   2112  2689  3044  3266  3477  48         interrupts   slabinfo  
  10. 1291  2115  270   308   3278  3479  5          iomem        stat  
  11. 1292  2200  2706  3120  3308  3480  51         ioports      swaps  
  12. 1349  2234  2719  3161  3316  3487  53         irq          sys  
  13. 1504  2240  2735  3162  3322  3489  6          kallsyms     sysrq-trigger  
  14. 1536  2276  2757  3163  3342  349   7          kcore        sysvipc  
  15. 1553  2360  2766  3164  3365  3499  acpi       keys         tty  
  16. 1559  2376  2780  3165  3366  3501  asound     key-users    uptime  
  17. 1560  2389  2793  3175  3373  3503  buddyinfo  kmsg         version  
  18. 1561  2395  2824  319   3376  3526  bus        loadavg      vmcore  
  19. 1565  2416  2837  3190  3378  3528  cmdline    locks        vmstat  
  20. 1567  2461  2849  3214  3399  3537  cpuinfo    mdstat       zoneinfo  
  21. 1569  2475  2878  3215  3403  3539  crypto     meminfo  
  22. 1587  2492  290   3216  3405  3541  devices    misc  
  23. 1593  2493  291   3217  3409  3566  diskstats  modules  

Some Hardware Information

Komendy odpowiadające za wy listowanie informacji na temat lokalnego sprzętu

  • lsusb podaje podłączone urządzenia usb

    Ubuntu:

    1. nonus25@localhost:~$ lsusb   
    2. Bus 002 Device 002: ID 80ee:0021    
    3. Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub  
    4. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  

    CentOS:

    1. [nonus25@localhost ~]$ /sbin/lsusb   
    2. Bus 001 Device 001: ID 0000:0000    
    3. Bus 002 Device 001: ID 0000:0000    
    4. Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet  
  • lspci podaje wewnętrzne urządzenia

    Ubuntu:

    1. nonus25@localhost:~$ lspci  
    2. 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)  
    3. 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]  
    4. 00:01.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)  
    5. 00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter  
    6. 00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)  
    7. 00:04.0 System peripheral: InnoTek Systemberatung GmbH VirtualBox Guest Service  
    8. 00:05.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01)  
    9. 00:06.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB  
    10. 00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)  
    11. 00:0b.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller  
    12. 00:0d.0 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 02)  

    CentOS:

    1. [nonus25@localhost ~]$ /sbin/lspci  
    2. 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)  
    3. 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]  
    4. 00:01.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)  
    5. 00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter  
    6. 00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)  
    7. 00:04.0 System peripheral: InnoTek Systemberatung GmbH VirtualBox Guest Service  
    8. 00:05.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01)  
    9. 00:06.0 USB Controller: Apple Computer Inc. KeyLargo/Intrepid USB  
    10. 00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)  
    11. 00:0b.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller  
    12. 00:0d.0 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 02)  
  • lsmod daje listę załadowanych sterowników

    Ubuntu:

    1. nonus25@localhost:~$ lsmod  
    2. Module                  Size  Used by  
    3. btrfs                 459002  0   
    4. zlib_deflate           19568  1 btrfs  
    5. crc32c                  2519  1   
    6. libcrc32c                875  1 btrfs  
    7. ufs                    72774  0   
    8. qnx4                    6484  0   
    9. hfsplus                70800  0   
    10. hfs                    40754  0   
    11. minix                  25197  0   
    12. ntfs                   94791  0   
    13. vfat                    8933  0   
    14. msdos                   6392  0   
    15. fat                    47767  2 vfat,msdos  
    16. jfs                   172682  0   
    17. xfs                   515548  0   
    18. exportfs                3437  1 xfs  
    19. reiserfs              225539  0   
    20. nls_utf8                1069  1   
    21. isofs                  29250  1   
    22. vboxvideo               1228  2   
    23. drm                   162377  3 vboxvideo  
    24. agpgart                31724  1 drm  
    25. binfmt_misc             6587  1   
    26. vboxsf                 33688  0   
    27. snd_intel8x0           25588  2   
    28. snd_ac97_codec        100646  1 snd_intel8x0  
    29. ac97_bus                1002  1 snd_ac97_codec  
    30. snd_pcm_oss            35308  0   
    31. snd_mixer_oss          13746  1 snd_pcm_oss  
    32. snd_pcm                70662  3 snd_intel8x0,snd_ac97_codec,snd_pcm_oss  
    33. snd_seq_dummy           1338  0   
    34. snd_seq_oss            26726  0   
    35. snd_seq_midi            4557  0   
    36. snd_rawmidi            19056  1 snd_seq_midi  
    37. snd_seq_midi_event      6003  2 snd_seq_oss,snd_seq_midi  
    38. snd_seq                47263  6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event  
    39. snd_timer              19098  2 snd_pcm,snd_seq  
    40. snd_seq_device          5700  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq  
    41. ppdev                   5259  0   
    42. snd                    54148  14 snd_intel8x0,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_oss,snd_rawmidi,snd_seq,snd_timer,snd_seq_device  
    43. fbcon                  35102  71   
    44. tileblit                2031  1 fbcon  
    45. font                    7557  1 fbcon  
    46. bitblit                 4707  1 fbcon  
    47. softcursor              1189  1 bitblit  
    48. soundcore               6620  1 snd  
    49. joydev                  8708  0   
    50. psmouse                63245  0   
    51. serio_raw               3978  0   
    52. parport_pc             25962  0   
    53. snd_page_alloc          7076  2 snd_intel8x0,snd_pcm  
    54. i2c_piix4               8335  0   
    55. vboxguest             150464  8 vboxsf  
    56. vga16fb                11385  1   
    57. vgastate                8961  1 vga16fb  
    58. lp                      7028  0   
    59. parport                32635  3 ppdev,parport_pc,lp  
    60. usbhid                 36110  0   
    61. ahci                   32200  2   
    62. e1000                  97396  0   
    63. hid                    67032  1 usbhid  

    CentOS:

    1. [nonus25@localhost ~]$ /sbin/lsmod   
    2. Module                  Size  Used by  
    3. nls_utf8                6209  1   
    4. ipt_MASQUERADE          7617  3   
    5. iptable_nat            10949  1   
    6. ip_nat                 20973  2 ipt_MASQUERADE,iptable_nat  
    7. bridge                 68701  0   
    8. vboxsf                 38088  0   
    9. autofs4                29253  3   
    10. hidp                   22977  2   
    11. rfcomm                 42457  0   
    12. l2cap                  29761  10 hidp,rfcomm  
    13. bluetooth              53797  5 hidp,rfcomm,l2cap  
    14. lockd                  63209  0   
    15. sunrpc                149373  2 lockd  
    16. ip_conntrack_ftp       11569  0   
    17. ip_conntrack_netbios_ns     6977  0   
    18. ipt_REJECT              9537  3   
    19. xt_state                6209  13   
    20. ip_conntrack           53281  6 ipt_MASQUERADE,iptable_nat,ip_nat,ip_conntrack_ftp,ip_conntrack_netbios_ns,xt_state  
    21. nfnetlink              10713  2 ip_nat,ip_conntrack  
    22. iptable_filter          7105  1   
    23. ip_tables              17029  2 iptable_nat,iptable_filter  
    24. ip6t_REJECT             9281  1   
    25. xt_tcpudp               7105  34   
    26. ip6table_filter         6849  1   
    27. ip6_tables             18181  1 ip6table_filter  
    28. x_tables               17349  8 ipt_MASQUERADE,iptable_nat,ipt_REJECT,xt_state,ip_tables,ip6t_REJECT,xt_tcpudp,ip6_tables  
    29. be2iscsi               59093  0   
    30. ib_iser                35609  0   
    31. rdma_cm                35705  1 ib_iser  
    32. ib_cm                  39213  1 rdma_cm  
    33. iw_cm                  13125  1 rdma_cm  
    34. ib_sa                  39093  2 rdma_cm,ib_cm  
    35. ib_mad                 37717  2 ib_cm,ib_sa  
    36. ib_core                63557  6 ib_iser,rdma_cm,ib_cm,iw_cm,ib_sa,ib_mad  
    37. ib_addr                11717  1 rdma_cm  
    38. iscsi_tcp              20041  0   
    39. bnx2i                  43229  0   
    40. cnic                   50261  1 bnx2i  
    41. ipv6                  271393  18 ip6t_REJECT,cnic  
    42. xfrm_nalgo             13381  1 ipv6  
    43. crypto_api             12609  1 xfrm_nalgo  
    44. uio                    14793  1 cnic  
    45. cxgb3i                 31177  0   
    46. libcxgbi               54477  1 cxgb3i  
    47. cxgb3                 167193  1 cxgb3i  
    48. 8021q                  25929  1 cxgb3  
    49. libiscsi_tcp           22213  3 iscsi_tcp,cxgb3i,libcxgbi  
    50. libiscsi2              42693  7 be2iscsi,ib_iser,iscsi_tcp,bnx2i,cxgb3i,libcxgbi,libiscsi_tcp  
    51. scsi_transport_iscsi2    37709  8 be2iscsi,ib_iser,iscsi_tcp,bnx2i,libcxgbi,libiscsi2  
    52. scsi_transport_iscsi     6085  1 scsi_transport_iscsi2  
    53. loop                   18633  0   
    54. dm_multipath           26957  0   
    55. scsi_dh                12481  1 dm_multipath  
    56. video                  21193  0   
    57. backlight              10049  1 video  
    58. sbs                    18533  0   
    59. power_meter            16461  0   
    60. hwmon                   7365  1 power_meter  
    61. i2c_ec                  9025  1 sbs  
    62. dell_wmi                8401  0   
    63. wmi                    12137  1 dell_wmi  
    64. button                 10705  0   
    65. battery                13637  0   
    66. asus_acpi              19289  0   
    67. ac                      9157  0   
    68. lp                     15849  0   
    69. joydev                 13185  0   
    70. sg                     36717  0   
    71. pata_acpi               9665  0   
    72. ata_generic            10565  0   
    73. snd_intel8x0           35421  1   
    74. snd_ac97_codec         93025  1 snd_intel8x0  
    75. ac97_bus                6337  1 snd_ac97_codec  
    76. snd_seq_dummy           7877  0   
    77. snd_seq_oss            32577  0   
    78. snd_seq_midi_event     11073  1 snd_seq_oss  
    79. snd_seq                49585  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event  
    80. e1000                 120285  0   
    81. pcspkr                  7105  0   
    82. vboxguest             151976  6 vboxsf  
    83. ide_cd                 40161  1   
    84. snd_seq_device         11725  3 snd_seq_dummy,snd_seq_oss,snd_seq  
    85. snd_pcm_oss            42817  0   
    86. snd_mixer_oss          19009  1 snd_pcm_oss  
    87. snd_pcm                72133  3 snd_intel8x0,snd_ac97_codec,snd_pcm_oss  
    88. i2c_piix4              13133  0   
    89. snd_timer              24517  2 snd_seq,snd_pcm  
    90. parport_pc             29157  0   
    91. snd                    55877  11 snd_intel8x0,snd_ac97_codec,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer  
    92. i2c_core               24897  2 i2c_ec,i2c_piix4  
    93. parport                37513  2 lp,parport_pc  
    94. soundcore              11553  1 snd  
    95. serio_raw              10693  0   
    96. snd_page_alloc         14281  2 snd_intel8x0,snd_pcm  
    97. tpm_tis                16713  0   
    98. tpm                    19041  1 tpm_tis  
    99. tpm_bios               11073  1 tpm  
    100. cdrom                  36577  1 ide_cd  
    101. dm_raid45              67273  0   
    102. dm_message              6977  1 dm_raid45  
    103. dm_region_hash         15681  1 dm_raid45  
    104. dm_mem_cache            9537  1 dm_raid45  
    105. dm_snapshot            23653  0   
    106. dm_zero                 6209  0   
    107. dm_mirror              24393  0   
    108. dm_log                 14785  3 dm_raid45,dm_region_hash,dm_mirror  
    109. dm_mod                 63737  11 dm_multipath,dm_raid45,dm_snapshot,dm_zero,dm_mirror,dm_log  
    110. ata_piix               24005  0   
    111. ahci                   38477  2   
    112. libata                156805  4 pata_acpi,ata_generic,ata_piix,ahci  
    113. sd_mod                 25281  3   
    114. scsi_mod              144021  11 be2iscsi,ib_iser,iscsi_tcp,bnx2i,libcxgbi,libiscsi2,scsi_transport_iscsi2,scsi_dh,sg,libata,sd_mod  
    115. ext3                  125769  2   
    116. jbd                    57705  1 ext3  
    117. uhci_hcd               25421  0   
    118. ohci_hcd               24937  0   
    119. ehci_hcd               34125  0   

Aby zainstalować nowy moduł należy użyć polecenia insmod , czasami próba załadowania w ten sposób nowego modułu może się nie powieść ze względu na to że moduł ten może mieć jakieś inne zależności w tym celu lepiej skorzystać z innej komendy która również dodaje zależności ładując dany moduł modprobe


Czas powiedzieć coś o oznaczeniach urządzeń przechowujących nasze dane.

  • PATA - Parallel Advanced Technology Attachment
    • IDE/ATA - sterowniki
      • /dev/hda : główny, master
      • /dev/hdb : główny, slave
      • /dev/hdc : podrzędny, master
      • /dev/hdd : podrzędny, slave
      • numery przy któryś z tych oznaczeń oznaczają partycje np. /dev/hda1
  • SATA lub SCSI - Serial Advanced Technology Attachment lub Small Computer System Interface
    • /dev/sda : główny, master
    • /dev/sdb : główny, slave
    • /dev/sdc : podrzędny, master
    • /dev/sdd : podrzędny, slave
    • numery przy któryś z tych oznaczeń oznaczają partycje np. /dev/sda1

Runlevels

W Linux'ie standardowe poziomy działania są numerowane 0, 1, 2, 3, 4, 5, 6. Każdy z tych stanów jest następną wariacją stanu 1. Dokumentacje tych stanów można znaleźć tu: /etc/inittab

Ubuntu nie posiada tego pliku, default'owy poziom można zmienić /etc/init/rc-sysinit.conf

CentOS:

  1. [nonus25@localhost ~]$ cat /etc/inittab   
  2. #  
  3. # inittab       This file describes how the INIT process should set up  
  4. #               the system in a certain run-level.  
  5. #  
  6. # Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>  
  7. #               Modified for RHS Linux by Marc Ewing and Donnie Barnes  
  8. #  
  9.   
  10. # Default runlevel. The runlevels used by RHS are:  
  11. #   0 - halt (Do NOT set initdefault to this)  
  12. #   1 - Single user mode  
  13. #   2 - Multiuser, without NFS (The same as 3, if you do not have networking)  
  14. #   3 - Full multiuser mode  
  15. #   4 - unused  
  16. #   5 - X11  
  17. #   6 - reboot (Do NOT set initdefault to this)  
  18.   
  19. id:5:initdefault:  
  20.   
  21. # System initialization.  
  22. si::sysinit:/etc/rc.d/rc.sysinit  
  23.   
  24. l0:0:wait:/etc/rc.d/rc 0  
  25. l1:1:wait:/etc/rc.d/rc 1  
  26. l2:2:wait:/etc/rc.d/rc 2  
  27. l3:3:wait:/etc/rc.d/rc 3  
  28. l4:4:wait:/etc/rc.d/rc 4  
  29. l5:5:wait:/etc/rc.d/rc 5  
  30. l6:6:wait:/etc/rc.d/rc 6  
  31.   
  32. # Trap CTRL-ALT-DELETE  
  33. ca::ctrlaltdel:/sbin/shutdown -t3 -r now  
  34.   
  35. # When our UPS tells us power has failed, assume we have a few minutes  
  36. # of power left.  Schedule a shutdown for 2 minutes from now.  
  37. # This does, of course, assume you have powerd installed and your  
  38. # UPS connected and working correctly.    
  39. pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"  
  40.   
  41. # If power was restored before the shutdown kicked in, cancel it.  
  42. pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"  
  43.   
  44.   
  45. # Run gettys in standard runlevels  
  46. 1:2345:respawn:/sbin/mingetty tty1  
  47. 2:2345:respawn:/sbin/mingetty tty2  
  48. 3:2345:respawn:/sbin/mingetty tty3  
  49. 4:2345:respawn:/sbin/mingetty tty4  
  50. 5:2345:respawn:/sbin/mingetty tty5  
  51. 6:2345:respawn:/sbin/mingetty tty6  
  52.   
  53. # Run xdm in runlevel 5  
  54. x:5:respawn:/etc/X11/prefdm -nodaemon  
  55. </miquels@drinkel.nl.mugnet.org>  

Aby sprawdzić jaki runlevel aktualnie posiadamy podajemy komendę runlevel

Ubuntu:

  1. nonus25@localhost:~$ runlevel   
  2. N 2  

CentOS:

  1. [nonus25@localhost ~]$ /sbin/runlevel   
  2. N 5  

Do zmiany runlevel używamy polecenia init 0 - (halt system) lub telinit 6(reboots system). Jeżeli wywołujemy skrypt init 0, to skrypt ten wykonuje wszystkie usługi znajdujące się w /etc/rc0.d/, zobaczmy co znajduje się w tych katalogach:

Ubuntu:

  1. nonus25@localhost:~$ ls -lo /etc/rc0.d/  
  2. total 4  
  3. lrwxrwxrwx 1 root  25 2012-01-31 20:18 K65vboxadd-service -> ../init.d/vboxadd-service  
  4. lrwxrwxrwx 1 root  17 2012-01-31 20:16 K70vboxadd -> ../init.d/vboxadd  
  5. lrwxrwxrwx 1 root  21 2012-01-31 20:18 K70vboxadd-x11 -> ../init.d/vboxadd-x11  
  6. lrwxrwxrwx 1 root  19 2012-01-31 19:30 K74bluetooth -> ../init.d/bluetooth  
  7. -rw-r--r-- 1 root 353 2012-01-20 09:09 README  
  8. lrwxrwxrwx 1 root  29 2012-01-31 19:30 S10unattended-upgrades -> ../init.d/unattended-upgrades  
  9. lrwxrwxrwx 1 root  22 2012-01-31 19:30 S15wpa-ifupdown -> ../init.d/wpa-ifupdown  
  10. lrwxrwxrwx 1 root  18 2012-01-31 19:30 S20sendsigs -> ../init.d/sendsigs  
  11. lrwxrwxrwx 1 root  17 2012-01-31 19:30 S30urandom -> ../init.d/urandom  
  12. lrwxrwxrwx 1 root  22 2012-01-31 19:30 S31umountnfs.sh -> ../init.d/umountnfs.sh  
  13. lrwxrwxrwx 1 root  20 2012-01-31 19:30 S35networking -> ../init.d/networking  
  14. lrwxrwxrwx 1 root  18 2012-01-31 19:30 S40umountfs -> ../init.d/umountfs  
  15. lrwxrwxrwx 1 root  20 2012-01-31 19:30 S60umountroot -> ../init.d/umountroot  
  16. lrwxrwxrwx 1 root  14 2012-01-31 19:30 S90halt -> ../init.d/halt  

CentOS:

  1. [nonus25@localhost ~]$ ls -lo /etc/rc0.d/  
  2. total 460  
  3. lrwxrwxrwx 1 root 20 Jan 25 20:14 K00xendomains -> ../init.d/xendomains  
  4. lrwxrwxrwx 1 root 17 Jan 25 19:32 K01dnsmasq -> ../init.d/dnsmasq  
  5. lrwxrwxrwx 1 root 24 Jan 25 19:38 K01libvirt-guests -> ../init.d/libvirt-guests  
  6. lrwxrwxrwx 1 root 14 Jan 25 19:35 K01luci -> ../init.d/luci  
  7. lrwxrwxrwx 1 root 21 Jan 25 19:38 K01modclusterd -> ../init.d/modclusterd  
  8. lrwxrwxrwx 1 root 19 Jan 25 19:38 K01rgmanager -> ../init.d/rgmanager  
  9. lrwxrwxrwx 1 root 15 Jan 25 19:38 K01ricci -> ../init.d/ricci  
  10. lrwxrwxrwx 1 root 24 Jan 25 19:36 K01setroubleshoot -> ../init.d/setroubleshoot  
  11. lrwxrwxrwx 1 root 16 Jan 25 19:33 K01smartd -> ../init.d/smartd  
  12. lrwxrwxrwx 1 root 21 Jan 25 19:33 K01tog-pegasus -> ../init.d/tog-pegasus  
  13. lrwxrwxrwx 1 root 14 Jan 25 19:38 K01xend -> ../init.d/xend  
  14. lrwxrwxrwx 1 root 22 Jan 25 19:32 K02avahi-daemon -> ../init.d/avahi-daemon  
  15. lrwxrwxrwx 1 root 24 Jan 25 19:32 K02avahi-dnsconfd -> ../init.d/avahi-dnsconfd  
  16. lrwxrwxrwx 1 root 24 Jan 25 19:38 K02NetworkManager -> ../init.d/NetworkManager  
  17. lrwxrwxrwx 1 root 17 Jan 25 19:32 K02oddjobd -> ../init.d/oddjobd  
  18. lrwxrwxrwx 1 root 18 Jan 25 19:38 K03libvirtd -> ../init.d/libvirtd  
  19. lrwxrwxrwx 1 root 22 Jan 25 19:37 K03yum-updatesd -> ../init.d/yum-updatesd  
  20. lrwxrwxrwx 1 root 17 Jan 25 19:30 K05anacron -> ../init.d/anacron  
  21. lrwxrwxrwx 1 root 13 Jan 25 19:33 K05atd -> ../init.d/atd  
  22. lrwxrwxrwx 1 root 16 Jan 25 19:30 K05conman -> ../init.d/conman  
  23. lrwxrwxrwx 1 root 14 Jan 25 19:34 K05innd -> ../init.d/innd  
  24. lrwxrwxrwx 1 root 19 Jan 25 19:32 K05saslauthd -> ../init.d/saslauthd  
  25. lrwxrwxrwx 1 root 17 Jan 25 19:33 K05wdaemon -> ../init.d/wdaemon  
  26. lrwxrwxrwx 1 root 14 Jan 25 19:32 K10cups -> ../init.d/cups  
  27. lrwxrwxrwx 1 root 19 Jan 25 19:30 K10dc_server -> ../init.d/dc_server  
  28. lrwxrwxrwx 1 root 15 Jan 25 19:36 K10hplip -> ../init.d/hplip  
  29. lrwxrwxrwx 1 root 21 Jan 25 19:33 K10piranha-gui -> ../init.d/piranha-gui  
  30. lrwxrwxrwx 1 root 16 Jan 25 19:30 K10psacct -> ../init.d/psacct  
  31. lrwxrwxrwx 1 root 15 Jan 25 19:33 K10pulse -> ../init.d/pulse  
  32. lrwxrwxrwx 1 root 14 Jan 25 19:31 K10tcsd -> ../init.d/tcsd  
  33. lrwxrwxrwx 1 root 13 Jan 25 19:36 K10xfs -> ../init.d/xfs  
  34. lrwxrwxrwx 1 root 19 Jan 25 19:30 K12dc_client -> ../init.d/dc_client  
  35. lrwxrwxrwx 1 root 13 Jan 25 19:29 K15gpm -> ../init.d/gpm  
  36. lrwxrwxrwx 1 root 15 Jan 25 19:32 K15httpd -> ../init.d/httpd  
  37. lrwxrwxrwx 1 root 18 Jan 30 01:56 K15svnserve -> ../init.d/svnserve  
  38. lrwxrwxrwx 1 root 13 Jan 25 19:36 K20nfs -> ../init.d/nfs  
  39. lrwxrwxrwx 1 root 17 Jan 25 19:30 K20openais -> ../init.d/openais  
  40. lrwxrwxrwx 1 root 15 Jan 25 19:29 K20rwhod -> ../init.d/rwhod  
  41. lrwxrwxrwx 1 root 14 Jan 25 19:38 K24irda -> ../init.d/irda  
  42. lrwxrwxrwx 1 root 15 Jan 25 19:34 K25squid -> ../init.d/squid  
  43. lrwxrwxrwx 1 root 14 Jan 25 19:33 K25sshd -> ../init.d/sshd  
  44. lrwxrwxrwx 1 root 18 Jan 25 19:32 K30sendmail -> ../init.d/sendmail  
  45. lrwxrwxrwx 1 root 22 Jan 25 19:33 K30spamassassin -> ../init.d/spamassassin  
  46. lrwxrwxrwx 1 root 17 Jan 25 20:10 K35dovecot -> ../init.d/dovecot  
  47. lrwxrwxrwx 1 root 13 Jan 25 19:32 K35smb -> ../init.d/smb  
  48. lrwxrwxrwx 1 root 19 Jan 25 19:38 K35vncserver -> ../init.d/vncserver  
  49. lrwxrwxrwx 1 root 17 Jan 25 19:32 K35winbind -> ../init.d/winbind  
  50. lrwxrwxrwx 1 root 20 Jan 25 19:32 K44rawdevices -> ../init.d/rawdevices  
  51. lrwxrwxrwx 1 root 16 Jan 25 19:29 K50ibmasm -> ../init.d/ibmasm  
  52. lrwxrwxrwx 1 root 20 Jan 25 19:32 K50netconsole -> ../init.d/netconsole  
  53. lrwxrwxrwx 1 root 15 Jan 25 19:32 K50snmpd -> ../init.d/snmpd  
  54. lrwxrwxrwx 1 root 19 Jan 25 19:32 K50snmptrapd -> ../init.d/snmptrapd  
  55. lrwxrwxrwx 1 root 13 Jan 25 19:30 K50tux -> ../init.d/tux  
  56. lrwxrwxrwx 1 root 16 Jan 25 19:33 K50vsftpd -> ../init.d/vsftpd  
  57. lrwxrwxrwx 1 root 16 Jan 25 19:35 K50xinetd -> ../init.d/xinetd  
  58. lrwxrwxrwx 1 root 15 Jan 25 19:32 K60crond -> ../init.d/crond  
  59. lrwxrwxrwx 1 root 25 Jan 30 00:23 K65vboxadd-service -> ../init.d/vboxadd-service  
  60. lrwxrwxrwx 1 root 20 Jan 25 19:36 K69rpcsvcgssd -> ../init.d/rpcsvcgssd  
  61. lrwxrwxrwx 1 root 17 Jan 30 00:22 K70vboxadd -> ../init.d/vboxadd  
  62. lrwxrwxrwx 1 root 21 Jan 30 00:23 K70vboxadd-x11 -> ../init.d/vboxadd-x11  
  63. lrwxrwxrwx 1 root 16 Jan 25 19:30 K72autofs -> ../init.d/autofs  
  64. lrwxrwxrwx 1 root 16 Jan 25 19:32 K73ypbind -> ../init.d/ypbind  
  65. lrwxrwxrwx 1 root 15 Jan 25 19:33 K74acpid -> ../init.d/acpid  
  66. lrwxrwxrwx 1 root 14 Jan 25 19:38 K74apmd -> ../init.d/apmd  
  67. lrwxrwxrwx 1 root 13 Jan 25 19:29 K74gfs -> ../init.d/gfs  
  68. lrwxrwxrwx 1 root 14 Jan 25 19:29 K74gfs2 -> ../init.d/gfs2  
  69. lrwxrwxrwx 1 root 19 Jan 25 19:38 K74haldaemon -> ../init.d/haldaemon  
  70. lrwxrwxrwx 1 root 20 Jan 25 19:29 K74lm_sensors -> ../init.d/lm_sensors  
  71. lrwxrwxrwx 1 root 22 Jan 30 01:56 K74lvm2-monitor -> ../init.d/lvm2-monitor  
  72. lrwxrwxrwx 1 root 14 Jan 25 20:10 K74nscd -> ../init.d/nscd  
  73. lrwxrwxrwx 1 root 14 Jan 25 19:30 K74ntpd -> ../init.d/ntpd  
  74. lrwxrwxrwx 1 root 15 Jan 25 19:32 K75netfs -> ../init.d/netfs  
  75. lrwxrwxrwx 1 root 22 Jan 25 19:36 K75scsi_reserve -> ../init.d/scsi_reserve  
  76. lrwxrwxrwx 1 root 15 Jan 25 19:38 K76clvmd -> ../init.d/clvmd  
  77. lrwxrwxrwx 1 root 16 Jan 25 20:12 K78qdiskd -> ../init.d/qdiskd  
  78. lrwxrwxrwx 1 root 14 Jan 25 20:12 K79cman -> ../init.d/cman  
  79. lrwxrwxrwx 1 root 15 Jan 25 19:30 K80kdump -> ../init.d/kdump  
  80. lrwxrwxrwx 1 root 19 Jan 25 19:33 K85mdmonitor -> ../init.d/mdmonitor  
  81. lrwxrwxrwx 1 root 15 Jan 25 19:33 K85mdmpd -> ../init.d/mdmpd  
  82. lrwxrwxrwx 1 root 20 Jan 25 19:32 K85messagebus -> ../init.d/messagebus  
  83. lrwxrwxrwx 1 root 17 Jan 25 19:36 K85rpcgssd -> ../init.d/rpcgssd  
  84. lrwxrwxrwx 1 root 19 Jan 25 19:36 K85rpcidmapd -> ../init.d/rpcidmapd  
  85. lrwxrwxrwx 1 root 17 Jan 25 19:36 K86nfslock -> ../init.d/nfslock  
  86. lrwxrwxrwx 1 root 20 Jan 25 19:33 K87irqbalance -> ../init.d/irqbalance  
  87. lrwxrwxrwx 1 root 18 Jan 25 19:32 K87mcstrans -> ../init.d/mcstrans  
  88. lrwxrwxrwx 1 root 20 Jan 25 19:30 K87multipathd -> ../init.d/multipathd  
  89. lrwxrwxrwx 1 root 15 Jan 25 19:32 K87named -> ../init.d/named  
  90. lrwxrwxrwx 1 root 17 Jan 25 19:32 K87portmap -> ../init.d/portmap  
  91. lrwxrwxrwx 1 root 21 Jan 25 19:32 K87restorecond -> ../init.d/restorecond  
  92. lrwxrwxrwx 1 root 16 Jan 25 19:30 K88auditd -> ../init.d/auditd  
  93. lrwxrwxrwx 1 root 15 Jan 25 19:32 K88pcscd -> ../init.d/pcscd  
  94. lrwxrwxrwx 1 root 16 Jan 25 19:32 K88syslog -> ../init.d/syslog  
  95. lrwxrwxrwx 1 root 24 Jan 25 19:32 K88wpa_supplicant -> ../init.d/wpa_supplicant  
  96. lrwxrwxrwx 1 root 14 Jan 25 19:33 K89dund -> ../init.d/dund  
  97. lrwxrwxrwx 1 root 14 Jan 25 19:33 K89hidd -> ../init.d/hidd  
  98. lrwxrwxrwx 1 root 17 Jan 25 19:29 K89ipvsadm -> ../init.d/ipvsadm  
  99. lrwxrwxrwx 1 root 15 Jan 25 19:32 K89iscsi -> ../init.d/iscsi  
  100. lrwxrwxrwx 1 root 16 Jan 25 19:32 K89iscsid -> ../init.d/iscsid  
  101. lrwxrwxrwx 1 root 18 Jan 25 19:30 K89netplugd -> ../init.d/netplugd  
  102. lrwxrwxrwx 1 root 14 Jan 25 19:33 K89pand -> ../init.d/pand  
  103. lrwxrwxrwx 1 root 15 Jan 25 19:29 K89rdisc -> ../init.d/rdisc  
  104. lrwxrwxrwx 1 root 19 Jan 25 19:33 K90bluetooth -> ../init.d/bluetooth  
  105. lrwxrwxrwx 1 root 17 Jan 25 19:32 K90network -> ../init.d/network  
  106. lrwxrwxrwx 1 root 14 Jan 25 19:38 K91capi -> ../init.d/capi  
  107. lrwxrwxrwx 1 root 14 Jan 25 19:38 K91isdn -> ../init.d/isdn  
  108. lrwxrwxrwx 1 root 19 Jan 25 19:29 K92ip6tables -> ../init.d/ip6tables  
  109. lrwxrwxrwx 1 root 18 Jan 25 19:29 K92iptables -> ../init.d/iptables  
  110. lrwxrwxrwx 1 root 19 Jan 25 19:38 K95firstboot -> ../init.d/firstboot  
  111. lrwxrwxrwx 1 root 15 Jan 25 19:38 K95kudzu -> ../init.d/kudzu  
  112. lrwxrwxrwx 1 root 18 Jan 25 19:29 K99cpuspeed -> ../init.d/cpuspeed  
  113. lrwxrwxrwx 1 root 23 Jan 25 19:33 K99microcode_ctl -> ../init.d/microcode_ctl  
  114. lrwxrwxrwx 1 root 25 Jan 25 19:34 K99readahead_early -> ../init.d/readahead_early  
  115. lrwxrwxrwx 1 root 25 Jan 25 19:34 K99readahead_later -> ../init.d/readahead_later  
  116. lrwxrwxrwx 1 root 17 Jan 25 19:32 S00killall -> ../init.d/killall  
  117. lrwxrwxrwx 1 root 14 Jan 25 19:32 S01halt -> ../init.d/halt  

Skrypty oznaczone literą K oznacza usługi które będą zabite kill, a skrypty oznaczone literą S odzwierciedlają dany stan, tak jak widzimy powyżej mamy dwa skrypty oznaczone literą S killall i halt. Tak więc widzimy że w tym stanie wszystkie procesy zostaną zabite i system zostanie zatrzymany. Runlevel 1 oznacza single user mode, powoduje również automatyczne zalogowanie do systemu jako root bez pytania o hasło. I oczywiscie uruchamia skrypt znajdujący się /etc/rc1.d/. Poziom 2 oznacza multiuser bez network'u, w Debain'ach jest używany jako domyślny zaś w RedHat'cie lub CentOS domyślnym poziomem jest poziom 5. Poziom 3, 4, 5 jest zazwyczaj nie używany w Debain'ach. Runlevel 3 w RedHat/CentOS daje nam stan multiuser z network'iem bez GUI. Poziom 4 również nie jest zasadniczo używany w RedHat'cie/CentOS'ie. Poziom 5 dla RedHat'a/CentOS'a jest poziomem domyślnym startuje jako multiuser z network'iem i z GUI. Poziom 6 jest trybem restartu. Równoważną komendą dla init 6 jest komenda shutdown -r now lub reboot, a dla komendy init 0 komenda shutdown -h now lub halt



stat4u stat4u

Brak komentarzy:

Prześlij komentarz

Powered By Blogger