SSD TRIM/discard on Fedora 17 with encypted partitions

July 4th, 2012

I have not blogged for a while, now that I am on summer holiday and got a new laptop I finally have something to blog about. I got a Thinkpad T430 and installed a Samsung SSD 830 myself. The 830 is not actually the best choice for a Linux user because you can only download firmware updates with a Windows tool. The tool does let you make a bootable FreeDOS USB disk with which you can apply the update, so you can use a Windows system to download the update and apply it just fine on a Linux system. The reason I got this SSD is that it is 7 mm in height and fits into the T430 without removing any spacers.

I installed Fedora 17 on the laptop and selected drive encryption in the Anaconda installer. I used ext4 and did not use LVM, I do not think it would be of much use on a laptop. After the installation I discovered that Fedora 17 does not enable SSD TRIM/discard automatically. That is probably a good default, apparently all SSDs do not support it. When you have ext4 partitions encrypted with LUKS as Anaconda does it, you need to change two files and regenerate your initramfs to enable TRIM.

First, edit your /etc/fstab and add discard to each ext4 mount. Here is an example of my root mount:
/dev/mapper/luks-secret-id-here / ext4 defaults,discard 1 1

Second, edit your /etc/crypttab and add allow-discards to each line to allow the dmcrypt layer to pass TRIM requests to the disk. Here is an example:
luks-secret-id-here UUID=uuid-here none allow-discards

You need at least dracut-018-78.git20120622.fc17 for this to work, which you should already have on an up-to-date Fedora 17.

Third, regenerate your initramfs by doing dracut -f. You may want to take a backup of the old initramfs file in /boot but then again, real hackers do not make backups ;) .

Fourth, reboot and check with cryptsetup status luks-secret-id-here and mount that your file systems actually use discard now.

Please note that apparently enabling TRIM on encrypted file systems may reveal unencrypted data.

Getting Hauppauge WinTV-Nova-TD-500 working with VDR 1.6.0 and Fedora 16

October 29th, 2011

The Hauppauge WinTV-Nova-TD-500 is a nice dual tuner DVB-T PCI card (well, actually it’s a PCI-USB thing and the system sees it as a USB device). It works out-of-the-box with the upcoming Fedora 16. It needs a firmware, but that’s available by default in the linux-firmware package.

However, when using the Nova-TD-500 with VDR a couple of settings need to be tweaked or the signal will eventually disappear for some reason. The logs (typically /var/log/messages in Fedora) will have something like this in them:
vdr: [pidnumber] PES packet shortened to n bytes (expected: m bytes)
Maybe the drivers or the firmware have a bug which is only triggered by VDR. This problem can be fixed by tweaking VDR’s EPG scanning settings. I’ll post the settings here in case someone is experiencing the same problems. These go into /etc/vdr/setup.conf in Fedora:


EPGBugfixLevel = 0
EPGLinger = 0
EPGScanTimeout = 0

It is my understanding that these settings will disable all EPG scanning which is done in the background and VDR will only scan the EPGs of the channels on the transmitters it is currently tuned to. In Finland, most of the interesting free-to-air channels are on two transmitters and the Nova-TD-500 has two tuners, so in practice this should not cause much problems with outdated EPG data.

The Linux/FLOSS Booth at Assembly Summer 2011

August 6th, 2011

The Assembly Summer 2011 demo party / computer festival is happening this weekend in Helsinki, Finland. The Linux/FLOSS booth here is organized together by Finnish Linux User Group, Ubuntu Finland, MeeGo Network Finland and, of course, Fedora. I’m here representing Fedora as a Fedora Ambassador and handing out Fedora DVDs. Here are a couple of pictures of the booth.

The booth is mostly Ubuntu-coloured because most of the people here are members of Ubuntu Finland and Ubuntu in general has a large community in Finland. In addition to live CDs/DVDs, the MeeGo people also brought two tablets running MeeGo (I think they are both ExoPCs) and a few Nokia N950s. They are also handing out MeeGo t-shirts.

People seem to like the new multi-desktop, multi-architecture live DVDs that the European Ambassadors have produced. I think they are a great idea and worth the extra cost compared to the traditional live CDs.

Running Linux on a Lenovo Ideapad S12, part 2

January 3rd, 2011

Here’s the first post of what seems to be a series of posts now.

acer-wmi

I wrote about acer-wmi being loaded on this netbook to the kernel’s platform-driver-x86 mailing list. That resulted in Chun-Yi Lee writing a patch which adds the S12 to the acer-wmi blacklist. Here’s the bug report.

ideapad-laptop

I did a bit of googling on the ideapad-laptop module and noticed that Ike Panhc had written a series of patches which enable a few more of the Fn keys on the S12. The git repository for those patches is here. Those patches are also in linux-next already.

So, I cloned Linus’ master git tree, applied the acer-wmi patch and then git pulled Ike’s repo. Then I followed these instructions, expect that now Fedora’s sources are in git, so you need to do something like fedpkg co kernel;cd kernel;fedpkg prep and then find the suitable config file for you. Now I have a kernel which works pretty well on this system, except for the scheduling/sleep issue mentioned in the previous post.

Running Linux (Fedora) on a Lenovo Ideapad S12

December 27th, 2010

I got a Lenovo Ideapad S12 netbook (the version which has Intel’s CPU and GPU) a few months ago. It requires a couple of quirks to work with Linux, I’ll write about them here, in case they’ll be useful to someone else as well.

Wireless

The netbook has a “Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)” wifi chip. It works with the “b43″ open source driver, which is in the kernel. However, I think that it may not actually reach the speeds it should. You could also use the proprietary “wl” kernel module, available in RPM Fusion as “kmod-wl”, but I don’t like to use closed source drivers myself.

The b43 driver needs the proprietary firmware from Broadcom to work with the 4312 chip. Following these instructions should get you the firmware.

Kernel

The kernel needs the “nolapic_timer” parameter to work well with the netbook. If that parameter is not used, it seems like the netbook will easily sleep a bit too deep. Initially people thought that the problem was in the “intel_idle” driver, the whole thing is discussed in this bug report. However, according to my testing, the problem with intel_idle was fixed, but the netbook still has problems, they are just a bit more subtle. The netbook boots fine, but when playing music, the system will easily start playing the same sample over and over again, if the keyboard or the mouse are not being used for a while. Apparently the system enters some sort of sleeping state. I built a vanilla kernel without intel_idle and I’m seeing this problem with it as well.

Then there’s “acer-wmi”. The module gets loaded by the kernel and in older versions it was probably somewhat necessary, because it handled the wifi/bluetooth hardware killswitch. It causes problems with NetworkManager, though. It disables the wifi chip on boot and you have to enable wifi from the NetworkManager applet by hand. Here’s my bug report, which hasn’t gotten any attention, but then again, I may have filed it under the wrong component. Anyway, in the 2.6.37 series of kernels there is the “ideapad_laptop” module, which apparently handles the hardware killswitch, so acer-wmi shouldn’t be needed any more and can be blacklisted.

The Linux booth at Assembly 2010

August 6th, 2010

I’m spending the weekend at Assembly 2010, which is a demo party organized in Helsinki. The Finnish Linux User Group has organized a booth for the different Linux distributions. This year Ubuntu and Fedora are represented and I’m here as a Fedora Ambassador, of course.

We’ve had quite a lot of people visiting the booth during these first two days and have handed out lots of Fedora and Ubuntu CDs. People haven’t really come to the booth complaining about problems with Linux, which I think means desktop Linux is simple enough to use for those kind of people, who attend events like these. The first time I was at the booth on 2008 we had more people coming to us for help with driver issues and things like that.

While talking with people who came by to take Fedora CDs from the booth, I noticed a couple of issues with the current CD covers.

  • ‘Desktop Live Media’ versus ‘KDE Desktop Live Media’ is confusing and I think the ‘Desktop’ disk should say ‘GNOME’ somewhere on the cover.
  • Some people seem to think ‘Live Media’ as something that’s not installable. I noticed the Ubuntu disks say nothing about being ‘Live Media’, just that they’re ‘Desktop Editions’.

I sent an email about these thing to the Ambassadors list.

On a positive note, people also seem to think that the Fedora disk covers look nicer than the Ubuntu ones :)

I’ll attach some pictures of the booth as well:

The booth

The booth, notice our free software banner with Tux on it :)

The computers

The computer on the left is running Unigine Heaven (yes, with the closed source nVidia driver...) on Fedora and the computer on the right is showing Big Bug Bunny on Ubuntu.

People at the booth

People at the booth

The disks with a couple of Tuxes

The disks with a couple of Tuxes

Edit: One final thing: Thanks to Assembly Organizing for providing us with the booth space!

Headed for Akademy

July 3rd, 2010

I’ll be taking the 07:30 AM train from Helsinki to Tampere today. The train should arrive at Tampere at around nine, which leaves me about thirty minutes to get from the train station to the university. I think microblogging is perfectly suited for writing short updates from a conference, so here’s a shameless plug: my identi.ca profile is at http://identi.ca/vpv. I’ll try to dent every now and then, depending of course a bit on how the network at the venue and at the hotel works.

I’m going to Akademy 2010

June 28th, 2010

I haven’t been blogging in a long while, I hope this post will still make it into Planet Fedora and Planet Libre Finland.

So, I’m going to Akademy 2010 on next Saturday. I’m not that much of a KDE contributor, I’ve done some translations and bug reports, but that’s all. As Akademy is probably the biggest Free Software event organized in Finland so far, I still decided to attend. Hotel rooms at Tampere aren’t exactly cheap, which is why I’ll only be there for the conference weekend. The Nokia Qt thing on Monday sounds interesting, though, so maybe I’ll either try booking an extra hotel night or just take a train for the day to Tampere.

If any other Fedora contributors are attending Akademy, maybe we could meet up?

Fedora 12 Beta and ATI Radeon HD 3450: pcie_asm=off or nomodeset needed

October 23rd, 2009

In my previous post I wrote about BIOS problems with Fedora 12 and the Intel DP35DP motherboard. Sadly the problems didn’t stop there, I also had display problems with Fedora 12 Beta.

My desktop computer has an ATI Radeon HD 3450 video card, which apparently has an RV620 chip. Fedora 12 has kernel modesetting (KMS) support for Radeon R600/R700 chips and the Plymouth boot looked quite nice. After using the system for about a minute, the display went to power saving mode, just like that, on it’s own. I rebooted a couple of times with the same results, the system was pretty much unusable. I disabled KMS by adding the nomodeset parameter to the kernel line in /etc/grub.conf and now the system works like pretty much perfectly, apart from the missing graphical boot experience, of course ;) . It seems R600/R700 KMS is still a bit buggy, but hey, this is a Beta version anyway.

Edit: I can also get the system to work with the pcie_asm=off kernel parameter. This might be the same situation as in the bug 517625.

Fedora 12 Beta / Linux 2.6.31.5-rc1: Intel DP35DP mainboard requires BIOS update

October 23rd, 2009

I updated my desktop computer to Fedora 12 Beta, or maybe I should say Rawhide because there are already lots of updated packages after the Beta release.

The computer has the Intel DP35DP motherboard. When I tried to boot the Fedora 12 Beta kernel, which is 2.6.31.something, can’t remember the exact version anymore, the kernel printed lots of iommu and usb error messages on the screen and USB didn’t seem to work at all. The motherboard doesn’t have any PS/2 ports, so I would have needed USB support to use the keyboard and the mouse.

I downloaded the latest Fedora 12 and Fedora 11 kernels on my laptop from Koji, put the packages on a USB stick, booted the desktop computer with the Fedora 11 DVD in a rescue mode and installed the kernels to the system. Even the newest Fedora 12 kernel (2.6.31.5-rc1 based) had problems, but the newest Fedora 11 kernel (2.6.30.9-rc3 based) worked, which was a win.

Now I was able to read the logs written while the kernel failure happened, which included stuff like this:


kernel: DMAR:Host address width 36
kernel: DMAR:DRHD base: 0x000000feb00000 flags: 0x0
kernel: ------------[ cut here ]------------
kernel: WARNING: at drivers/pci/dmar.c:642 alloc_iommu+0x12c/0x286() (Not tainted)
kernel: Hardware name:
kernel: Your BIOS is broken; DMAR reported at address feb00000 returns all ones!
kernel: BIOS vendor: Intel Corp.; Ver: DPP3510J.86A.0293.2007.1002.1519; Product Version:
kernel: Modules linked in:
kernel: Pid: 1, comm: swapper Not tainted 2.6.31.1-56.fc12.x86_64 #1
kernel: Call Trace:
kernel: [] warn_slowpath_common+0x95/0xc3
kernel: [] warn_slowpath_fmt+0x50/0x66
kernel: [] alloc_iommu+0x12c/0x286
kernel: [] ? dmar_table_init+0x178/0x3d7
kernel: [] dmar_table_init+0x1ee/0x3d7
kernel: [] ? task_rq_unlock+0x24/0x3a
kernel: [] enable_IR_x2apic+0x21/0x218
kernel: [] native_smp_prepare_cpus+0x13c/0x384
kernel: [] kernel_init+0x93/0x29b
kernel: [] child_rip+0xa/0x20
kernel: [] ? restore_args+0x0/0x30
kernel: [] ? kernel_init+0x0/0x29b
kernel: [] ? child_rip+0x0/0x20
kernel: ---[ end trace a7919e7f17c0a725 ]---
kernel: DMAR:parse DMAR table failure.

The rest of the log was filled with entries such as
kernel: nommu_map_single: overflow 1236419b0+8 of device mask ffffffff
and
kernel: usb 3-1: device not accepting address 5, error -32
kernel: hub 3-0:1.0: unable to enumerate USB device on port 1

At least the error message was clear, “Your BIOS is broken”. So I went to the motherboard’s product page and found out the BIOS on the motherboard was about two years old and the newest available BIOS is from July this year.

I tried updating the BIOS with Intel’s Windows tool (I also have a Windows installation), but that just shut down the system without performing the update. Next I tried their Linux-based BIOS update boot CD, but it had the same effect, the system shut down, no BIOS update.

With a bit of googling I found the instructions for doing a recovery BIOS update, which means removing the BIOS jumper from the motherboard and booting the computer with a FAT formatted USB stick containing the BIOS file attached. This finally succeeded and the motherboard now has the newest BIOS. With it, the new kernel boots just fine :)

After all this rambling, the main point I want to say is: If you have an Intel DP35DP motherboard and Fedora 12 has USB problems, update the BIOS. You may have to do that with the recovery method, if nothing else works.

Edit: As far as I can tell, bug 524808 is about the same issue. It seems like the developers are planning a workaround, but a BIOS which behaves this way is apparently really broken, so you probably should just update it anyway.

Edit 2: This was asked about in the comment section, the original BIOS my motherboard had was DPP3510J.86A.0293.2007.1002.1519 and the new one is DPP3510J.86A.0572.2009.0715.2346.

Edit 3: Chuck Ebbert mentions in the bug report that adding iommu=soft to the kernel parameters will disable the Intel IOMMU, which should work around this problem and let your system boot even with an older BIOS.