debian boot kernel panic

Debian kernel or initramfs seems to have intermittent kernel panic at boot time. I have had these on & off over many kernels/upgrades. Many times, this problem seems to go away after a few hours or days. Till then, I dual-boot one of my other systems.

Initramfs unpacking failed: junk in compressed archive
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
CPU: 1 PID: 1 Comm: swapper/0 not tainted 4.6.0-1-686-pae #1 Debian 4.6.4-1
...
Kernel Offset: disabled
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

I suspect this happens more with the testing flavours, than with stable. I keep trying occassionally if debian kernel would boot without the kernel panic. If could boot atleast once, then I update my initramfs by

# update-initramfs -uv

Most times, this has resolved the issue.

This time, the problem seems to have continued far longer, probably because I am continuously using the system, and trying to reboot into this kernel very often. I have noticed the problem goes away, if I power off the system and come back after a few hours or days.

So, I tried to boot the alternate kernel /vmlinuz.old. And it booted clean :)

Thus the problem is further narrowed down to the current kernel, in this case linux-image-4.6.0-1-686-pae.

There are two methods to update the initramfs of an installed-kernel on debian systems.

Debian Kernel Handbook recommends
# dpkg-reconfigure linux-image-4.6.0-1-686-pae

Alternatively,
# update-initramfs -u

ref: http://kernel-handbook.alioth.debian.org/ch-initramfs.html#s-initramfs-regen

wpa_supplicant systemd

I still don't prefer systemd, but sometimes you can't avoid demandware. Below is my preferred way to get systemd on wifi. This method now works with all flavours, including debian.

Identify wifi device(s)

$ iw dev
phy#0
        Interface wlp3s0
                ifindex 3
                wdev 0x1
                addr 00:00:00:00:00:00
                type managed
                channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz

Config wifi device

# vi /etc/systemd/network/wlp3s0.network 
[Match]
Name=wlp3s0

[Network]
DHCP=ipv4
IPv6PrivacyExtensions=true

[DHCP]
RouteMetric=20

Config wpa_supplicant

# vi /etc/wpa_supplicant/wpa_supplicant-wlp3s0.conf 
[sudo] password for superuser: 
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

Add wifi network(s)

# wpa-passphrase wlan passphrase >> /etc/wpa_supplicant/wpa_supplicant-wlp3s0.conf

Enable relevant systemd services

# systemctl enable wpa_supplicant@wlp3s0
# systemctl enable systemd-networkd

Reboot and test you are connected :)

If this worked, use wpa_gui for a SysTray icon to help manage wifi network connections. No need for NetworkManager/Gnome bloatware.

wpa_supplicant dhcpcd systemd debian

The leanest cleanest way to connect to wpa/2 networks is wpa_supplicant. And wpa_gui provides GUI and system tray icon, if needed. All other applications are bloat, building additional layers and complexity. Goodbye Gnome/NetworkManager!

Since moving to systemd chasing the gnome dragons, the debian ecosystem has broken down. Many debian ways of doing things have since become invalid, and systemd ways of doing things need to be understood. This understanding is still not quite clear in any knowledge base, particularly with debian.

In systemd, the cleanest way seems to be the dhcpcd hook automatically invoking wpa_supplicant.

A recent update to Debian Stretch broke wireless connectivity. Researching the issue led to dhcpcd hooks. Apparently, dhcpcd5 continues to provide the wpa_supplicant hook, but removed it as default. The fix was to add back the wpa_supplicant hook to dhcpcd hooks.

The default dhcpcd hooks are located at /lib/dhcpcd/dhcpcd-hooks/
Additional dhcpcd hooks are located at /usr/share/dhcpcd/hooks/

So we
# ln -s /usr/share/dhcpcd/hooks/10-wpa_supplicant /usr/share/dhcpcd/hooks/10-wpa_supplicant

Reboot debian, and verify wireless connectivity.

Interestingly, arch doesn't need this workaround.

Update: I have moved on from dhcpcd, and purged it.

tar backup restore

identify and mount directories/devices for backup sources and targets, i.e.
-- backup, which directory
-- backup, to which file, located where

tar - tape archiver
http://gnu.org/software/tar/manual

$ tar --help
$ man tar

some useful options
-c, --create
create a new archive

-t, --list
list the contents of an archive

-x, --extract, --get
extract files from an archive

-a, --auto-compress
use archive suffix to determine the compression program

-f, --file=ARCHIVE
use  archive file or device ARCHIVE

--numeric-owner
always use numbers for user/group names

--owner=NAME
Force NAME as owner for added files.

--one-file-system 
stay in local file system when creating archive

-p, --preserve-permissions, --same-permissions
extract information about file permissions (default for superuser)

--show-defaults
show tar defaults

-v, --verbose
verbosely list files processed

--xattrs
enable extended attributes support

backup
descend into directory, and tar current directory avoiding absolute pathname risks

$ cd {backup-directory}
$ sudo tar --one-file-system --numeric-owner --xattrs -cvapf /mnt/backup/{backup-filename}.tar.xz .

restore
descend into target directory, and untar

$ sudo tar --one-file-system --numeric-owner --xattrs -xvapf /mnt/backup/{backup-filename}.tar.xz

gentoo kernel compile

i'm doing this so often, i need a ready reference. so here's a post :)

install lspci, if needed.
$ emerge --search pciutils
# emerge --ask sys-apps/pciutils

$ lspci -knnv
$ lsmod

source
# emerge --ask sys-kernel/gentoo-sources

config
$ cd /usr/src/linux
# make menuconfig

http://wiki.gentoo.org/wiki/Handbook:X86/Installation/Kernel#Activating_required_options

make
# make && make modules_install
# make install

initramfs
http://wiki.gentoo.org/wiki/initramfs

gentoo wiki doesn't say how to make it.. just refers genkernel
it suggests including everything in kernel, rather than modules. then you won't need initramfs.

i prefer slim kernel. anything not always in use should be out of kernel as modules.
i use LABELs in fstab, and btrfs filesystem.. not a standard kernel.. guess i need initramfs.

# genkernel --install --no-ramdisk-modules --disklabel initramfs

modules
$ find /lib/modules// -type f -iname '*.o' -or -iname '*.ko'
# vi /etc/conf.d/modules
modules="i915 ..."

firmware
$ emerge --search firmware
# emerge --ask sys-kernel/linux-firmware

most popular posts