When the Internet Leads You Astray – Trust the Source

AI internet linux unix

Putting a USB SSD on My Ubuntu Machine: A Journey Through Confusion

Recently, I decided to add a USB SSD to my Ubuntu machine. Pretty straightforward task, right? So, I set it up, partitioned it, and formatted it with an ext4 filesystem. Then came the question: What happens if the drive isn’t connected when I boot my system?

Since it’s an external drive and not critical to my system’s operation, I didn’t want my machine to throw a fit if the SSD wasn’t present at boot time. So naturally, I turned to GPT-4 for advice.

GPT-4’s Advice: The “nofail” Option

GPT-4 responded quickly and gave me a clear suggestion: use the nofail option in the /etc/fstab file. This would ensure that the system attempts to mount the USB drive if present but continues to boot even if the drive is not connected.

That made sense, and GPT-4 also reassured me that using this option for non-critical filesystems is common practice. But something bugged me. “nofail” sounded counterintuitive—shouldn’t this be used for important, “must mount” filesystems? So I turned to my trusty search engine to verify what exactly “defaults,nofail” meant.

The Internet Confusion Begins

I did a quick search using Kagi (or Google—take your pick, I got the same results). On the first page, I came across this page from Rackspace’s docs: Rackspace Docs on Linux – Nobootwait and Nofail.

It flat-out stated the opposite of what GPT-4 had told me! It described nofail as an option for critical filesystems, implying that the system would wait until the drive was mounted. This seemed strange since I wanted the system to boot even when the drive wasn’t there. This increased my doubts, so I dug deeper.

Deeper Dive – The Web Only Adds to the Confusion

I kept browsing, checking multiple sources. Each page seemed to explain nofail slightly differently. Some agreed with Rackspace, others said the opposite. At this point, I was more confused than when I started. How could such a basic option be so misunderstood on the web?

The Answer Was in the Man Pages All Along

Frustrated, I decided to check the man pages—the original source of truth for Linux users. Sure enough, GPT-4 was right. The nofail option is specifically there to ensure that the boot process does not stop or fail if the specified filesystem is not present. Perfect for my use case, as I wanted the system to keep booting even if the USB SSD was missing.

Conclusion: Crazy World We’re Living In

So here we are, in a world where search engines and online documentation can sometimes steer you in the wrong direction, while an AI (GPT-4) was spot on from the beginning. It’s crazy how something as fundamental as mounting a drive can be so muddled online.

I’ve learned two things from this: first, always double-check your sources—especially with something as complex as Linux configuration. And second, never underestimate the value of consulting the man pages. In this crazy, confused world of information overload, sometimes the simplest and most direct solution is the right one.

Oh, and yeah, nofail is exactly what you need for external drives that you don’t want to hold up your boot process. Crazy name? Maybe. But it does the job.

And, yes, this was written by gpt4o as well, based on the cryptic text

Intersting. 

putting USB SSD on ubuntu machine. 

Asking gpt4o what to do. Works. 

worried about this being external drive that boot would not stop when it is not there. So I ask, and it says should be fine, but to use “nofail” to be sure. 

I think: weird naming for option in open source. 

Use Kagi (or google, the same result) to look for “defaults,nofail meaning”

FIRST page 

https://docs.rackspace.com/docs/linux-nobootwait-nofail

says opposite of gpt4. 

I look further on the net. Confusion. Finally I look at the man page, 

gpt4o was right. The Internet as seen via search is plain wrong. 

Crazy world we are living in

dd unix CLI command taking a while? Just ask how it is doing …

linux misc

It turns that you can ask a running dd command how it is doing.

In the terminal that runs it simply enter a CTRL^T command.

The dd will react to the SIGINFO that this sinds with statistics of the running process.

Quiet handy since dd can take a while if you start it with a lower block size.

assemble images randomly

linux misc

Want to assemble images randomly into one? That’s easy in the command line if you have imagemagick installed:

Assuming you have all pictures in the current directory:

for i in *jpg ; do mv "$i" $RANDOM.jpg ; done

this renames all files ending in jpg into files that have a random number. Files might get overwritten should the random number come up again.

Assembling is as well:

montage *jpg -mode concatenate outputfilename.jpg

If you would run this again outputfilename.jpg would be a used as source image as well.

linux

When installing opendkim on a Centos 5.7 or 5.9 system following the wonderful howto by Steven Jenkins mail stops going out and the maillog shows:

May 23 12:55:53 her9 postfix/cleanup[4836]: warning: cannot receive milters via service cleanup socket socket
May 23 12:55:53 her9 postfix/smtpd[4832]: warning: premature end-of-input on public/cleanup socket while reading input attribute name
May 23 12:55:53 her9 postfix/smtpd[4832]: warning: cannot send milters to service public/cleanup socket
May 23 12:55:53 her9 postfix/smtpd[4832]: 8DBDB4D48004: client=localhost.localdomain[127.0.0.1]
May 23 12:55:53 her9 postfix/master[4824]: warning: process /usr/libexec/postfix/cleanup pid 4836 killed by signal 11
May 23 12:55:53 her9 postfix/master[4824]: warning: /usr/libexec/postfix/cleanup: bad command startup -- throttling

The syslog is even scarier:

May 23 12:55:53 her9 kernel: cleanup[4836]: segfault at 0000000000000008 rip 00002b152350db10 rsp 00007fff855746e8 error 6

Yes, a segfault. Things work better when SELinux gets disabled.
Without going deeply into the reason of this incompatibility the following commands make opendkim work while SELinux is still active.

This command will show you what did cause trouble today, and convert it already in to the syntax for an ‘allow’:

ausearch -m avc -ts today | audit2allow


If what you see is indeed only about opendkim you then can go ahead and install this:
ausearch -m avc -ts today | audit2allow -M yourdesiredmodulename
semodule -i yourdesiredmodulename.pp

Things work much better then.

The Centos SELinux How To is a helpful resource for this kind of thing.

infinite sar display – neat option

history linux technology

wanting watch sar run in a terminal in linux indefinitely one can start it with


sar 1 0

The first number indicates the sampling time in seconds. The second number is usually the number of samples you like ot see.

If this number is 0 then sar will not stop. And as another bonus will look at how large the terminal is and will display a new header
accordingly.

Command line can be user friendly. I really like those little gems that show up in all software: People spending their time to make something better. It is like a little gift to the world. With software the value of even a little detail can potentially be significant. Which is an awesome thing.

For all we know it might very well be that the feature described here will please people in a hundred years from now.

I don’t think that mankind will manage to drop unix at this point. Neither can it give up on the use of steel. Yes there might be new systems, much like there have been new materials.

The new gets all the attention. But in many cases the new will not replace the old entirely. Only journalists tend to think that way. In reality the findings of Mr Newton help Boeing and Airbus today to build tubes with wings that shuttle people around the globe close to the sound of speed.

hfs dmg files in Centos

Apple linux

In Centos 5.7 mounting dmg files created under OS X 10.6 with hdiutil no longer worked:

mount  -t hfsplus -o loop dmgFileFromOSX10.6.dmg  /mountpoint

results in

mount: wrong fs type, bad option, bad superblock on /dev/loop0,
 

Without having researched it I doubt that it is the actual Centos Version that matters here.

The dmg has been created under OS X 10.6 in the terminal via:

hdiutil create -size 1024k dmgFileFromOSX10.6.dmg -fs HFS+ -volname 'test dmg'

DMG creation in the command line is a work around for the (arbritrary?) minimum size requirements of the Disk Utility program of 5.2MB and 10.1MB.

It turns out that a dmg file created with the same command line in OS X 10.4 ( on a G4 machine ) works fine. On which side 10.5 falls we did not test.

centos source install wget 1.13 and GNUTLS

linux

installing wget 1.13 from source on Centos 5.7 the configure command was not happy:

checking for main in -lgnutls... no
configure: error: --with-ssl was given, but GNUTLS is not available.

It turns out the solution is simple:

./configure --with-ssl=openssl

did the trick.

At first I thought that a “yum install gnutls-devel” might help. The ./configure part indeed finished after the install of the developer package, but the actual make still failed:

gnutls.o: In function `ssl_connect_wget':
gnutls.c:(.text+0x3f1): undefined reference to `gnutls_priority_set_direct'
gnutls.c:(.text+0x481): undefined reference to `gnutls_priority_set_direct'
collect2: ld returned 1 exit status

Configuring with the openssl option made everything work very smoothly …

mail me later

internet linux

I really like email. It works well for me. One thing that I grew accustomed to was the abillity to postpone email. To set up quick reminders easily. I used ‘replylater.com’ for this. Unfortunately last month they stopped working for me.

I decided to just implement the same features myself: Mail Me Later works pretty much like replyater.com.

The ‘problem’ is, that once a tool works for me I completely start to rely on it. Having a topic delegated to a service like ‘mail me later’ means that I will entirely forget about it. Good since it saves hassle, really bad if that service fails.

Having this part of me workflow now in an environment where I can quickly verify its operation makes me very happy.

libavcodec.so: undefined reference to `x264_encoder_open_104′

linux

A recent svn checkout on a Centos 5.5 x86_64 of ffmpeg refused to link. It complained:


libavcodec.so: undefined reference to `x264_encoder_open_104'

The fix was as simple as


LD_LIBRARY_PATH=/usr/lib
export LD_LIBRARY_PATH

before ./configure. In a weird way it makes even sense.

ldap_sasl_bind(SIMPLE): Can’t contact LDAP server (-1)

linux

On a centos machine ldapsearch was not giving me much love when accessing a Microsoft Global directory server via ldaps and a given port. The error message I got was:


ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

When turning up debug level via -d 1 as in


ldapsearch -d 1 -v -H ldaps://servername:portnumber

I got the bit more revealing error message:


TLS certificate verification: Error, unable to get local issuer certificate
TLS trace: SSL3 alert write:fatal:unknown CA
TLS trace: SSL_connect:error in SSLv3 read server certificate B
TLS trace: SSL_connect:error in SSLv3 read server certificate B
TLS: can't connect: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (unable to get local issuer certificate).

It turns out that a simple line like


TLS_REQCERT never

in ldap.conf makes things better. In my particular install a simple ‘locate ldap.conf’ was a bit misleading. The true location of your config file can be revealed via:


strace ldapsearch -v -H ldaps://servername:portnumber 2>&1 | grep ldap.conf