# Got "/ib\_logfile0 is of different size" when doing stream backup

**URL:** <https://forums.percona.com/t/got-ib-logfile0-is-of-different-size-when-doing-stream-backup/3565>\
**Category:** Percona XtraBackup\
**Created:** [June 23, 2014, 8:00am UTC](https://forums.percona.com/t/got-ib-logfile0-is-of-different-size-when-doing-stream-backup/3565 "2014-06-23T08:00:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![marat.komarov](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/marat.komarov/32/931_2.png) [@marat.komarov](https://forums.percona.com/u/marat.komarov)\
**Post date:** [June 23, 2014, 8:00am UTC](https://forums.percona.com/t/got-ib-logfile0-is-of-different-size-when-doing-stream-backup/3565/1 "2014-06-23T08:00:19Z")

</div>

Hello,

We got an error “InnoDB: Error: log file ./ib\_logfile0 is of different size 5242880 bytes” when doing stream backup on Ubuntu 12.04

MySQL Server: 5.5.37-0ubuntu0.12.04.1  
Xtrabackup: 2.2.3-4982-1.precise

Command: /usr/bin/innobackupex --ibbackup xtrabackup --password XXXX --user ‘scalr’ --stream xbstream /mnt/dbstorage/tmp

Log:

```auto

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p

140623 12:50:05 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup' as 'scalr' (using password: YES).
140623 12:50:05 innobackupex: Connected to MySQL server
140623 12:50:05 innobackupex: Executing a version check against the server...
140623 12:50:06 innobackupex: Done.
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints "completed OK!".

innobackupex: Using mysql server version 5.5.37-0ubuntu0.12.04.1-log

innobackupex: Created backup directory /mnt/dbstorage/tmp

140623 12:50:06 innobackupex: Starting ibbackup with command: xtrabackup --defaults-group="mysqld" --backup --suspend-at-end --target-dir=/tmp --tmpdir=/tmp --extra-lsndir='/tmp' --stream=xbstream
innobackupex: Waiting for ibbackup (pid=7964) to suspend
innobackupex: Suspend file '/tmp/xtrabackup_suspended_2'

xtrabackup version 2.2.3 based on MySQL server 5.6.17 Linux (x86_64) (revision id: )
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /mnt/dbstorage/mysql-data
xtrabackup: open files limit requested 0, set to 1024
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
InnoDB: Error: log file ./ib_logfile0 is of different size 5242880 bytes
InnoDB: than specified in the .cnf file 50331648 bytes!
innobackupex: Error: The xtrabackup child process has died at /usr/bin/innobackupex line 2672.

```

```auto

$ my_print_defaults mysqld
--user=mysql
--pid-file=/var/run/mysqld/mysqld.pid
--socket=/var/run/mysqld/mysqld.sock
--port=3306
--basedir=/usr
--datadir=/mnt/dbstorage/mysql-data
--tmpdir=/tmp
--lc-messages-dir=/usr/share/mysql
--skip-external-locking
--key_buffer=16M
--max_allowed_packet=16M
--thread_stack=192K
--thread_cache_size=8
--myisam-recover=BACKUP
--query_cache_limit=1M
--query_cache_size=16M
--log_error=/var/log/mysql/error.log
--expire_logs_days=10
--max_binlog_size=100M
--log-bin-index=/mnt/dbstorage/mysql-misc/binlog.index
--sync_binlog=1
--innodb_buffer_pool_size=16M
--innodb_flush_log_at_trx_commit=1
--log_bin=/mnt/dbstorage/mysql-misc/binlog
--server-id=1

```

---

<div class="post-metadata">

**Author:** ![alaincraven](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@alaincraven](https://forums.percona.com/u/alaincraven)\
**Post date:** [July 29, 2014, 12:00am UTC](https://forums.percona.com/t/got-ib-logfile0-is-of-different-size-when-doing-stream-backup/3565/2 "2014-07-29T00:00:34Z")

</div>

I found the only way to fix this is to explicitly set the log file size in my.cnf  
in the [mysqld] section, add the line  
innodb\_log\_file\_size=5M

Changing 5M to whatever size your log file actually is.

The restart mysql

Be warned - changing the log file size will cause mysql to fail to start. If this happens change the size to the correct size.  
If you do a full / complete mysql shutdown you can also remove the existing log files before restarting - this always works for me.

---

<div class="post-metadata">

**Author:** ![marat.komarov](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/marat.komarov/32/931_2.png) [@marat.komarov](https://forums.percona.com/u/marat.komarov)\
**Post date:** [July 29, 2014, 3:34am UTC](https://forums.percona.com/t/got-ib-logfile0-is-of-different-size-when-doing-stream-backup/3565/3 "2014-07-29T03:34:33Z")

</div>

Thank you,

I’ve already found this solution too.

MySQL Server depending on version has different default value for innodb\_log\_file\_size: 5242880 (MySQL \< 5.6.8), 50331648 (MySQL \>= 5.6.8) [url][MySQL :: MySQL 5.6 Reference Manual :: 14.14 InnoDB Startup Options and System Variables](http://dev.mysql.com/doc/refman/5.6/en/innodb-parameters.html#sysvar_innodb_log_file_size%5B/url%5D)

Xtrabackup uses it’s own compiled defaults. Version line “xtrabackup version 2.2.3 based on MySQL server 5.6.17 Linux (x86\_64) (revision id: )” is very meaningful.

You are getting this error with xtrabackup compiled against MySQL \>= 5.6.8 and MySQL \< 5.6.8 when you haven’t explicitly set innodb\_log\_file\_size in my.cnf  
Solution is to set correct default value in my.cnf or like you set custom size and reset logfile

---

<div class="post-metadata">

**Author:** ![dkorzhevin](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dkorzhevin](https://forums.percona.com/u/dkorzhevin)\
**Post date:** [July 29, 2014, 4:50am UTC](https://forums.percona.com/t/got-ib-logfile0-is-of-different-size-when-doing-stream-backup/3565/4 "2014-07-29T04:50:40Z")

</div>

Hi, I have same problem with xtrabackup 2.2.3-4982-1.wheezy on Debian 7 Wheezy.

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy  
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.

This software is published under  
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

Get the latest version of Percona XtraBackup, documentation, and help resources:  
[url][Percona XtraBackup - MySQL Database Backup Software](http://www.percona.com/xb/p%5B/url%5D)

140729 12:17:50 innobackupex: Connecting to MySQL server with DSN ‘dbi:mysql:;mysql\_read\_default\_group=xtrabackup’ as ‘root’ (using password: YES).  
140729 12:17:50 innobackupex: Connected to MySQL server  
140729 12:17:50 innobackupex: Executing a version check against the server…  
140729 12:17:50 innobackupex: Done.  
IMPORTANT: Please check that the backup run completes successfully.  
At the end of a successful backup run innobackupex  
prints “completed OK!”.

innobackupex: Using mysql server version 5.5.38-35.2-log

innobackupex: Created backup directory /root/2014-07-29\_12-17-50

140729 12:17:50 innobackupex: Starting ibbackup with command: xtrabackup --defaults-group=“mysqld” --backup --suspend-at-end --target-dir=/root/2014-07-29\_12-17-50 --tmpdir=/tmp --extra-lsndir=‘/tmp’  
innobackupex: Waiting for ibbackup (pid=26112) to suspend  
innobackupex: Suspend file ‘/root/2014-07-29\_12-17-50/xtrabackup\_suspended\_2’

xtrabackup version 2.2.3 based on MySQL server 5.6.17 Linux (x86\_64) (revision id: )  
xtrabackup: uses posix\_fadvise().  
xtrabackup: cd to /var/lib/mysql  
xtrabackup: open files limit requested 0, set to 1024  
xtrabackup: using the following InnoDB configuration:  
xtrabackup: innodb\_data\_home\_dir = ./  
xtrabackup: innodb\_data\_file\_path = ibdata1:10M:autoextend  
xtrabackup: innodb\_log\_group\_home\_dir = ./  
xtrabackup: innodb\_log\_files\_in\_group = 2  
xtrabackup: innodb\_log\_file\_size = 50331648  
InnoDB: Error: log file ./ib\_logfile0 is of different size 5242880 bytes  
InnoDB: than specified in the .cnf file 50331648 bytes!  
innobackupex: Error: The xtrabackup child process has died at /usr/bin/innobackupex line 2672.

I use: percona-server-common-5.5 5.5.38-rel35.2-674.wheezy

Please, advice - which correct default value in my.cnf should i set based on?

---

<div class="post-metadata">

**Author:** ![alaincraven](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@alaincraven](https://forums.percona.com/u/alaincraven)\
**Post date:** [July 29, 2014, 5:53am UTC](https://forums.percona.com/t/got-ib-logfile0-is-of-different-size-when-doing-stream-backup/3565/5 "2014-07-29T05:53:52Z")

</div>

Judging by the error you are getting, 5M is the right size.
