Linux stuff

Linux / Fedora Core and nf_conntrack:

While testing and benchmarking some new features in Apache Traffic Server on my dev box, I started having really odd problems with inconsistently lost connections or really slow performance. Upon examing the logs, I found a large number of kernel barf like

Oct 29 11:53:51 loki kernel: nf_conntrack: table full, dropping packet.
Oct 29 11:53:51 loki kernel: nf_conntrack: table full, dropping packet.
Oct 29 11:53:51 loki kernel: nf_conntrack: table full, dropping packet.
Oct 29 11:53:51 loki kernel: nf_conntrack: table full, dropping packet.

Clearly this could not be good. I poked around, and could not find any ways to turn off this kernel module, at least on my Fedora Core 13 it seems compiled straight into the kernel (i.e. no .ko). There are ways to increase the table size (sysctl's) but that seemed like a band aid at best. Bummer. So, I went to the mountain (Noah F.) and asked for advice. After some poking around, we found that forcing iptables to ignore the conntracking helps, a lot. E.g.

iptables -t raw -I OUTPUT -j NOTRACK

 seems to do the trick for my particular case. This turns it off for all protocols, but you could probably limit it further (e.g. for tcp only with a "-p tcp" option). Also, you might want to do this on the input as well, e.g.

iptables -t raw -I PREROUTING -j NOTRACK

We found this old report against Fedora Core 10 as well, which describes the same problem, but no solution.


Modifying a Linux software RAID mirror

While upgrading my desktop to Fedora Core 12, I also decided to modify a software RAID mirror that I had on the old system. In particular, I wanted to do two things, without losing data:

  1. Change the partition layout, the old disks had partitions for OS and swap allocated to them, which I no longer needed. I know, LVM would have been nice here, but alas, I wasn't using it on this older box.
  2. I also wanted to upgrade to EXT4, and I've heard that upgrade process can potentially corrupt the entire disk (ask Bryan Call if you don't believe me).

So, since I'm using mirroring, I figure the "right" approach would be to just break the mirror, and do a migration safely that way. And of course, that does work, and there's plenty of information in the man-pages how to do this, but I figure I'll write down the steps I took so I can remember it myself (and maybe someone else finds it useful too).

The first step is to break the mirror, in my case, the RAID mirror is /dev/md2 using /dev/sdb and /dev/sdd, and then mount the broken mirror half on the file system:

# mdadm --manage /dev/md2 --fail /dev/sdb1
# mdadm --manage /dev/md2 --remove /dev/sdb1
# mkdir /mnt/old-data
# mount /dev/sdb1 /mnt/old-data

We now have a complete "copy" of the mirrored data, make sure /mnt/old-data (or whatever you named it) looks good. The next step is to get rid of the old RAID device, and create a new one. In my case, I need to run fdisk as well, to change the partition layout, but I'm not going into details here exactly what I did, since it's very specific to my setup.

# mdadm --stop /dev/md2
# fdisk /dev/sdd
# mdadm --create /dev/md0 --level 1 --raid-devices=2 missing /dev/sdd1

Finally, we can now create the new filesystem, and migrate the old data over to it:

# mke2fs -t ext4 -j /dev/md0
# mkdir /mnt/new-data
# mount /dev/md0 /mnt/new-data
# rsync -av /mnt/old-data/ /mnt/new-data

The final step is to add back the "old-data" partition into the new mirror, but before doing so, make sure the "new-data" looks alright.

# umount /mnt/old-data
# fdisk /dev/sdb
# mdadm --add /dev/md0 /dev/sdb1


That's it! Easy, and very little risk for lost data or corruptions.


Fedora Core 12 and focus follow mouse

For some unknown reasons (I'm guessing someone trying to be overzealous about what the Fedora users should do), FC12 no longer includes the control panel to modify the "Window" behavior. This includes the must-have feature of "Select windows when the mouse moves over them". But wait, no need to switch to Ubuntu quite yet, there's a simple fix to restore this control panel:

$ sudo yum install control-center-extra




Subscribe to RSS - Linux