14.2.1.3 Using Raw Devices for the System Tablespace

You can use raw disk partitions as data files in the
InnoDBsystem tablespace.
By using a raw disk, you can perform nonbuffered I/O on Windows
and on some Unix systems without file system overhead. This may
improve performance, but you are advised to perform tests with
and without raw partitions to verify whether this is actually so
on your system.

When you use a raw disk partition, be sure that it has
permissions that enable read and write access by the account
used for running the MySQL server. For example, if you run the
server as the mysql user, the partition must
permit read and write access to mysql. If you
run the server with the --memlock
option, the server must be run as root, so
the partition must permit access to root.

Allocating a Raw Disk Partition on Linux and Unix Systems

When you create a new data file, specify the keyword
newraw immediately after the data file
size for the
innodb_data_file_path
option. The partition must be at least as large as the size
that you specify. Note that 1MB in InnoDB
is 1024 × 1024 bytes, whereas 1MB in disk
specifications usually means 1,000,000 bytes.

Restart the server. InnoDB notices the
newraw keyword and initializes the new
partition. However, do not create or change any
InnoDB tables yet. Otherwise, when you
next restart the server, InnoDB
reinitializes the partition and your changes are lost. (As a
safety measure InnoDB prevents users from
modifying data when any partition with
newraw is specified.)

After InnoDB has initialized the new
partition, stop the server, change newraw
in the data file specification to raw:

will fail after the next reboot, if the /dev-tree is dynamically created by, e.g. udev, a MAKEDEV-script or similar. After reboot, the device will regain its former permission, typically excluding access by mysql.

A permanent solution is (in the case of a udev-generated /dev) to create the file /etc/udev/rules.d/41-local-permissions-rules containing the single line:

innodb_file_per_table must be set to 0 (default). If it's set (to 1), InnoDB table data files (.ibd) will be created in the datadir instead of in the raw device's shared tablespace even if innodb_data_home_dir is blank.

Not sure if this is a bug or a feature, but this is not what I expected. Tested with mysql-5.0.22-2.1 (RHEL 5).

It works fine on Windows. Follow next steps:1. Select a primary clear partition and format it on FAT32 (instead NTFS). Assign a drive letter to it, and compute its size in Mb or Gb (asume M: and 30Gb in this example)2. Edit "my.ini" file and add on it: innodb_data_home_dir=innodb_data_file_path=//./M::30Gnewraw (yes, use "::")3. Start mysqld service and WAIT until disk ends working. (see at LED on front your PC).4. Stop mysqld service.5. Edit "my.ini" file and change ("newraw" to "raw"):innodb_data_file_path=//./M::30Graw6. Start mysqld service again, you can create and load your databases.

You might want to use size of raw device in bytes or at least kilobytes, because when creating partitions the size does not match exactly if specified in GB:innodb_data_file_path = /dev/raw/raw1:199108608newraw;innodb_data_file_path = /dev/raw/raw1:194442Knewraw;and NOT like thisinnodb_data_file_path = /dev/raw/raw1:200MBnewraw;(This partition was created as 200 MB)