Skip to content

Instantly share code, notes, and snippets.

@minazou67
Last active August 13, 2019 18:13
Show Gist options
  • Save minazou67/4bf63b463347558f3f01 to your computer and use it in GitHub Desktop.
Save minazou67/4bf63b463347558f3f01 to your computer and use it in GitHub Desktop.
How to upgrade the Linux Kernel of debian 8 jessie

How to upgrade the Linux Kernel of debian 8 jessie

Debian 8 のカーネルをアップグレードする方法です。

Environment

  • Microsoft Windows Server 2012 R2
  • Hyper-V
  • Debian 8.2 jessie
  • Use iSCSI hard disk

Update reason

特定の操作を実行すると、下記の警告がカーネルのメッセージバッファに出力され、その後ハードディスクが read-only でリマウントされてしまうため。

参考URL:https://lists.debian.org/debian-kernel/2015/07/msg00178.html

# dmesg
[3207336.832154] hv_storvsc vmbus_0_1: cmd 0x35 scsi status 0x2 srb status 0x82
[3207336.832158] hv_storvsc vmbus_0_1: stor pkt ffff880037390ac0 autosense data valid - len 18
[3207336.832160] storvsc: Sense Key : Unit Attention [current]
[3207336.832162] storvsc: Add. Sense: Changed operating definition
[3207336.832168] sd 2:0:0:0: Warning! Received an indication that the operating parameters on this target have changed. The Linux SCSI layer does not automatically adjust these parameters.
[3207336.832174] end_request: I/O error, dev sda, sector 4569656
[3207336.832203] Aborting journal on device sda1-8.
[3207336.837614] EXT4-fs error (device sda1): ext4_journal_check_start:56: Detected aborted journal
[3207336.837644] EXT4-fs (sda1): Remounting filesystem read-only

Update procedure

Pre-processing

  • 稼働しているアプリケーションを停止
  • Hyper-V 上の仮想マシンにチェックポイントを作成
  • カーネルのバージョンを確認
# uname -a
Linux debian8 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 GNU/Linux

Update sources.list

パッケージの取得元に backports リポジトリを追加します。

# sudo vi /etc/apt/sources.list.d/sources.list
deb http://http.debian.net/debian jessie-backports main
deb-src http://http.debian.net/debian jessie-backports main

Update package

パッケージリストを更新し、各種パッケージ(ディストリビューション)もついでに最新にしておきます。

# sudo apt-get update
# sudo apt-get dist-upgrade

Install the kernel

最新版のカーネルをインストールします。

# sudo apt-cache search linux-image
linux-headers-3.16.0-4-amd64 - Linux 3.16.0-4-amd64 用ヘッダファイル
linux-image-3.16.0-4-amd64 - 64 ビット PC 用 Linux 3.16
linux-image-3.16.0-4-amd64-dbg - Linux 3.16.0-4-amd64 のデバッグシンボル
linux-image-amd64 - 64 ビットマシン用 Linux (メタパッケージ)
linux-image-amd64-dbg - Linux amd64 構成向けデバッグシンボル (メタパッケージ)
linux-headers-4.2.0-0.bpo.1-amd64 - Header files for Linux 4.2.0-0.bpo.1-amd64
linux-image-4.2.0-0.bpo.1-amd64 - Linux 4.2 for 64-bit PCs
linux-image-4.2.0-0.bpo.1-amd64-dbg - Debugging symbols for Linux 4.2.0-0.bpo.1-amd64
# sudo apt-get install -t jessie-backports linux-image-amd64

Clean-up and reboot

インストールに使用したアーカイブファイルを削除し、OS を再起動します。

# sudo apt-get clean
# sudo reboot

Check the kernel version

カーネルのバージョンを確認します。

# uname -a
Linux debian8 4.2.0-0.bpo.1-amd64 #1 SMP Debian 4.2.6-1~bpo8+1 (2015-11-18) x86_64 GNU/Linux

Post-processing

  • アプリケーションを開始し動作に問題がないことを確認
  • Hyper-V 上の仮想マシンのチェックポイントを削除
  • Hyper-V 上の仮想マシンをエクスポートしてバックアップ
@mxi1
Copy link

mxi1 commented Apr 3, 2017

Thanks for sharing.

@g00dnatur3
Copy link

Nice instructions, Thank You!
谢谢

@shichao-an
Copy link

Thanks!

@kalashnlkov
Copy link

Thank you for sharing.

@zenwalk
Copy link

zenwalk commented Dec 11, 2017

thank you

@malicktech
Copy link

Thanks a lot !

@dkalog
Copy link

dkalog commented Mar 3, 2019

thanks dude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment