Category Archives: Linux/Unix

Find a class inside all jars

When having class path issues caused by an old version of a library in your class path, it might be convenient to find all the jars provided this class to figure out what component is loading the old version. So here is a command to do this:

for f in `find /home/jenkins -name '*.jar' -print -exec echo {} \;`; do echo "$f: "; unzip -l $f | grep ''; done

Add an extra hard-drive in CentOS 6

In this post, we are going to add an extra drive to store binaries for the CTPIT installer or a full FileNet installation. I would suggest setting the new disk as type Write-Through. That means it won’t be affected by snapshots, which is convenient in that case since we don’t need to snapshot it.

To do this, edit the Virtual Machine’s settings, go to Storage, and attach a new disk. Then go to the Virtual Media Manager (Ctrl+D), modify the disk you’ve just created and set the type on Writethrough.

Now, the first time you will be using this disk on a VM, you will have to create a partition, format it and mount it.

Create the partition

First you need to find what is the device name for the OS. By default, there is a good chance it’s /dev/sdb, but you can check by running a ls in the /dev folder:

ls /dev/sd*

Here we can see sda already has 2 partitions, so that’s the main disk, and sdb has none, that’s our disk. We will use fdisk to create the main partition on our disk sdb:

fdisk /dev/sdb

Continue reading