linux

eCryptfs Failure After Ubuntu Upgrade

I had my laptop halfway upgraded from Ubuntu 11.10 and 12.04 for a while. There was some reason for that which escapes me now, so I decided to complete the upgrade. So far only one issue has cropped up with an ecryptfs volume that I had created. It failed to mount with an error

Error attempting to evaluate mount options: [-22] Invalid argument

Based on a Redhat bug report I found, it looks like I need to SUID root /sbin/mount.ecryptfs.

tags: 

IPv6 Anycast

IPv6 has a neat feature called Duplicate Address Detection (DAD). When you add an IPv6 address to an interface, it checks to be sure that nobody else is already using that address. That's a Good Thing®. But if you're using IPv6 addresses for anycast and two (or more) devices are on the same subnet it can cause problems. The solution is to not put your anycasted addresses on the shared interface (e.g. eth0); rather, put them on the loopback interface.

tags: 

QLandekarteGT and Garmin Devices

I use QLandkarteGT on Linux to access my Garmin Venture HC GPS. All things considered, it works pretty well. I recently upgraded my computer to Ubuntu 12.04 and it stopped communicating with my GPS though, and I was very sad. The error was "Failed to download waypoints. Failed to configure USB: could not set config 1: Operation not permitted." After tinkering with it I remembered that the way I fixed it before was by setting qlandkartegt to run suid root.

tags: 

Create A Degraded RAID1 Array

Say you wanted to create a RAID1 device but didn't have all your devices ready. Here is how you could create a degraded RAID1 array and then add the second device at a later time. For these examples /dev/sda1 is the first device which will become our RAID and /dev/sdb1 will be added later.

First step is easy, create the RAID array. Our array will be /dev/md0. The "-n 1" option tells it that just a single device will be used and "-f" is required to use such a non-standard option.

$ mdadm --create /dev/md0 -l raid1 -f -n 1 /dev/sda1

tags: 

Asterisk Experiment: IPv6 and TCP

I couldn't tell you how long these features have been in Asterisk but I decided to give IPv6 and SIP/TCP a try in the latest 1.8 release. Basically it's a simple process. There are no special options required in the build, not that I could find anyway.

Once it's installed, there are two configuration options that need to be set. By default Asterisk will only listen on IPv4 and UDP so add these options in sip.conf:

tags: 

Using a /32 Netmask on Linux

Despite what some simple Googling might imply, it's entirely possible to use a /32 as a netmask for an IP address on Linux. The important detail is that it can't be the primary IP address. That primary can be an RFC1918 address (i.e. nonrouteable on the Internet) but your default gateway needs to be able to route to you via something other than the /32.

Here's the setup. Assume a Cisco router on 192.0.2.1/24 and a Linux server on 192.0.2.2/24. The /32 we'll use is 192.0.3.1/32.

On the server:

ip addr add dev eth0 192.0.2.2/24
ip addr add dev eth0 192.0.3.1/32

On the router:

interface FastEthernet0/1
ip address 192.0.2.1 255.255.255.0
ip route 192.0.3.1 255.255.255.255 192.0.2.2

At this point, you should be able to ping both 192.0.2.2 and 192.0.3.1 from the router.

The other step you may need to take is to add some routing on the Linux server to source from the 192.0.3.1 address. Normally traffic that is received on that IP will reply with that IP, so that's fine, but for new traffic if you want the source to be the /32, you'll need a special route:

ip route add 10.0.0.0/8 via 192.0.2.1 src 192.0.3.1

See, I told you it was easy.

tags: 

PhotoRec, The Savior of Lost Media

Like any good tool, Rsync can be easily used to destroy your life. In my case it was a typo on the destination directory and use of the "--delete" option. Just like that, my SD card was emptied. Luckily I didn't have too many files on there, as I only recently acquired it, but there I was thinking "boy I wish I had backups of that". The good news is, I found PhotoRec.

tags: 

Pages

Subscribe to RSS - linux Subscribe to zmonkey.org - All comments