Monday, August 30, 2010

First impressions of ext4 with large file deletion

I've been using ext3 for a long time on my CentOS servers, but ext3 has one big flaw that has constantly affected me.  It takes forever and a day in order to delete large files.

On my home server, I have a very large array where I put raw video files prior to conversion into compressed/lossy formats.  This works well, but then when I go to clean off the multi-gigabyte raw files it will take 5-10 minutes to delete a few dozen gigabytes of data.  So I've been putting up with for a long time this way.

Fast forward to 2010, and ext4 is finally close to production ready in CentOS 5.5.  (It may even already be marked as production-ready...)  I switched that scratch space over to ext4 last week and it's performing admirably.  Much better performance when deleting large multi-gigabyte files.  Which helps the system not feel so slow while it's doing that delete.

I probably won't use ext4 for my primary volumes quite yet.  I still plan on leaving /home, / (root), /var, /boot as ext3 (ext2 for /boot), but I will probably put the larger user data file systems as ext4 from now on.  It's enough of a step forward to be worth it (and ext4 is pretty stable now).

Monday, August 02, 2010

Changing "ls" color so that directories don't show up in dark blue

One of the annoyances with Linux if you're using a color terminal (or a color terminal emulator like SecureCRT or PuTTY) is that the "ls" (list directory contents) command has a default of dark blue for directory entries.  Which is fine if you're using a white background, but doesn't work well if you prefer an old-school black background for your terminal.

Fortunately, this is configurable with the LSCOLORS environment variable.  The default string is "exfxcxdxbxegedabagacad" for OS X.  However, on Linux, it looks more like you may be able to configure this using /etc/DIR_COLORS instead.

On my CentOS 5.4 machines, DIR_COLORS lists the entry for directories as "DIR 01;34", which means that it uses a bold blue on the default background.  One option to ensure a bit more contrast would be to change this to always print on a white background.  So you would change this entry to look like:

DIR 01;34;47 # NEW default is Bold blue with White background

References:

change ls colour (color) in bash - GlowingApple  explains back in 2005 how to change colors on the MacOSXHints forum

COLORS Lscolors - another page that explains the LSCOLORS variable