too smart for it’s own good, can’t format a USB drive, device is busy error

One of those simple things that you assumed will work but you hit a snag on the last minute.

Last week, we’re on the process of exporting a few virtual machine images and database data for a proof-of-concept/benchmarking activity with a partner. The data is ready, all that needs to be done is copy it over a USB HDD.

The disk was already partitioned using parted, next step is to format it.

$ mkfs.ext4 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
/dev/sdb1 is mounted; will not make a filesystem here!

We’re dumbfounded on why this fails. We didn’t mount the filesystem!

After a few minutes of googling around and figuring out what /dev/dm-X, we stumbled on this article

These simple steps is just what we need to do:
$ multipath -ll
$ multipath -f XXXXXXXXXXXXX

Thanks for nothing multipath!

Update: The PG (porch grass) project

This is just an update for the gardening project that me and wife June started about 2 years ago. Last 2018, we attended EdCon in Tagaytay and we grabbed the chance to buy some plants:

Screen Shot 2019-07-23 at 6.49.58 AM

It’s safe to say that my wife got carried away a bit… We had those transplanted to the porch. Some of them died but most of them thrived.

This is our porch now:

hdrpl

The PG (porch grass) project

One of the things that I love to do is doing “small” projects together with my wife June. Our latest project is the extension of our porch and converting it into a small garden.

The original plan was to make this a concrete floor. I’m blissful that we changed it into a mini garden — It’s a lot cooler.

After the masonry works, it looked like this:

IMG_3980

The next step is to get some garden soil and grass. We looked for a garden supply store within our area and we found Halina’s Garden.

I sent them a message in FB and SMS to inquire and they’re very responsive. We ended up getting the following:

  • 10 sacks of Bermuda grass (P120 / sack)
  • 6 sacks of garden soil (P90 / sack)

We originally ordered Bluegrass but we’re surprised that in our local jargon, Bluegrass is also defined as Bermuda grass. Oh well, it’s OK. It’s grass 🙂

We had to wait for a few days since they have to complete a minimum order of 20 sacks of grass before they order it from their supplier. We ordered it last Saturday and we picked it up the following Wednesday.

IMG_4036

So, the work of replanting begins. My wife and I started around 4:30PM and we finished around 8PM – this could have been done half the time if our kids didn’t “help” 🙂

But we figured that this is the only way our kids will develop interests in gardening  so we welcomed the “help”. June and I just had to stretch our patience a little bit more… 😀

Picture this: Try replanting grass with toy trucks and dozers zooming around you… 🙂

The next morning, it looked like this:

IMG_11045614CF54-1

It’s all worth it. It’s such a blessing for a view.

 

Every good thing given and every perfect gift is from above, coming down from the Father of lights, with whom there is no variation or shifting shadow.

James 1:17 (NASB)

 

Can’t locate Perl module File/Slurp.pm in Opsview 5.2.1.163061249

I’ve been seeing these errors in our Opsview 5.2.1.163061249 installation:

Can't locate File/Slurp.pm in @INC (@INC contains: /usr/local/nagios/bin/../lib /usr/local/nagios/bin/../etc /usr/local/nagios/bin/../perl/lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/nagios/bin/../lib/Opsview/Run.pm line 23.

These errors were generated by one particular crontab job:

/usr/local/nagios/bin/exec_and_log

I was able to install File::Slurp module through yum…

yum install -y perl-File-Slurp.noarch

Then, it’s asking for another module… “IPC::Run”

yum install -y perl-IPC-Run.noarch

Then, it’s asking for another module… “IPC::Run::SafeHandles”. But since there are no RPM packages for this, I am forced to do this the perl way… CPAN.

yum install -y perl-CPAN.x86_64

And then installed cpanm right after (as recommended here)

cpan App::cpanminus

Retrying the installation of “IPC::Run::SafeHandles”

cpanm IPC::Run::SafeHandles

Then, I’m stuck… The module IPC::Run::SafeHandles won’t install because it requires “List::MoreUtils::XS”. Which I cannot install because of an error with this unhelpful message:
Screen Shot 2017-08-23 at 1.41.54 PM

I did a few a google search about the module and I stumbled on this exciting discussion.

Hmmmm…. PUREPERL… maybe I need to invoke this via cpanm. Browsing through cpanm’s manual, it has a a –pp option for pure Perl.

cpanm --pp IPC::Run::SafeHandles

It installed without a hitch! 🙂

But as for the Opsview script, it still required 2 more modules:

yum install perl-Proc-Simple
yum install perl-Log-Log4perl

Now I have to find out what caused these Perl modules to be gone missing in the first place…

[Puppet] fixing mod_passenger: Cannot connect to Unix socket – Permission denied in a hardened AWS Linux 2014.09

As I’ve shared in my previous post, I was working on hardening AWS Linux 2014.09 using Puppet. I got that finished and I’ll probably improve the class in the future to make it easier to manage.

The first thing you’ll realize when you harden a system is this: it will break stuff… No, I’m not talking about the small stuffs, I’m talking about major applications that you rely on.

The first to break that I noticed was running a Puppet master with httpd + mod_passenger in AWS Linux 2014.09. It won’t work properly anymore… Ugh!

Since I was in hurry when I first discovered this, I just reverted back to the default Puppet master using Ruby webrick. Performance was really not an issue since this is only for our environment where we write/test our Puppet classes…

But when I decided to separate the CA server of our Puppet master for scalability — I can’t use the default Ruby webrick anymore. I have to allot the time and investigate if what’s the root cause of the problem

passenger error

snapshot of the error

Clearly… it has something to do with permissions. The web server (httpd) cannot access the Unix socket created by mod_passenger.

versions

version information

Reviewing the CIS guidelines for AWS Linux 2014.09 pointed me to “3.1 Set Daemon umask” which states:

CIS 3.1

This is enforced by this Puppet class via this sysconfig configuration. CIS 3.1 guideline clearly says that “The daemon process can manually override these settings if these files need additional permission.”  — which gave me an idea to override this in the httpd level.

So… override we go…

I opened /etc/init.d/httpd in vim and added a less strict umask: umask 0022

httpd

Restarted httpd and then… FIXED! 🙂