Installation Raw Device On Debian

설치과정

  1. raw module 을 추가한다.
    # modprobe raw
  2. raw device 맵을 확인한다.
    # MAKEDEV -v raw
    create rawctl   c 162 0 root:disk 0660
    create raw/raw1 c 162 1 root:disk 0660
    create raw/raw2 c 162 2 root:disk 0660
    create raw/raw3 c 162 3 root:disk 0660
    create raw/raw4 c 162 4 root:disk 0660
    create raw/raw5 c 162 5 root:disk 0660
    create raw/raw6 c 162 6 root:disk 0660
    create raw/raw7 c 162 7 root:disk 0660
    create raw/raw8 c 162 8 root:disk 0660
  3. /etc/raw 디렉토리를 생성한다.
    # mkdir /dev/raw
  4. /etc/rawctl 생성한다.
    mknod /dev/rawctl c 162 0
  5. /etc/raw/rawX 디바이스를 생성한다.
    mknod /dev/raw/raw1 c 162 1
    mknod /dev/raw/raw2 c 162 2
    mknod /dev/raw/raw3 c 162 3
    mknod /dev/raw/raw4 c 162 4
    mknod /dev/raw/raw5 c 162 5
    mknod /dev/raw/raw6 c 162 6
    mknod /dev/raw/raw7 c 162 7
    mknod /dev/raw/raw8 c 162 8
  6. raw 파일을 디스크에 매핑시킨다.
    # cd /dev/raw
    # raw /dev/raw/raw1 /dev/hdb1
  7. raw device 상태를 확인한다.
    # MAKEDEV -v -n raw
    create rawctl   c 162 0 root:disk 0660
    create raw/raw1 c 162 1 root:disk 0660
    create raw/raw2 c 162 2 root:disk 0660
    create raw/raw3 c 162 3 root:disk 0660
    create raw/raw4 c 162 4 root:disk 0660
    create raw/raw5 c 162 5 root:disk 0660
    create raw/raw6 c 162 6 root:disk 0660
    create raw/raw7 c 162 7 root:disk 0660
    create raw/raw8 c 162 8 root:disk 0660
    node2:/dev/raw# raw -qa
    /dev/raw/raw1:  bound to major 8, minor 17
    /dev/raw/raw2:  bound to major 8, minor 33
    /dev/raw/raw3:  bound to major 8, minor 49
    /dev/raw/raw4:  bound to major 8, minor 65
    /dev/raw/raw5:  bound to major 8, minor 81
  8. raw device format
    # dd if=/dev/zero of=/dev/raw/raw1 bs=1024 count=1000
  9. Oracle 등 어플리케이션에서 raw device를 이용한다.