Thứ Tư, 15 tháng 9, 2010

How to check infomation in Centos

*/check version
cat /etc/redhat-release for the CentOS version.

$ cat /etc/redhat-release
CentOS release 5 (Final)

*/check OS-bit
$ uname -a
Linux slave.DNS-HCM 2.6.9-42.ELsmp #1 SMP Tue Aug 15 10:35:26 BST 2006 x86_64 x86_64 x86_64 GNU/Linux
(64-bit)

# uname -a
Linux voice.localdomain 2.6.18-128.1.10.el5 #1 SMP Thu May 7 10:39:21 EDT 2009 i686 i686 i386 GNU/Linux
(32-bit)

"i686" means 32-bit. If it was 64-bit, it would be "x86_64"

*/service command - list running services

service --status-all
service --status-all | grep ntpd
service --status-all | less

*/Print the status of any service

To print the status of apache (httpd) service:
service httpd status

*/List all known services (configured via SysV)

chkconfig --list

*/List service and their open ports

netstat -tulpn

*/Turn on / off service

ntsysv
chkconfig service off
chkconfig service on
chkconfig httpd off
chkconfig ntpd on

*/check hardware information :

root@shell [~]# dmidecode | more

*/ check HDD
#df -h

*/ check Raid level

# cat /proc/mdstat
Personalities : [raid1]
md3 : active raid1 hdc1[1] hda1[0]
104320 blocks [2/2] [UU]

md1 : active raid1 hdc2[1] hda2[0]
61633280 blocks [2/2] [UU]

md2 : active raid1 hdc3[1] hda3[0]
8193024 blocks [2/2] [UU]

md4 : active raid1 hdc6[1] hda6[0]
1020032 blocks [2/2] [UU]

md0 : active raid1 hdc5[1] hda5[0]
5116544 blocks [2/2] [UU]

unused devices:

In this scenario, it shows that md had raid 1 installed.
Another command that will show us the state of the raid drives is "mdadm"

# mdadm -D /dev/md0
/dev/md0:
Version : 00.90.01
Creation Time : Thu Jun 28 16:43:40 2007
Raid Level : raid1
Array Size : 5116544 (4.88 GiB 5.24 GB)
Device Size : 5116544 (4.88 GiB 5.24 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Wed Sep 15 18:43:06 2010
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0


Number Major Minor RaidDevice State
0 3 5 0 active sync /dev/hda5
1 22 5 1 active sync /dev/hdc5
UUID : 506b9927:274e5bca:a1aa0988:48c7ded4
Events : 0.7769115

Không có nhận xét nào:

Đăng nhận xét