Bug #79446 Cannot initialize raw device as InnoDB File in Linux
Submitted: 29 Nov 2015 16:35 Modified: 24 Apr 2018 13:14
Reporter: ZhongMing Guo Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.6.26 OS:Linux (Linux 3.19.0-30-generic 3.19.0-30-generic #34-Ubuntu SMP Fri Oct 2 22:08:41 UTC)
Assigned to: CPU Architecture:Any
Tags: raw

[29 Nov 2015 16:35] ZhongMing Guo
Description:
Creating a new InnoDB data file  with a raw device isn't working with mysql-server-5.6.26.
This works as expected with mysql-server-5.6.19.

2015-11-30 00:16:02 19966 [Note] InnoDB: Completed initialization of buffer pool
2015-11-30 00:16:02 19966 [Note] InnoDB: Restoring page 0 of tablespace 0
2015-11-30 00:16:02 19966 [Warning] InnoDB: Doublewrite does not have page_no=0 of space: 0
2015-11-30 00:16:02 19966 [ERROR] InnoDB: checksum mismatch in data file /var/lib/mysql/raw1
2015-11-30 00:16:02 19966 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2015-11-30 00:16:02 19966 [ERROR] Plugin 'InnoDB' init function returned error.
2015-11-30 00:16:02 19966 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-11-30 00:16:02 19966 [ERROR] Unknown/unsupported storage engine: INNODB
2015-11-30 00:16:02 19966 [ERROR] Aborting

How to repeat:
How to repeat:
sudo ls -l /dev/md2p1
brw-rw---- 1 root disk 259, 0 11月 30 00:21 /dev/md2p1
sudo mknod /var/lib/mysql/raw1 b 259 0
sudo chown mysql:mysql /var/lib/mysql/raw1

in /etc/mysql/my.cnf
innodb_data_home_dir           = "/var/lib/mysql"
innodb_data_file_path            = raw1:216463Mnewraw;
[29 Nov 2015 22:28] Peter Laursen
My (personal) comment is that support for 'raw devices' for storing data is completely irrelevant today. It was relevant 15 years ago when file systems(FAT32/EXT2(3?)FS used a 32 bit addressing algorithm limiting a file system volume to a size of 4GB. Such limitaton does not apply to recent file systems (NTFS/EXT4FS/XFS/BTRFS etc). 

But if it supposed to work according to doumentation, it is a bug (server bug or doumentation bug) of course (if reproducible).

-- Peter
-- not a MySQL/Oracle peron
[30 Nov 2015 0:54] ZhongMing Guo
a raw device without filesystem is more quick than any filesystem.
so we still want it still be supported.

it can also be supported in mysql-server-5.6.19.
we use raw devices in DirectIO, it like a file, but faster 10%.
raw devices can also use flashcache, bcache...etc,  
raw devices more quickly, that is the meaning.

innodb_flush_method  = O_DIRECT
[24 Apr 2018 13:14] MySQL Verification Team
Duplicate of bug: https://bugs.mysql.com/bug.php?id=75616.