티스토리 툴바


'Linux'에 해당되는 글 7건

  1. 2011/11/02 [Linux] 하드웨어 정보 확인하기 - dmidecode, lshw
  2. 2010/07/21 우분투 Apache/php/mysql 에서 그누보드 설치하기
  3. 2010/07/20 우분투 Open Terminal
  4. 2010/07/15 우분투(Ubuntu) apt-get 으로 패키지 설치시 "/var/lib/dpkg/lock 잠금 파일을 얻을 수 없습니다" 오류 해결방법 (1)
  5. 2010/07/15 우분투(Ubuntu)에서 Java VM(JDK)를 설치하기
  6. 2010/07/13 우분투 root 계정 활성화
  7. 2010/03/19 Grep -E 옵션과 Grep -v 옵션

[Linux] 하드웨어 정보 확인하기 - dmidecode, lshw

1. lshw 를 사용하여 하드웨어 상세 정보 확인(링크 참조)
- lshw 는 rpm 패키지를 별도로 설치해야됨

참고글 : http://jonnychoe.egloos.com/5549359

2. dmidecode
- 설치할 필요없음
- dmidecode 명령은 서버 하드웨어, 바이오스 정보를 system DMI 테이블에서 읽어온다.
시스템의 현재 configuration 상태뿐만 아니라 최대 지원가능한 설정 정보까지도 불러온다.
예를 들어, 시스템의 현재 RAM 정보와 최대 확장가능한 RAM 정보까지도 확인할 수 있다.

dmidecode 의 output 형태는 다음과 같다.
Record Header: Handle {record id}, DMI type {dmi type id}, {record size} bytes
Record Value: {multi line record value}
  • record id: Unique identifier for every record in the DMI table.
  • dmi type id: Type of the record. i.e BIOS, Memory etc.,
  • record size: Size of the record in the DMI table.
  • multi line record values: Multi line record value for that specific DMI type.

dmidecode 명령의 output 예 :

# dmidecode | head -15

# dmidecode 2.9
SMBIOS 2.3 present.
56 structures occupying 1977 bytes.
Table at 0x000FB320.

Handle 0xDA00, DMI type 218, 11 bytes
OEM-specific Type
        Header and Data:
                DA 0B 00 DA B0 00 17 03 08 28 00

Handle 0x0000, DMI type 0, 20 bytes
BIOS Information
        Vendor: Dell Computer Corporation
        Version: A07
        Release Date: 01/13/2004

DMI 테이블의 레코드 갯수를 보기위해서는

# dmidecode | grep ^Handle | wc -l
56

(or)

# dmidecode | grep structures
56 structures occupying 1977 bytes.

DMI Types

시스템의 CPU 정보를 보기위해서는 type id 4 옵션을 dmidecode 명령과 함께 준다.

# dmidecode -t 4
# dmidecode 2.9
SMBIOS 2.3 present.

Handle 0x0400, DMI type 4, 35 bytes
Processor Information
        Socket Designation: Processor 1
        Type: Central Processor
        Family: Xeon
        Manufacturer: Intel
        ID: 29 0F 00 00 FF FB EB BF
        Signature: Type 0, Family 15, Model 2, Stepping 9
        Flags:
                FPU (Floating-point unit on-chip)
                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                TSC (Time stamp counter)
                MSR (Model specific registers)

DMI type 은 아래와 같다.

Type   Information
       ----------------------------------------
          0   BIOS
          1   System
          2   Base Board
          3   Chassis
          4   Processor
          5   Memory Controller
          6   Memory Module
          7   Cache
          8   Port Connector
          9   System Slots
         10   On Board Devices
         11   OEM Strings
         12   System Configuration Options
         13   BIOS Language
         14   Group Associations
         15   System Event Log
         16   Physical Memory Array
         17   Memory Device
         18   32-bit Memory Error
         19   Memory Array Mapped Address
         20   Memory Device Mapped Address
         21   Built-in Pointing Device
         22   Portable Battery
         23   System Reset
         24   Hardware Security
         25   System Power Controls
         26   Voltage Probe
         27   Cooling Device
         28   Temperature Probe
         29   Electrical Current Probe
         30   Out-of-band Remote Access
         31   Boot Integrity Services
         32   System Boot
         33   64-bit Memory Error
         34   Management Device
         35   Management Device Component
         36   Management Device Threshold Data
         37   Memory Channel
         38   IPMI Device
         39   Power Supply

또한, type id 를 입력하는 대신에 키워드를 사용할 수도 있다.

다음은 사용가능한 키워드이다.

       Keyword     Types
       ------------------------------
       bios        0, 13
       system      1, 12, 15, 23, 32
       baseboard   2, 10
       chassis     3
       processor   4
       memory      5, 6, 16, 17
       cache       7
       connector   8
       slot        9

type id 2 와 10 에 대한 정보를 보기 위해 키워드 baseboard 를 사용한 예

# dmidecode -t baseboard
# dmidecode 2.9
SMBIOS 2.3 present.

Handle 0x0200, DMI type 2, 9 bytes
Base Board Information
        Manufacturer: Dell Computer Corporation
        Product Name: 123456
        Version: A05
        Serial Number: ..CN123456789098.

Handle 0x0A00, DMI type 10, 14 bytes
On Board Device 1 Information
        Type: SCSI Controller
        Status: Enabled
        Description: LSI Logic 53C1030 Ultra 320 SCSI
On Board Device 2 Information
        Type: SCSI Controller
        Status: Enabled
        Description: LSI Logic 53C1030 Ultra 320 SCSI
On Board Device 3 Information
        Type: Video
        Status: Enabled
        Description: ATI Rage XL PCI Video
On Board Device 4 Information
        Type: Ethernet
        Status: Enabled
        Description: Broadcom Gigabit Ethernet 1
On Board Device 5 Information
        Type: Ethernet
        Status: Enabled
        Description: Broadcom Gigabit Ethernet 2


dmicode 를 사용하여 RAM(Physical Memory) 에 대한 정보 확인하기

시스템에서 지원가능한 최대 RAM 크기는 얼마인가?
아래 예는 최대 RAM 크기가 8GB 임을 보여준다.

# dmidecode -t 16
# dmidecode 2.9
SMBIOS 2.3 present.

Handle 0x1000, DMI type 16, 15 bytes
Physical Memory Array
        Location: System Board Or Motherboard
        Use: System Memory
        Error Correction Type: Multi-bit ECC
        Maximum Capacity: 8 GB
        Error Information Handle: Not Provided
        Number Of Devices: 4

메모리를 얼마나 확장할 수 있는지 를 확인하기 위해 /proc/meminfo 명령을 사용하여 현재 메모리 총량을 확인할 수 있다.

# grep MemTotal /proc/meminfo
MemTotal:      1034644 kB

위 예는 현재 시스템이 1 GB 메모리를 가지고 있음을 확인할 수 있지만, 이것이 1GB 1개인지, 512MB 2개인지, 256MB 4개인지는 알 수가 없다.

dmidecode 명령을 사용하여 memory 슬롯에서 각각 사용되고 있는 RAM  크기를 알 수 있다.

아래 예는 memory slot  이 4개이며, 현재 슬롯 1,2 에 512 MB RAM 이 각각 장착되어 있음을 확인할 수 있다.

# dmidecode -t 17
# dmidecode 2.9
SMBIOS 2.3 present.

Handle 0x1100, DMI type 17, 23 bytes
Memory Device
        Array Handle: 0x1000
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 512 MB  [Note: Slot1 has 512 MB RAM]
        Form Factor: DIMM
        Set: 1
        Locator: DIMM_1A
        Bank Locator: Not Specified
        Type: DDR
        Type Detail: Synchronous
        Speed: 266 MHz (3.8 ns)

Handle 0x1101, DMI type 17, 23 bytes
Memory Device
        Array Handle: 0x1000
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 512 MB [Note: Slot2 has 512 MB RAM]
        Form Factor: DIMM
        Set: 1
        Locator: DIMM_1B
        Bank Locator: Not Specified
        Type: DDR
        Type Detail: Synchronous
        Speed: 266 MHz (3.8 ns)

Handle 0x1102, DMI type 17, 23 bytes
Memory Device
        Array Handle: 0x1000
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: No Module Installed [Note: Slot3 is empty]
        Form Factor: DIMM
        Set: 2
        Locator: DIMM_2A
        Bank Locator: Not Specified
        Type: DDR
        Type Detail: Synchronous
        Speed: 266 MHz (3.8 ns)

Handle 0x1103, DMI type 17, 23 bytes
Memory Device
        Array Handle: 0x1000

        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: No Module Installed [Note: Slot4 is empty]
        Form Factor: DIMM
        Set: 2
        Locator: DIMM_2B
        Bank Locator: Not Specified
        Type: DDR
        Type Detail: Synchronous
        Speed: 266 MHz (3.8 ns)


BIOS information 확인하기

# dmidecode -t bios
# dmidecode 2.9
SMBIOS 2.3 present.

Handle 0x0000, DMI type 0, 20 bytes
BIOS Information
        Vendor: Dell Computer Corporation
        Version: A07
        Release Date: 01/13/2004
        Address: 0xF0000
        Runtime Size: 64 kB
        ROM Size: 4096 kB
        Characteristics:
                ISA is supported
                PCI is supported
                PNP is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                ESCD support is available
                Boot from CD is supported
                Selectable boot is supported
                EDD is supported
                Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
                5.25"/360 KB floppy services are supported (int 13h)
                5.25"/1.2 MB floppy services are supported (int 13h)
                3.5"/720 KB floppy services are supported (int 13h)
                8042 keyboard services are supported (int 9h)
                Serial services are supported (int 14h)
                CGA/mono video services are supported (int 10h)
                ACPI is supported
                USB legacy is supported
                LS-120 boot is supported
                BIOS boot specification is supported
                Function key-initiated network boot is supported

Handle 0x0D00, DMI type 13, 22 bytes
BIOS Language Information
        Installable Languages: 1
                en|US|iso8859-1
        Currently Installed Language: en|US|iso8859-1


장비의 Manufacturer, Model 과 Serial number 확인하기

# dmidecode -t system
# dmidecode 2.9
SMBIOS 2.3 present.

Handle 0x0100, DMI type 1, 25 bytes
System Information
        Manufacturer: Dell Computer Corporation
        Product Name: PowerEdge 1750
        Version: Not Specified
        Serial Number: 1234567
        UUID: 4123454C-4123-1123-8123-12345603431
        Wake-up Type: Power Switch

Handle 0x0C00, DMI type 12, 5 bytes
System Configuration Options
        Option 1: NVRAM_CLR:  Clear user settable NVRAM areas and set defaults
        Option 2: PASSWD:  Close to enable password

Handle 0x2000, DMI type 32, 11 bytes
System Boot Information
        Status: No errors detected



저작자 표시 비영리 동일 조건 변경 허락
크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 Comment 0

우분투 Apache/php/mysql 에서 그누보드 설치하기


그누보드 다운로드

wget http://sir.co.kr/data/gnuboard4.tgz

다운받은 파일을 /var/www 디렉토리로 이동

압축해제
tar xvzf gnuboard4.tgz

Gnuboard 에서 사용할 데이터베이스, 사용자 생성
mysql 에 접속
$mysql -uroot -p mysql

데이터베이스 gb 생성
mysql>create database gb;

데이터베이스 gb 를 사용할 사용자 gbuser 패스워드 gbuser 생성

db 테이블에 추가
mysql>insert into db(host,db,user,select_priv,insert_priv,update_priv,delete_priv,create_priv,drop_priv,grant_priv,references_priv,index_priv,alter_priv)values ('localhost','gb','gbuser','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

user 테이블에 추가
mysql>insert into user(host,user,password) values ('localhost','gbuser',password('gbuser'));

mysql>exit

mysql 재실행

$mysqladmin -uroot -p reload

웹접속후 그누보드 설치 진행
그누보드 설치파일을 시스템 /var/www/gnuboard4 에 설치되었다는 가정하에,
http://localhost/gnuboard4/

진행순서대로 진
저작자 표시 비영리 동일 조건 변경 허락
크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 Comment 0

우분투 Open Terminal

노틸러스 확장기능중 아주 유용한 Open Terminal 기능이 있습니다.

9.10버전 에서는 한글로 나오는데 우분투 10.04 베타2 버전에서는 영문으로 나오네요.


첨부 파일을 다운받은뒤 /usr/share/locale/ko/LC_MESSAGES 폴더에 복사하면 됩니다.

(첨부파일은 우분투 9.10버전의 한글화 파일입니다.)

oterminal.png


터미널에서는...

Open Terminal 설치 : sudo apt-get install nautilus-open-terminal

Open Terminal 한글패치 : sudo cp -fr nautilus-open-terminal.mo /usr/share/locale/ko/LC_MESSAGES


출처 : http://www.ubuntuk.com/?mid=tip&category=1195&document_srl=20865

저작자 표시 비영리 동일 조건 변경 허락
크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 Comment 0

우분투(Ubuntu) apt-get 으로 패키지 설치시 "/var/lib/dpkg/lock 잠금 파일을 얻을 수 없습니다" 오류 해결방법

bwhite@bwhite-desktop:~/.wine$ sudo apt-get install libapache2-mod-auth-mysql
E: /var/lib/dpkg/lock 잠금 파일을 얻을 수 없습니다 - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

위와같은 오류메시지가 보일경우,  아래 명령실행

bwhite@bwhite-desktop:~/.wine$ sudo rm /var/lib/dpkg/lock

저작자 표시 비영리 동일 조건 변경 허락
크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 Comment 1

우분투(Ubuntu)에서 Java VM(JDK)를 설치하기

java 가 설치되어 있는지 확인
$java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)

Java 가 설치되어 있다면, 위와 같이 버전을 확인할 수 있을것이다.

만약, JavaVM 이 설치되어 있다하더라도, Gnu용버전의 java 가 설치된경우(cacao, jamvm 등)라면, 아래 명령을 통해 확인가능하다.

$
update-alternatives --config java
  Selection    Path                                  우선순� Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-sun/jre/bin/java   63        auto mode
  1            /usr/bin/cacao                         10        manual mode
  2            /usr/bin/jamvm                         10        manual mode
* 3            /usr/lib/jvm/java-6-sun/jre/bin/java   63        manual mode

숫자앞에 * 표시된 것이 현재 활성화된 java 이다.

sun-java6-jre 가 설치되어 있지 않다면, 아래의 명령을 통해 설치가 가능하다.

1. sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"   # lucid앞의 공백이 중요합니다.  
     (저장소 목록에 캐노니컬의 저장소를 추가합니다.)
2. sudo aptitude update 
3. sudo aptitude install sun-java6-jdk

설치가 완료된후, 아래 명령을 통해 sun-java 를 선택한다.
$update-alternatives --config java

저작자 표시 비영리 동일 조건 변경 허락
크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 Comment 0

우분투 root 계정 활성화

터미널을 열고 아래 명령 입력후, root 패스워드 입력

sudo passwd root

root 계정 활성화가 아닌, 사용자계정에서 root 계정으로 변경하기
sudo -s
or
sudo bash

저작자 표시 비영리 동일 조건 변경 허락
크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 Comment 0

Grep -E 옵션과 Grep -v 옵션

예를들어
netstat -an 을 치면 아래와 같이 나오는데

Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp        0      0  211.43.135.55.1521     211.43.135.55.60333     ESTABLISHED
tcp        0      0  211.43.135.55.1521     211.43.135.55.64539     ESTABLISHED
tcp        0      0  211.43.135.55.10001    211.43.135.105.34757    ESTABLISHED
tcp        0      0  *.25                   *.*                     LISTEN
tcp        0      0  211.43.135.55.10001    211.253.249.233.40633   ESTABLISHED
tcp        0      0  *.587                  *.*                     LISTEN
tcp     1448      0  211.43.135.55.10001    211.43.135.104.33799    ESTABLISHED
tcp        0      0  211.43.135.55.10011    211.43.134.233.2947     ESTABLISHED
tcp        0      0  211.43.135.55.10001    125.133.142.186.1426    ESTABLISHED
tcp        0      0  211.43.135.55.8001     210.104.203.221.1080    ESTABLISHED
tcp        0      0  *.21001                *.*                     LISTEN
tcp        0      0  211.43.135.55.1521     211.43.135.55.49493     ESTABLISHED
tcp        0      0  211.43.135.55.49494    211.43.135.55.1521      ESTABLISHED
tcp        0      0  211.43.135.55.1521     211.43.135.55.49494     ESTABLISHED
tcp        0      0  *.515                  *.*                     LISTEN
tcp        0      0  127.0.0.1.49173        *.*                     LISTEN
tcp        0      0  211.43.135.55.1521     211.43.135.55.49472     ESTABLISHED
tcp        0      0  211.43.135.55.10011    211.43.132.97.48175     ESTABLISHED
tcp        0      0  *.6389                 *.*                     LISTEN

ESTABLISHED 된 목록만 보고싶을경우 아래 명령입력

netstat -an | grep "ESTABLIS"

또한,  10001 포트 또는 10011 포트 에 대해서만 보고싶을 경우,

netstat -an | grep -E "10001|10011"

또한 10001 포트또는 10011 포트 에 대한 정보중에서  ESTABLISHED 된 목록만 보고싶을경우

netstat -an | grep -E "10001|10011"|grep "EST"

반대로 10001 포트또는 10011 포트 에 대한 정보중에서  ESTABLISHED 된 목록만 제외시키고 싶을경우,

netstat -an | grep -E "10001|10011"|grep -v "EST"

크리에이티브 커먼즈 라이선스
Creative Commons License
Trackback 0 Comment 0
prev 1 next