Skip navigation links

User Comments

Posted by M Z on August 26 2004 11:33am[Delete] [Edit]

The following does not work on Windows
innodb_data_home_dir=
innodb_data_file_path=//./D::10Gnewraw
I think the problem is in "::".

Posted by Andrew Button on July 19 2006 8:05am[Delete] [Edit]

This is how I set up MySQL to use a raw device on RedHat Linux ES4. I could not access the disk partiton directly so I had to create raw devices that link to the disk partitions.

Using parted I created the raw partition (it did not let me add it in the install as there is no mount point).

Assign this partition to a raw device using raw. I.e.

raw /dev/raw/raw1 /dev/cciss/c0d0p5

Then make accessible the raw device to mysql (as mentioned in the docs):

chown mysql dev/raw/raw1

Then use the raw device (as shown in the docs). i.e.

innodb_data_home_dir =
innodb_data_file_path = /dev/raw/raw1:20000Mnewraw;

Posted by Ralf Schwedler on August 16 2007 11:39am[Delete] [Edit]

Chowning the raw device like in

chown mysql /dev/raw/raw1

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:

KERNEL=="sda5" GROUP="mysql"

to make /dev/sda5 accessible to group mysql.

Posted by Seva E on January 16 2008 7:13am[Delete] [Edit]

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).

Posted by Joaquín Alcañiz on April 15 2008 7:32am[Delete] [Edit]

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::30Graw
6. Start mysqld service again, you can create and load your databases.

Posted by Nikolay Pelov on April 23 2011 9:37am[Delete] [Edit]

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 this
innodb_data_file_path = /dev/raw/raw1:200MBnewraw;
(This partition was created as 200 MB)