Steven (unzeugmatic) wrote,
Steven
unzeugmatic

Those Clever, Clever Sysadmins

[This is all work stuff. No Morris dance. Nothing to see here, unless you're kazmat or pir or -- well you know who you are and so do I.]

A lot of my work has been stupidly dull lately, but today I had a wonderful moment of the geek giggles that came unexpectedly as I worked on what's really a tiny thing. This is the sort of thing that exasperates our developers ("What a mess!") but me, I just admire clever workarounds, once I understand all the background and I see just how clever the workaround is.

The exasperated developer calls this a workaround to a workaround.

So here's the deal: I'm documenting a clustered file system. Sometimes you need to "bind mount" the clustered file system (using the bind option of the mount command). A bind mount is -- well, let's just say it's a link you can't break and I know that's technically a fudge of a definition. So let's say you want to bind mount file system B onto file system A. That means file system A has to be mounted first. No prob, right? Just make sure the order is correct in the fstab file.

Well, no. The clustered file systems I document are mounted later in the initialization process than the other file systems. So if you want to bind mount a non-clustered file system onto a clustered file system you are out of luck. Ha ha. Call this a bug if you will -- it's what the exasperated developer meant by a mess -- but from my point of view I have to document how this works and what you should do.

And really what you should do is write a customized init script. Which I suppose is another ha-ha (yeah, right -- a customized init script for what should be a straightforward thing that by rights shouldn't trip you up anyway). But my job now is to document how to do that. Ok, that's another problem, but outside the realm of this note.

Because what this note is about is what people have been doing to get around this problem. It turns out there is a newish option to the mount command called _netdev, which indicates that the filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system). That's a direct quote from the man page. But glory be -- that means that these file systems (two words at my company, not one) get mounted even later in the initialization process than the clustered file systems. So if you want to bind mount a local file system onto a clustered file system, just tag that local filesystem with the _netdev flag! It's so elegant and simple.

And a completely absurd misuse of the _netdev flag. As the kindly developer who has asked me to document this wrote in the bug report, "this is not a good solution really and I'm not sure that we should encourage that at all."

Oh, this is so a LISA hottub moment.
Subscribe
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 29 comments