我在 zfs 上有 Ubuntu 19.04 根目录。尝试升级到 19.10 时,我遇到了一个问题这里。
根据解决方案这里是取代
initrd_device=$(${grub_probe} --target=device "${boot_dir}")
在 /etc/grub.d/10_linux_zfs 的第 415 行
initrd_device=$(${grub_probe} --target=device "${boot_dir}" | head -1)
由于某种原因,我的 /etc/grub.d/ 目录中没有名为 10_linux_zfs 的文件,只有一个名为 10_linux 的文件。
提供了修改后的 10_linux_zfs 文件这里。
我想知道用修改后的 10_linux_zfs 文件替换我的 10_linux 文件是否是正确的解决方案。
任何帮助都将非常感激。
编辑:
在这个问题没有得到答复后,我最终用修改后的 10_linux_zfs 示例文件替换了我的 10_linux 文件并继续升级。除了 mysql 之外,一切似乎都进展顺利。
mike@ubuntuzfs:~$ systemctl status mysql.service
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2020-05-01 20:56:41 NZST; 12s ago
Process: 2457 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Process: 2468 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Main PID: 2468 (code=exited, status=1/FAILURE)
Status: "Server startup in progress"
Error: 13 (Permission denied)
May 01 20:56:41 ubuntuzfs systemd[1]: mysql.service: Service RestartSec=100ms expired, scheduling restart.
May 01 20:56:41 ubuntuzfs systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5.
May 01 20:56:41 ubuntuzfs systemd[1]: Stopped MySQL Community Server.
May 01 20:56:41 ubuntuzfs systemd[1]: mysql.service: Start request repeated too quickly.
May 01 20:56:41 ubuntuzfs systemd[1]: mysql.service: Failed with result 'exit-code'.
May 01 20:56:41 ubuntuzfs systemd[1]: Failed to start MySQL Community Server.
我可以重新安装 mysql,但这可能意味着我会丢失数据库,如果可能的话我宁愿不这样做。如果有人对如何解决这个问题有任何建议那就太好了。
以下是 /var/log/mysql/error.log 的一些输出
2020-05-01T08:33:28.900379Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2020-05-01T08:33:28.901172Z 0 [System] [MY-010116] [Server] /usr/sbin /mysqld (mysqld 8.0.19-0ubuntu0.19.10.3) starting as process 7461
2020-05-01T08:33:35.575977Z 4 [System] [MY-013381] [Server] Server upgrade from '80018' to '80019' started.
2020-05-01T08:34:37.114642Z 4 [ERROR] [MY-012097] [InnoDB] Table flags are 0x4021 in the data dictionary but the flags in file ./sys/sys_config.ibd are 0x21!
2020-05-01T08:34:37.115249Z 4 [ERROR] [MY-013183] [InnoDB] Assertion failure: fil0fil.cc:2465 thread 140266608400128
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb- recovery.html
InnoDB: about forcing recovery.
08:34:37 UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x5602c47e22e0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f925d5e0ce0 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x41) [0x5602c236cb11]
/usr/sbin/mysqld(handle_fatal_signal+0x31b) [0x5602c1269bcb]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x15540) [0x7f927032e540]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb) [0x7f926f7ce3eb]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b) [0x7f926f7ad899]
/usr/sbin/mysqld(+0xdc766d) [0x5602c0fbe66d]
/usr/sbin/mysqld(Fil_shard::get_file_size(fil_node_t*, bool)+0xb1d) [0x5602c278cecd]
/usr/sbin/mysqld(Fil_shard::open_file(fil_node_t*, bool)+0x4b3) [0x5602c279d893]
/usr/sbin/mysqld(Fil_shard::prepare_file_for_io(fil_node_t*, bool)+0x73) [0x5602c279daa3]
/usr/sbin/mysqld(Fil_shard::space_load(unsigned int)+0x129) [0x5602c27ad829]
/usr/sbin/mysqld(fil_space_get_flags(unsigned int)+0xb8) [0x5602c27adde8]
/usr/sbin/mysqld(dict_sdi_create_idx_in_mem(unsigned int, bool, unsigned int, bool)+0x6f5) [0x5602c2725975]
/usr/sbin/mysqld(dd_table_open_on_id(unsigned long, THD*, MDL_ticket**, bool, bool)+0x86f) [0x5602c27581ef]
/usr/sbin/mysqld(+0x2469f46) [0x5602c2660f46]
/usr/sbin/mysqld(ib_sdi_delete(unsigned int, ib_sdi_key const*, trx_t*)+0x49) [0x5602c26651e9]
/usr/sbin/mysqld(dict_sdi_delete(dd::Tablespace const&, dd::Table const*, sdi_key_t const*)+0x14a) [0x5602c276f6ca]
/usr/sbin/mysqld(dd::sdi_tablespace::drop_tbl_sdi(THD*, handlerton const&, dd::Table const&, dd::Schema const&)+0x89) [0x5602c2344369]
/usr/sbin/mysqld(dd::sdi::drop(THD*, dd::Table const*)+0xb8) [0x5602c2339428]
/usr/sbin/mysqld(bool dd::cache::Storage_adapter::drop<dd::Table> (THD*, dd::Table const*)+0x6a) [0x5602c217252a]
/usr/sbin/mysqld(bool dd::cache::Dictionary_client::drop<dd::Table> (dd::Table const*)+0x22) [0x5602c211d762]
/usr/sbin/mysqld(+0xfc5d4a) [0x5602c11bcd4a]
/usr/sbin/mysqld(mysql_alter_table(THD*, char const*, char const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*)+0x8dc3) [0x5602c11d3ec3]
/usr/sbin/mysqld(Sql_cmd_alter_table::execute(THD*)+0x443) [0x5602c1580443]
/usr/sbin/mysqld(mysql_execute_command(THD*, bool)+0x94c) [0x5602c11370cc]
/usr/sbin/mysqld(+0xf6c167) [0x5602c1163167]
/usr/sbin /mysqld(Prepared_statement::execute_server_runnable(Server_runnable*)+0x23 5) [0x5602c1164445]
/usr/sbin/mysqld(Ed_connection::execute_direct(Server_runnable*)+0x9e) [0x5602c1165c7e]
/usr/sbin/mysqld(Ed_connection::execute_direct(MYSQL_LEX_STRING)+0x3f) [0x5602c1165dff]
/usr/sbin/mysqld(+0x2119e2f) [0x5602c2310e2f]
/usr/sbin/mysqld(dd::upgrade::upgrade_system_schemas(THD*)+0x1318) [0x5602c2314ab8]
/usr/sbin/mysqld(+0x1130998) [0x5602c1327998]
/usr/sbin/mysqld(+0x26d773a) [0x5602c28ce73a]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x9669) [0x7f9270322669]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7f926f8aa323]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f920439ae60): is an invalid pointer
Connection ID (thread ID): 4
Status: NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
答案1
成功。
root@ubuntuzfs:/var/lib# service mysql status
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-05-01 22:06:36 NZST; 22s ago
Process: 11551 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 11572 (mysqld)
Status: "Server is operational"
Tasks: 40 (limit: 4915)
Memory: 460.1M
CGroup: /system.slice/mysql.service
└─11572 /usr/sbin/mysqld
May 01 22:06:23 ubuntuzfs systemd[1]: Starting MySQL Community Server...
May 01 22:06:36 ubuntuzfs systemd[1]: Started MySQL Community Server.
/var/lib/mysql 的权限错误。
下面的内容让我了解了这一点。
root@ubuntuzfs:/var/run# sudo /usr/sbin/mysqld
2020-05-01T09:54:16.973242Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2020-05-01T09:54:16.974110Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19-0ubuntu0.19.10.3) starting as process 31887
2020-05-01T09:54:16.976401Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to '/var/lib/mysql/' (OS errno: 13 - Permission denied)
2020-05-01T09:54:16.976476Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-05-01T09:54:16.976622Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.19-0ubuntu0.19.10.3) (Ubuntu).