Linux raw partition

Ako treba da se formatira particija pod Linux-om (Fedora ili RHEL) za Oracle bazu, što zahteva RAW particiju (videti dobru definiciju za raw particiju ovde), to se radi ovako :

1. Formira se raw device
# mknod -m 660 /dev/raw/raw130 c 162 130
# ls -l /dev/raw/raw130
crw-rw—- 1 root root 162, 130 Jun 4 08:33 /dev/raw/raw130

Paziti, na toj lokaciji se već nalazi jedan fajl : /dev/raw/rawctl
Ali to je device controler za raw devices.

2. Formatira se dati prostor
# fdisk /dev/emcpowera
…..
Command (m for help): p
Disk /dev/emcpowera: 64.4 GB, 64424509440 bytes
64 heads, 32 sectors/track, 61440 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbf277df7
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-61440, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-61440, default 61440):
Using default value 61440
Command (m for help): w
The partition table has been altered!

3. Pridruži se kreirani raw device formatiranoj particiji
# raw /dev/raw/raw130 /dev/emcpowera
/dev/raw/raw130: bound to major 120, minor 0

4. Proveriti urađeno (prikazuje vezane raw devices)
# raw -qa
/dev/raw/raw130: bound to major 120, minor 0

Paziti jer posle reboot-a sistema mora da se uradi sve iz početka (naravno bez formatiranja).

Ako je potrebno da neki nalog osim root-a koristi raw device, potrebno je datom nalogu dati grupu “disk” :
# usermod -a -G disk ime-naloga
[root@dw etc]# id ime-naloga
uid=500(ime-naloga) gid=6(disk) groups=6(disk),501(ime-naloga)

Comments are closed.