Disk space

I was asked to take a look at a server that was no longer responding. The first thing I did after going to the co-lo and booting the console in single user repair mode was look at disk usage.


$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1             70557052  70557052         0 100% /
none                    508792       224    508568   1% /dev
none                    513040         0    513040   0% /dev/shm
none                    513040      1076    511964   1% /var/run
none                    513040         0    513040   0% /var/lock
none                    513040         0    513040   0% /lib/init/rw
/dev/sdb1             70557052  46954944  20018012  71% /media/Backup

As you can see the server usage went to 100%. Normally it is near the size of the hot backup drive. So some file suddenly got large. When this happens, none of the services will respond. So you can’t ssh in and the websites stop responding.

Then I started looking for files that could be causing the problem. I was told that the last time this happened the log files weren’t being erased. I check on this server from time to time and this week it was at 82%, so that didn’t seem likely but I ran this command anyway.


sudo find /var/log/ -size +20M | xargs du | sort -n -r | less

Nothing really jumped out at me but there were lots of old logs that had been zipped, and some that were labelled ‘old’, so I ran this to get rid of them

rm *.gz
rm *.old

It made a little improvement, but not enough to get the df command to go below 100%. It did go to 68852672 which was enough to get ssh into the server after a reboot. I kept looking for the source of the large files but had no luck. We have a call in to the guy who fixed it last time hoping he remembers what he did.

Lou Buys A Computer

Costello calls to buy a computer from Abbott

ABBOTT: Super Duper computer store. Can I help you?

COSTELLO: Thanks I’m setting up an office in my den and I’m thinking about buying a computer.

ABBOTT: Mac?

COSTELLO: No, the name’s Lou.

ABBOTT: Your computer?

COSTELLO: I don’t own a computer. I want to buy one.

ABBOTT: Mac?

COSTELLO: I told you, my name’s Lou.

ABBOTT: What about Windows?

COSTELLO: Why? Will it get stuffy in here?

ABBOTT: Do you want a computer with Windows?

COSTELLO: I don’t know. What will I see when I look at the windows?

ABBOTT: Wallpaper.

COSTELLO: Never mind the windows. I need a computer and software.

ABBOTT: Software for Windows?

COSTELLO: No. On the computer! I need something I can use to write proposals, track expenses and run my business. What do you have?

ABBOTT: Office.

COSTELLO: Yeah, for my office. Can you recommend anything?

ABBOTT: I just did.

COSTELLO: You just did what?

ABBOTT: Recommend something.

COSTELLO: You recommended something?

ABBOTT: Yes.

COSTELLO: For my office?

ABBOTT: Yes.

COSTELLO: OK, what did you recommend for my office?

ABBOTT: Office.

COSTELLO: Yes, for my office!

ABBOTT: I recommend Office with Windows.

COSTELLO: I already have an office with windows! OK, let’s just say I’m sitting at my computer and I want to type a proposal. What do I need?

ABBOTT: Word.

COSTELLO: What word?

ABBOTT: Word in Office.

COSTELLO: The only word in office is office.

ABBOTT: The Word in Office for Windows.

COSTELLO: Which word in office for windows?

ABBOTT: The Word you get when you click the blue ‘W’.

COSTELLO: I’m going to click your blue ‘W’ if you don’t start with some straight answers. What about financial bookkeeping? Do you have anything I can track my money with?

ABBOTT: Money.

COSTELLO: That’s right. What do you have?

ABBOTT: Money.

COSTELLO: I need money to track my money?

ABBOTT: It comes bundled with your computer.

COSTELLO: What’s bundled with my computer?

ABBOTT: Money.

COSTELLO: Money comes with my computer?

ABBOTT: Yes. At no extra charge.

COSTELLO: I get a bundle of money with my computer? How much?

ABBOTT: One copy.

COSTELLO: Isn’t it illegal to copy money?

ABBOTT: Microsoft gave us a license to copy Money.

COSTELLO: They can give you a license to copy money?

ABBOTT: Why not? THEY OWN IT !

(A few days later)

ABBOTT: Super Duper computer store. Can I help you?

COSTELLO: How do I turn my computer off?

ABBOTT: Click on ‘START’.

Google Calendar Data Not Displaying

I use Google Calendar to display the availability status of an airplane that I share with four others. About a month ago, the web page with the embedded calendar stopped displaying events. I also noticed that events don’t show up on other calendars e.g. the local high school’s vacation schedule.

It took a while to figure out what they broke, but it looks like you can’t view events on embedded calendars unless you are logged in with a Google account. Since I don’t use Google on Safari, they won’t let me view my events. When I open the page on Chrome, where I am logged in, I can view calendars. So now you know.

SPF Record

Gmail has started bouncing my order confirmation emails so I need to start using some of the anti-spam indicators. One of them is an SPF record. Since I use Linode, there is a tab that lets me create the record. Deciding what to put in it is a bit complicated, but not too bad.

You can create a very simple SPF record or more detailed. I chose to get a little detailed in hopes that it would satisfy Google. You can find details of all the parameters at OpenSPF or Wikipedia.

The simplest record just says to allow all mail from the domain if there is a mail record in the DNS.


example.com  text = "v=spf1 mx ~all"

To see what an SPF record looks like, open the terminal and type the following


nslookup -type=txt Google.com

Your response should look like this:


google.com  text = "v=spf1 include:_spf.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all"

If you are using a Linode VPS, mail is sent using IPV6 so you also need an ip6 record. Linode itself uses MailChimp, so their SPF record is:


linode.com  text = "v=spf1 mx include:servers.mcsv.net ~all"

In my case, I set up my SPF record to include charter.net, since I also mail from the office and both my IPV4 and IPV6 address. In the Linode control panel, the data between the quotes is pasted into the form and Linode takes care of creating the record.

all mail servers must have a PTR record with a valid Reverse DNS entry

After we moved from our own server to Linode I started getting these bounce messages from Comcast. Reverse DNS just means that if you have an IP address you can find the domain associated with it. In my case I have lots of domains at the same IP address but use one for sending mail. I didn’t know what a PTR record is so I looked it up. Wikipedia says that “IPv4 uses the in-addr.arpa domain and the ip6.arpa domain is delegated for IPv6. The process of reverse resolving an IP address uses the pointer DNS record type (PTR record).”

On our old server we did our own DNS hosting and all of the info was contained in a file. So I knew about MX records, A records, etc. Linode uses a control panel to do the DNS setup so the setup is a bit different, but the same info is there. I had an A record for the domain that was sending the email, mail.machinename.com, and one for the domain that the email was coming from i.e. support@mycompany.com.

I checked with intoDNS to make sure that everything was set up correctly and I did in fact have a PTR record that pointed to the right place. “Your reverse (PTR) record: 192.168.255.173.in-addr.arpa -> mycompany.com”.

The clue came in a bounce from a different domain. The message said that the reverse DNS for 2500:34e80::f03c:92ee:fg70:ab93 was not found. It turns out that this is an IPv6 address. It appears that Linode is using an IPv6 address for the port I send mail from. To get a reverse DNS set up for that address I needed to set up an AAAA record in the Linode control panel, wait a while for it to propagate to Linode’s DNS servers, then set up reverse DNS for the IPv6 address.

I waited a day for the change to propagate and now my Comcast emails are going through fine.