[resize2fs] – Amazon AWS EBS Volume Size Mismatch


Storage !
Image by trodrigues via Flickr

Few days (a month) back I had faced a strange (amateur) problem in Linux with Amazon EBS volume. For some reason I had to increase the volume size say double the size of current volume attached to an instance.

As a normal (not an “advance” user of Linux) I did the following steps:

  • Dismounted the device (EBS Volume) by “umount /dev/sdf“.
  • Logged into AWS console and detached the attached volume from the instance.
  • Took a snapshot of that EBS volume.
  • Created another volume from above created snapshot with double the size of the current volume.
  • Attached the above newly created volume back to the instance.
  • SSH to the instance and mounted the volume (a handy – “mount /dev/sdf/mnt/ebs“).
  • Just curious (being a naive Linuxian), I tried to see the size of the volume by running “df -h”.
  • <<<<<<PANIC>>>>>>
  • It shows the size of the volume as the old one.
  • I confirmed it in the AWS console the size of the new EBS volume is double the size of the original.
  • What the HECK is happening???

Continue reading “[resize2fs] – Amazon AWS EBS Volume Size Mismatch”

[resize2fs] – Amazon AWS EBS Volume Size Mismatch

[HOW TO] Convert tabs to spaces in Eclipse and File (in Linux)


Tux, the Linux penguin

This is a quick tip that helped me save a lot of time – this is the reason why I love LINUX because of it’s simplicity.

I was working on a legacy code (referred as old-age code – a simple procedural coding style) for a client. In general, coding standard suggests you to have spaces instead of tabs to make it look better in all kinds of IDE, we (generally every developer) uses tab key a lot (to make our life easier) thinking it gives us the space but it inserts an actual tab (which usually jobs off from one end to the other). This legacy code was filled with tabs which looked pretty ugly in our code-review tool, though it looks perfect in the IDE, when you try to open it in Linux the favorite VI editor it looks ugly YUCK it is.

HUH, initially when my folks reported me I was like yeah go ahead and change it – what’s a big deal. But then when I came to know it not just one file but a lot (yes a lot) – it was almost more than 100 files, which had tabs instead of spaces (not GOOD – yeah I know).

Continue reading “[HOW TO] Convert tabs to spaces in Eclipse and File (in Linux)”

[HOW TO] Convert tabs to spaces in Eclipse and File (in Linux)

[TIPS] – How To Open a PORT NUMBER in IPTABLES – LINUX


An illustration of how a firewall works.
Image via Wikipedia

In my good old days with LINUX I struggle quite a bit to understand what is a port number & how it works, what is firewall & why the hell it is blocking, etc. You have to understand port number when you work with tomcat server (remember server.xml 🙂 – man it sucks), it works in 8080 but not in 8090 or you name it, it just doesn’t work at all :-).

Today I think I should publish this tip, because if you are asking me about IPTABLES I will say it is a nightmare :-), any small mistake you do with it’s conf file then you are gone. Continue reading “[TIPS] – How To Open a PORT NUMBER in IPTABLES – LINUX”

[TIPS] – How To Open a PORT NUMBER in IPTABLES – LINUX

INSTALL (SETUP) DEBIAN Linux OS for Development/Production – A Day with SETUP


Debian OpenLogo
Image via Wikipedia

Today I am going to talk about only installation of tools/apps required for LINUX Server. I have chosen DEBIAN, since it makes you intelligent ;-).

Okay, cool, now? First thing you have to buy a hosting space, there are quite a good people who provide this service – do a quick Google.

OKAY – Now let’s say you have got the hosting space and you have selected the DEBIAN (LENNY) OS and logged into the machine – remember DEBIAN is for intelligent & its not for human-beings means most of the tools/apps will require a separate installation. You have to dive deeper to figure out the tools you want and install them – this is interesting because it let’s you know things :-).

P.S:
This blog post is recommended for those users who knows about LINUX SERVER & shouldn’t find the meaning of Debian in the dictionary.

Let’s get the server ready……

Continue reading “INSTALL (SETUP) DEBIAN Linux OS for Development/Production – A Day with SETUP”

INSTALL (SETUP) DEBIAN Linux OS for Development/Production – A Day with SETUP

Cron(tab)(job) or Daemon in LINUX


I want to run a task frequently with auto-trigger?

I want to perform some task without HTTP protocol?

I want to generate a report as a background process?

I don’t want my web-app (heavy traffic) hang for a while to resize (process) a large image?

I want to process some of my maths (apps/requirements) to run in parallel to show the users data very fast.

I want to create a scheduled backups for my server?

lists goes on….

First thing which comes into most of our mind is cron-job or a daemon script which will take away some of the load of any particular task, a quick example:-

Let’s say one of your web-site gives the user to upload any kind of image of any size and the site will cut/resize them into different pieces which they can use it for different purpose.

As a provider you definitely don’t want to slow down your web-site due to heavy amount of data goes into your server – think if 100 people uploading 10MB of an image each & your script will have to cut them into various sizes which is more than enough to bring down your server so fast.

Continue reading “Cron(tab)(job) or Daemon in LINUX”

Cron(tab)(job) or Daemon in LINUX

Installing ImageMagick in Linux CentOS with YUM


Logo for ImageMagick
Image via Wikipedia

It may look simple when you read the label, but it has a capability to ruin your life. Yeah man!, try to install the latest version of ImageMagick-6.5 in your Linux (remember it’s not windows) OS which will throw a big list of dependency (packages) failures.

As is always the case with RedHat, Fedora and CentOS (may be more), a number of packages in the usual yum repositories lack heavily behind the advancements made by their authors and teams. One such package is ImageMagick, which has the version of 6.2.8 in repositories whereas the latest version is 6.5.

Recently we had to upgrade this package to the latest for one of our image manipulation project, since the latest version had several improvements with the image processing. Most of the time I just go and upgrade the existing repositories, search for the new repositories, then see if anything helps me out, naaaa, none of these procedure will helped me.

Finally, I wanted to give a chance to ImageMagick’s source, I download the latest version, uncompressed then compiled it, which thrown me a big list of errors, which is obvious 🙂 . I started looking at errors and came up with the list of dependencies it lacks (which is normal for any Linux OS), most of them are devel libraries (see below).

Continue reading “Installing ImageMagick in Linux CentOS with YUM”

Installing ImageMagick in Linux CentOS with YUM