Chances are that at some time, you’ll need to repair a corrupted filesystem, or worse, fix something you accidentally broke. Sometimes, your operating system will do this, especially if you are a fan of Linux. Such as the case with the Core2, today:

[    0.179209] Unpacking initramfs...
[    1.176420] ------------[ cut here ]------------
[    1.176514] WARNING: at arch/x86/mm/init.c:504 free_init_pages+0x53/0x11f()
[...]
[    1.177589] Call Trace:
[    1.177672]  [] dump_stack+0x19/0x1f
[    1.177759]  [] warn_slowpath_common+0x62/0x7b
[    1.177846]  [] warn_slowpath_null+0x15/0x17
[    1.177933]  [] free_init_pages+05x3/0x11f
[    1.178025]  [] free_initrd_mem+0x30/0x35
[    1.178112]  [] populate_rootfs+0xeb/0x10c
[    1.178199]  [] ? unpack_to_rootfs+0x289/0x289
[    1.178286]  [] do_one_initcall+0x9b/0x135
[    1.178373]  [] kernel_init_freeable+0x154/0x1ea
[    1.178461]  [] ? kernel_init_freeable+0x1ea/0x1ea
[    1.178550]  [] ? rest_init+0x74/0x74
[    1.178636]  [] kernel_init+0x9/0xd6
[    1.178723]  [] ret_from_fork+0x7c/0xb0
[    1.178810]  [] ? rest_init+0x74/0x74
[    1.178900] ---[ end trace ded000897d630586 ]---
[    1.179052] Freeing initrd memory: 11812k freed

Long story short, the kernel became unhappy with the latest update, and being a headless machine with no remote hands, I had to figure how to fix it.

Now, although I don’t have remote hands, I have a fairly dated (and limited) sysrescue image which I can boot the system from, and manipulate my installation from there.

Despite architectural and distribution differences, a 3.x kernel with most options available can get you back online with minimal effort.

Althought teaching you how to handle LVM/etc is not something for a quick little diary entry, I will offer this bit of advice: The following mounting heirarchy tends to work OK for Debian, CentOS, and almost any other Linux distribution I’ve thrown at it:

# fsck.{filesystem} /dev/{device}{partition} #root partition
# mount -t {filesystem} /dev/{device}{partition} /mnt
# mount -o bind /dev /mnt/dev
# mount -t sysfs sys /mnt/sys
# mount -t devpts pts /mnt/dev/pts
# mount -t proc proc /mnt/proc
# cd /mnt
# {mount/fsck any subpartitions here}
# chroot /mnt /bin/{dash|bash|ash}

Happy repairs!

Previous Post Next Post