Posts Tagged Kernel

Windows CHKDSK at boot cancelled by phantom keypress

When you run the Windows checkdisk (chkdsk) utility, it may report the disk being in use and recommend that you schedule chkdsk to run the next time the computer restarts, like the following screenshot shows:


Windows can’t check the disk while it’s in use. Do you want to check for hard disk errors the next  time you start your computer?

However, doing that ran me into a very curious issue on Michele’s laptop: I would restart the computer, and get a message telling me to press any key within a few seconds to abort the scan if I so desired. Sorry, but I don’t have the exact message in front of me at the moment. Curiously it would abort itself after a second or two, stating that I pressed a key (which I did not). I’m fairly certain this is caused by this issue here: kernel atkbd.c: Unknown key released messages on Linux.

In order to make the chkdsk run without aborting due to that phantom keystroke, you have to set the delay to zero. To do this, boot back up into Windows, open an administrative-level command prompt, and run the following:

chkntfs /t:0

That will set the delay to zero seconds, effectively making it unable to be interrupted. Schedule the disk check again and reboot. It should run without issue.

Questions, comment, or any issues with the above are welcome in the comments section. Thank you!

, ,


Ubuntu not booting with nVidia video on i3-i5-i7 Intel CPUs

Systems with i3/i5/i7 chipsets and nVidia video may experience Ubuntu not booting, and instead getting a blank screen with a flashing cursor or corrupt video display.

This seems to be an issue with some combination of kernel, video card, and nouveau driver, and appears to stem from the fact that the system technically has two sets of video hardware: that on the Intel CPU and the nVidia GPU.. While the Ubuntu developers work to get this corrected, there is a workaround to get you going.

When your system starts to boot up, hold the shift key to get to the GRUB menu, then press ‘e’ to edit the command line. Go to the kernel line (the line that starts with linux and has quiet splash in it) and press the ‘end’ key to scroll to the end of the line. Add nouveau.modeset=0 to the end of the line, then press F10 to boot.

After booting up, you can install the nVidia proprietary drivers and reboot and graphics will work great for you.

You can also permanently disable the nouveau module by running the following:

echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
sudo update-initramfs -u

You may experience a low-resolution splash or login screen. See my post nVidia proprietary drivers and low-resolution Plymouth splash screen for a solution to this.

See also: Troubleshooting Nouveau Drivers

, , , ,

Leave a comment

kernel atkbd.c: Unknown key released messages on Linux

I just installed Ubuntu 10.10 (Maverick Meerkat) on to a Dell Vostro 1000. (Yea, yea, I know Natty is just around the corner). During the installation I dropped the terminal box down — ‘cus I’m like that — and noticed the following messages spamming the terminal log:

Apr 20 14:17:59 Vostro-1000 kernel: [    2.814838] atkbd serio0: Unknown key pressed (translated set 2, code 0x8d on isa0060/serio0).
Apr 20 14:17:59 Vostro-1000 kernel: [    2.814844] atkbd serio0: Use 'setkeycodes e00d ' to make it known.

Unplugging the laptop’s AC adapter caused it to throw the same event, this time with code e06e.

After some research, it looks like various model laptops throw odd keycodes in response to AC adapter/battery events. The Dell Vostro 1000 seems to be the one that comes up the most in searches, but the Dell Latitude 131L (which is based on the same design / hardware) is mentioned in Launchpad bug #549741, which is specific to this issue. The Inspiron 1501 is mentioned in Redhat bug #454131.

There’s also the issue of the specific keycodes that are thrown. Myself, I saw e00d and e06e. The author at DezzaNet mentions e055 as well.

So how to get rid of these messages?

The two bug reports referenced above mention removing and replacing the battery while the system is on. However, that may not work in all cases. There’s another way to get rid of the messages, and that’s mapping the keycode to the NULL character.

To do this at every bootup, edit the /etc/rc.local file and add lines like the following above the exit 0 statement:

setkeycodes  255

For example:

setkeycodes e00d 255

Repeat for each keycode you will to null out.

Questions, comments, feedback regarding this? Feel free to share in the comments below. Thank you!

, , , ,


Accessing media and gvfs mounts from the command line in Ubuntu Linux

Most modern Ubuntu installations use the Gnome Virtual File System (gvfs) to automatically mount network shares, FTP locations, etc. These appear as icons on the users desktop, but not as actual mount points.

Take one of my icons for example:

(image ‘music-on-diskstation’ missing)

If you run mount from a terminal, you’ll notice that it doesn’t appear:

xxx@xxx:~$ mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro,user_xattr,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/xxx/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=xxx)

As it turns out, gvfs mounts are mounted by the gvfs-duse-daemon into the /home/xxx/.gvfs folder. Let’s take a look:

xxx@xxx:~/.gvfs$ ls -l
total 2
drwx------ 1 xxx xxx    0 2011-03-05 23:18 music on diskstation

So there it is.

Other locations, like a USB flash drive, are likely actually mounted under /media:

xxx@xxx:~$ mount
/dev/sdb1 on /media/1721-0115 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush)

Questions, comments, and feedback are welcome and appreciated.

, , , ,

Leave a comment

Upgrading your Ubuntu Linux filesystem from Ext3 to Ext4

With recent Linux distributions (based on the 2.6.28 kernel) the Ext4 file system is considered stable and provides many improvements over Ext3.

Ubuntu systems running 9.04 (Jaunty Jackalope) had the option to format Ext4 during install time, but Ext3 was the default until 10.04 (Lucid Lynx). However, it’s possible (and fairly easy) to upgrade Ext3 to Ext4 in-place and without reformatting or reinstalling. Nice, huh?

The following guide is based heavily off the Ubuntu documentation, which some added steps and clarification. If you’re going to do this, use your head and make sure you have backups of your important data before you start, just in case. Also, don’t skip any steps, and double-check yourself along the way. A typo could ruin your day.

Zero – Before you start

Verify your kernel version by running uname -r. Make sure it is 2.6.28 or higher. If it is not, STOP. Upgrade your kernel before attempting to proceed.

Also, check that you’re currently using Ext3 — this would be pointless if you’re already running ext4 — by using the mount command. You should see something like the following:

/dev/sda1 on / type ext3

This shows ext3 as the current filesystem type.

One – Turn off any automatic updating

Go to System > Administration > Update Manager. Click Settings and set Automatic Updates to Only notify about available updates. You want to make sure that the system doesn’t start applying an update halfway through this and give you the potential worst-case of an unbootable system.

Two – Prepare to load the Ext4 driver

Ext4 is backwards compatible with Ext3, which makes this update process as easy as it is. We’ll start by telling the system to load the Ext4 driver instead of the Ext3 driver at boot. This will allow the system to boot and run normally for the steps that follow.

Edit the file /etc/fstab in your favorite text editor. gksu gedit /etc/fstab will do fine. Change any references for disks that you plan to convert from Ext3 to Ext4. Take a look at the example:

# /etc/fstab: static file system information.
proc            /proc           proc    defaults        0       0
# /dev/sda1
UUID=327c1819-14e1-4b96-b9d2-d5e55e50f1ae /               ext3    defaults,errors=remount-ro,relatime 0       1
# /dev/sda5
UUID=900e39f2-ad49-42ee-a7f5-8e6807d6b35b none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0

The above example shows an Ext3 filesystem on /dev/sda1. I’ll use /dev/sda1 as the file system for the rest of the guide for clarity. So, change ext3 to ext4 in the above file and save it.

Reboot. ( shutdown -r now )

Three – Update the filesystem options

After rebooting, the kernel will be using the Ext4 filesystem driver, even though your filesystem on disk is still natively ext3. That’s what you want, you’ll be making the actual changes to the filesystem soon.

Now, run the following command to make the changes to your filesystem that adds the Ext4 features:
sudo tune2fs -O extents,uninit_bg,dir_index /dev/sda1

Note: There’s no spaces after the comma-separated options. Copy/paste if you’re not sure.

This assumes /dev/sda1, like I stated above. Change it if it’s not correct for you, or if you’re doing multiple filesystems, run it for each one.

Reboot again ( shutdown -r now )

Four – Take a deep breath

Due to the changes that tune2fs made on your filesystem, when you reboot you’re going to get the message

“Errors were detected on your filesystem, press ‘F’ to fix…” or something similiar. Press F and let it do it’s thing.

You may get the following error as well (I did):

The disk drive for for /tmp is not ready yet or not present.
Continue to wait or ...

Just wait patiently. You’re waiting for the changes to finish on the currently-processing filesystem, and it’s just telling you that it’s trying to mount or access /tmp and it’s having trouble, due to the currently-running process.

After a few minutes (depending on the size of your partitions and the amount of data on them), everything will go back to normal and you’ll be able to log in again.

There’s just a few more steps.

Five – Reinstall grub

Run the following command to reinstall grub. Note that the partition number is omitted from the device path — this is intentional and correct.

sudo grub-install /dev/sda

You should get a message indicating the operation was successful.

If you are upgrading from 8.04 LTS to 10.04 LTS, you will need to install grub2 as soon as possible, as grub1 is not Ext4-aware. (Users running 9.04 are not affected by this.)

sudo apt-get install grub2

followed by

sudo update-grub

Once it’s done, no more reboots are really necessary, though you can always reboot to make sure grub actually reinstalled correctly. Files written from now on will be written with full Ext4 structures. You can also turn automatic updates back on at this point.

You can verify all the filesystem features are set by running:

sudo tune2fs -l /dev/sda | grep features

This is the list of ext4 features you should have set:
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent sparse_super large_file uninit_bg
If you’re missing one or more features, go back to step three above and check that you entered the command correctly.

Questions, comments, and feedback are welcome, as always.

, , , ,

Leave a comment

Correctly Recognize Alps Touchpad on Dell E6510 in Linux

Laptops which use newer Alps touchpad hardware may experience some lack of functionality as a result of a regression in the kernel psmouse driver — the touchpad is detected and works as a pointing device, but only functions with basic features. Scrolling, disabling tap-to-click, off when typing, and multi-touch (on supported devices) are some of the missing functionality. This appears to be the case with E5510, E6410, M6400, and other Dell (potentially all E2) and some non-Dell models.

From Simon Dierl:

Apparently, newer ALPS touchpads use a new, undocumented and unsupported protocol. The touchpad falls back to a legacy emulation mode, resulting in faulty detections. The bug lists some efforts to reverse-engineer the protocol and has some patches based on DELL contributions that enable ImPS/2 emulation (scrolling works). This, however, still does not allow for synaptics support (turn off when typing, horizontal scroll, etc.). Additionally, some people report problems on suspend/resume. [sic]

The best way to notice if you have a machine which is affected by this bug, is to go to System > Preferences > Mouse and look for a Touchpad tab. If it’s absent, you are probably affected by this bug.

Another way to see if you are affected by this bug is to run lsinput and look for something like the following:

bustype : BUS_I8042
vendor  : 0x2
product : 0x1
version : 0
name    : "PS/2 Generic Mouse"
phys    : "isa0060/serio1/input0"
bits ev : EV_SYN EV_KEY EV_REL

The above output shows the touchpad being identified and driven by the PS/2 driver.

This bug has been entered into Launchpad as bug #606238 and has its roots in Kernel bug #14660. Since it’s a mainline kernel bug, it’s likely to affect every Linux distribution. So far, it’s still a work-in-progress and there’s not been an accepted patch submitted to the Linux kernel team. There’s a discussion on that this is a regression, and this was working in older kernel versions.

The below is based on a patch from cmg238 which, at the very least, causes the kernel to correctly recognize the device as a touchpad and enable some missing functionality. I have made adjustments to the instructions for clarity and explanation.

Download kernel source (to /usr/src):

sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)
apt-get source linux-image-$(uname -r)

(Note: in Ubuntu Precise 12.04, do the following instead, based on this LaunchPad comment)

sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)
sudo git clone git://
cd linux
sudo git checkout origin/alps
sudo cp /boot/config-$(uname -r) .config

Also note that on Ubuntu Precise 12.04, you will be asked a bunch of additional questions at make-time. Accept the defaults, unless you have a reason to do otherwise.

Read about how to “undo” an apt-get build-dep and uninstall previously installed packages here.

Patch drivers/input/mouse/alps.c by locating alps_model_info and adding the additional line below, as follows:

static const struct alps_model_info alps_model_data[] = {
	{ { 0x73, 0x02, 0x64 }, 0xcf, 0xcf, ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Dell Latitude E6510 */

Compile psmouse.ko module

cd src/drivers/input/mouse
make -C /lib/modules/`uname -r`/build M=`pwd` psmouse.ko

(On Ubuntu Precise 12.04, use the following instead:)

cd /usr/src/linux/drivers/input/mouse
make -C /lib/modules/`uname -r`/build M=`pwd` psmouse.ko

The following steps will cause you to lose mouse functionality until the modprobe psmouse statement. Be prepared. Also, You may want to backup your existing /lib/modules/(kernel version)/kernel/drivers/input/mouse/psmouse.ko before doing this!

rmmod psmouse
cp psmouse.ko /lib/modules/`uname -r`/kernel/drivers/input/mouse/
modprobe psmouse

The last thing to mention is if you update your kernel you will receive the distributed psmouse.ko module. If the kernel does not include a fix for this bug you will need to follow the directions in this post again to recompile the above patch back into the kernel.

Since this is a mainline kernel issue, I would ask that any reader who is able to, please visit the links within this post and contribute where ever you can to help in getting this resolved. You are welcome and encouraged to share your thoughts and feedback in the comments below as well.

, , , , , , , , ,


Undo apt-get build-dep

When you want to compile something from source in Ubuntu/Debian, the easiest way to install the dependencies required to compile it is to run apt-get build-dep PACKAGE. Unfortunately, there is no built-in command to remove these dependencies. Thankfully, a discussion on Launchpad gives a good solution to this problem. Using this, you can “undo” an apt-get build-dep by running a single command. Note that this requires aptitude, so if you’re running Ubuntu 10.10, or you’ve removed aptitude, you’ll first need to install it using the following:

sudo apt-get install aptitude

Now, undo the apt-get build-dep:

sudo aptitude markauto $(apt-cache showsrc PACKAGE | grep Build-Depends | perl -p -e 's/(?:[[(].+?[])]|Build-Depends:|,||)//g')

Replace PACKAGE with the name of the package you’ve previously ran apt-get build-dep for, such as kernel or python2.5

After a few moments, the packages will be marked as automatically installed and you will either be prompted to remove them immediately, or you can remove them with the following command, which uninstalls all packages automatically installed but no longer needed:

sudo apt-get autoremove

Questions, comments, and feedback are welcome and appreciated.

, ,

Leave a comment

Upgrading Ubuntu and closed-source VirtualBox editions

If you’re using the closed-source version (the non-OSE) of VirtualBox for virtualization, upgrading your Ubuntu version will likely break your VirtualBox installation. This is because VirtualBox uses dkms to automatically pull in and recompile the kernel modules during a kernel upgrade, but when you upgrade your Ubuntu version, the third-party repository is disabled for compatibility.

What you need to do is re-add the repository line for VirtualBox in Synaptic. This is very easy. It’s important to understand that none of the steps listed here will harm your existing VMs — those files are located in ~/.virtualbox for older installs, and “~/VirtualBox VMs” (and the equivalent on Windows machines) in newer installs. You may want to consider backing those files up somewhere else before starting.

Assuming that your Ubuntu upgrade is already complete, you need to know the nickname for your Ubuntu version. This is easily found at System > About Ubuntu.

Once you’ve found that, simply re-add the correct repository line using the following steps:

Step 1 – Find your version

Go to the VirtualBox download page and find the repository line for your version of Ubuntu.

Although VirtualBox development is kept close to the Ubuntu release schedule, new repository lines may not be immediately available after a new Ubuntu release is launched. Simply check back to that page until they have posted the new repository.

Step 2 – Install dkms

This may be required for other programs, but you will want to make sure dkms is installed to keep the VirtualBox modules up to date after installation. Install dkms using your favorite package manager or enter the following command at a terminal:

sudo apt-get install dkms

(I noticed that VirtualBox 4 installs dkms as a dependency — previous versions may as well. It’s always best to play it safe.)

Step 3 – Enter the repository information in Synaptic Package Manager

Open Synaptic and follow the following menu trees to add the new repository line.

system > administration > synaptic package manager

settings > repositories

Click other software tab

Click add button

Paste your repository line that matches your version, found at the VirtualBox website, here.

Close and click reload.

Step 4 – Install VirtualBox

Now, install the virtualbox-4.0 (or the current version) using your favorite package manager, or enter this at a terminal:

sudo apt-get install virtualbox-4.0

If you experience issues with message related to no key, no signature, or bad signature, refer to the VirtualBox Linux Downloads page for information on resolving that. The messages are generally safe to ignore, though more cautious users may want to install the signing key to make sure the downloads have the correct digital signature.

Questions, comments, and feedback are welcome and appreciated.

, , ,

Leave a comment

CrashPlan : Troubleshooting real-time file backup on linux

CrashPlan on Linux depends on the inotify kernel module to know when files update in real-time.

Inotify was merged into the 2.6.13 Linux kernel, so if you’re running a kernel equal to or newer than this, it’s already installed. If not, you’ll have to install it yourself. If inotify is installed, you may need to increase the number of watches that can be created.

The inotify module is govered by a property called max_user_watches. If you attempt to exceed the max number you’ll get the following error in the engine_error.log (but the process lives on).

inotify_add_watch: No space left on device

Any file not covered by a watch does not have real-time backup protection.

The default on my Ubuntu 11.04 box is 524288, which seems plenty sufficient for me. I have not experienced any issues, but if you find that you are, you may want to increase the watch value.

Updating the Watch Value

You can temporarily update the value with:

echo 1048576 > /proc/sys/fs/inotify/max_user_watches

You can update the value permanently by putting the following value in /etc/sysctl.conf and restarting:


For more information, see CrashPlan’s Forums.

, , , , ,

1 Comment