Linux File Structure – Graphical Representation


One of the best way to understand LINUX file-structure.

Linux File System Archietecture

Image Courtesy: http://www.secguru.com/link/linux_file_structure_graphical_representation

Advertisements
Linux File Structure – Graphical Representation

[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

Installing Imagemagick from source in Debian


Logo for ImageMagick
Image via Wikipedia

I have always had a good experience with Imagemagick in my career. Read this post – you will know HOW.

I can understand since it was CentOS, but with Debian I thought it might come handy if you choose to install Imagemagick from source. NAH! – never think like that. For one of our project, my colleague requested me to upgrade this package I thought it will be good and easy, just shoot the command “apt-get install imagemagick” phew – I got no updates.

Debian Lenny has a latest stable release of Imagemagick 6.6.0 and the current version is 6.6.9, AAH!.

Continue reading “Installing Imagemagick from source in Debian”

Installing Imagemagick from source in Debian

[SOLUTION] – Linux – SSH Connection Refused due to non-existence of /dev/urandom


Amazon Web Services logo

Today one of our production machine (in Amazon EC2) was down and I couldn’t bring-up the instance due to unavailability of SSH in PORT 22, connection was refused and I had no clue what to do, after sometime I was able to bring-up the instance – (ok short and sweet).

Though I got it working after some work-around, I wanted to make sure what I did was correct, hence I asked experts in stackoverflow.com – got good advice/suggestion and I hope all set for a fix. BTW, the answer on the question also helped in learning a new stuff called auditd on the disk – a must have tool for system admin.

Okay, the reason why I wanted to pin-down this blog is to show what I did to fix /dev/urandom and how did I get the server up and running. Let me go straight to there.

HOW!!!?

Continue reading “[SOLUTION] – Linux – SSH Connection Refused due to non-existence of /dev/urandom”

[SOLUTION] – Linux – SSH Connection Refused due to non-existence of /dev/urandom

[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

Amazon EBS VOLUME – Attach/Detach – Mount/UMount – device is busy [SOLUTION]


Unix filesystem
Image via Wikipedia

I always want to share some of the quick-tip like the one below.

Recently when I was working with Amazon Cloud for one of our client I faced a problem when umount (dismount) a volume (EBSElastic Block Storage) (OR) detaching from an EC2 instance. I could not dismount the volume, whenever I try to dismount, it throws “umount: … device is busy“. I was like not sure what is going on, why the device is not dismounting from the machine ???.

Dismounting a particular device forcefully, especially a storage volume can cause a serious damage you will end-up losing some important data. I was not sure what should I do, on the other end, the PRESSURE, I have to dismount the volume and re-create another machine.

Continue reading “Amazon EBS VOLUME – Attach/Detach – Mount/UMount – device is busy [SOLUTION]”

Amazon EBS VOLUME – Attach/Detach – Mount/UMount – device is busy [SOLUTION]