»
S
I
D
E
B
A
R
«
The Linux Filesystem Hierarchy
Jan 31st, 2011 by Carlo

One of the things that made me curious when I approached Linux for the first time was the long list of different directories that are part of a basic installation. The command ‘man’ helps in figuring this out when searching for ‘hier’, which stands for hierarchy:?

[carlo@dragon ~]$ man hier

Another good source of information for the file system hierarchy of Linux is available at The  Linux Documentation Project web site:

http://tldp.org/LDP/Linux-Filesystem-Hierarchy/Linux-Filesystem-Hierarchy.pdf

This is a 113 pages book in PDF format and is a good reference for those who want to know more. For the rest of us, here is a list of the most important directories in the hierarchy.
Keep in mind that different Linux distributions may use some of the directories in a slightly different way and, sometimes, even change the path of some of the contents described in this article.
However, the principle remain, and you can always type ‘man hier’ on the command line to learn how your particular distribution behaves, if something is different.

/ The so called “root” directory. Everything starts from here; all the other directory paths start from this root point.
/bin This is a container for the programs that are used in command line mode. Mostly, these are the programs that are used in day to day chores, from creating and destroying directories, to change ownerships, to make searches, and even provide shell environments. All these programs are executable binaries, from which the name of the directory: bin[ary].
/sbin The container for the system programs that are used to boot the system and to perform certain administrator tasks. Regular users usually don’t need to access the contents of this directory, although they are usually visible to everybody.
/boot The boot loader directory. It contains the boot loader itself, all its related files, and the kernel binary. When the system is powered on, the BIOS goes directly into this directory and starts the boot loader. This may present a list of Operating Systems to start, like Linux or Windows or OSX, then it loads the kernel into memory and gives control to it.
/dev This directory contains a list of the physical devices that are part of the system. In Linux, every device is represented as a file, so each device has an entry in this directory that emulates a file. Whenever you access a device, either a disk, or a USB device, or a console terminal, or any other, the OS thinks it is a file that is located in this directory and access it, like it was a real file. Low level drivers take care of converting the file access directives to actual directives for the device itself. If you have some knowledge of C++, you can easily see the concept when you think how all kind of devices can be accessed by a stream, simply using the iostream class or one of its derivatives.
/etc The repository for most of the system configuration files. Some very large packages have their configuration file in subdirectories of /etc. Otherwise, everything is located at this exact level. Example of configuration files stored in this directory are: bashrc, crontab, host.conf, inittab, netconfig, passwd, virc, yum.conf. Whenever aprogram is launched, it usually go into this directory to see if there is a centralized configuration file it should use.
/etc/opt This is a special subdirectory of /etc. While /etc is used to store configuration files for system applications, or applications that come with the operating system, /etc/opt is used to store configuration files for optional applications, those that can be installed from expernal repositories, or those that you can eventually create of buid yourself. These are applications that are normally stored in the /opt directory.
/home The default home directory for all users. Each user has usually its own subdirectory allocated right below /home. For example:
/home/carlo
/root The home directory of the root user. The root user or superuser is the main administrator of the system.
/lib The libraries directory. This is the place where all the shared libraries are stored. Shared libraries are those binary routines that are used by the programs but are not part of the programs themselves. When a specific functionality, or a set of them, can be used for different programs, it is usually put in such a library. Then, the programs don’t have to incorporate that code over and over again. Instead, they just link to the library that contains the code so they can use it. As you can imagine, this architecture has the advantage that a bug fixed for a specific functionality, that is fixed within a library, automatically and simultaneously fix the same bug in all the programs that use that functionality through the library. It is very effective and largely used.
/media Each storage device, before it can be used, needs to be mounted, otherwise the OS and the programs cannot access it. This directory is the place where removable media is mounted. CD-ROMs and USB disks, for example, are mounted in this directory and accessed from there.
/opt As already mentioned earlier, this is the directory where optional applications are installed. These are applications that are not specifically part of the distribution.
/proc This is a directory containing files that describe the current status of the system and all its processes. These files are continuously updated by the OS and we can only access them to read their content. Unfortunately, although the contents are written in text format, they are kind of criptic to understand. However, there are several programs and commands available that are made just for read and decode the contents of the proc files in a more human readable format. Commands like top and iostat, or applications like System Monitor, simply access the files in this directory and present their contents to you in a nice format.
/srv This is a repository for certain data used by the system when it is used as a server. It usually comes empty with a new installation.
/tmp A temporary container for everybody to use. Depending on the policy defined for the system, files in this directory can be deleted without notice, either because they are odler than a certain age, or at predetermined days and times. Certain programs use this directory to hold temporary data. Users can put files in it too, but they have to be aware that they are not going to stay there forever.
/usr This is the directory containing programs for the regular users, their documentation, everything related to X, files used by compilers, libraries, and a lot of other interesting stuff. To stalk abou tthis directory alone, it would take a lot of space so, just go browse into it; you’ll be surprised by the amount of information in it. This directory was the original home directory for all the users in the UNIX systems, but its usage has been restricted more and more over time, until today is only usage for files that are of support for the users. The home for the users has moved to /home. However, some UNIX versions still use /usr the way it was originally intended.
/var This directory is divided in several subdirecories. It is the repository for most of the log files generated in the system, along with some configuration files, cache, users’ mailboxes, spools for various programs, and a lot more.
Virtual Machines (2)
Apr 3rd, 2010 by Carlo

After a long pause (my job kept me very busy lately), here we are again to talk about virtual machines. This time I will tell you where to get and install an effective software package, called VirtualBox, that is capable of running almost any type of Operating System that a PC can support.

It is important to say that the best performance from such a package is obtained if you run it from a 64 bit PC, i.e. a PC equipped with a 64 bit OS, either MS-Windows or Linux. It is possible to use this package also on a 32 bit machine but, in this case, please make sure that the CPU of your computer is virtualization technology enabled, as not all the CPUs can do that.

Here is some reference for you. This is an Intel web site listing all the virtualization technology enabled CPUs. And this is the official VirtualBox web site.

Now, from the VirtualBox web site, search for the version of product you need to download, based on the OS you are running (i.e. MS-Windows or Linux) and whether it is the 32 or 64 bits version. Note that 64 bit versions of the package are labeled with AMD64. This is the right version also for Intel CPUs.

Once you find what you are looking for, download it and install it according to the procedure for your OS. For example, in MS-Windows, just double-click on the installer.

Please just note the following, when you run the installation:

  1. The installer will ask you for installing options; usually the default choices are good enough. Don’t play with the choices if you don’t know what you are doing.
  2. You may be asked to choose the driver where to install the application, if you have more than one. Usually the installer will suggest you the right one, but you may choose a different one if you like. Just make sure it has enough space in it; the installer will tell you how much space it needs and how much is available in each drive.
  3. The installer will shut down the network interface of your computer, will make some modifications to its setup, then it will reactivate it. This is done to give transparent access to the network to the Virtual machines. The installation will suspend waiting for your OK to continue, to avoid network services disruption in case you are accessing the network with some other application.
  4. If you are installing on MS-Windows, you will see a warning saying that the software you are installing is not Microsoft certified. You may continue the installation anyway, as VirtualBox is not going to cause you or your computer any trouble. However, the final decision is yours and yours only. If for any unforeseen reason the software misbehaves and causes breakage on your computer, I will not take any responsibility on that. You have been warned ;-)
  5. After the installation is complete, when you start VirtualBox for the first time you will be presented with a registration form. You may choose whether to register or not. VirtualBox will work either way.

For your reference, here is a set of snapshots of the installation procedure executed under MS-Windows XP.

Virtual Machines (1)
Nov 5th, 2009 by Carlo

What is a Virtual Machine?

If you run a Google search for the definition of a Virtual Machine, you get something like this:

  • In computer science, a virtual machine (VM) is a software implementation of a machine (computer) that executes programs like a real machine.
  • A software emulation of a computer that runs in an isolated partition of a real computer; A computer system that is implemented in software …
  • A simulated computer in that it runs on a host computer but behaves as if it were a separate computer.

…. and several more definitions.

But what that really means for us? Simply put, think of the Virtual Machine as a program that runs on your computer and acts like a computer in itself, a computer where you can install an operating system, like MS-Windows or Linux, and where you can run programs for that operating system. And that operating system may even be different from the one installed on your actual computer.

OK, you might say, so what?  I already have a computer and I have already my Windows 7  happily running on it. Why would I care to use a Virtual Machine to install another OS? Couldn’t I do that simply by double booting my machine? I could install both Windows 7  and Ubuntu, for example, and when I turn on my computer I choose which one to use.

True, that’s a very good point. But think about this now: what if you want to go back and forth from one OS to the other? What if you are running an application on Windows, for example, and then you want to run another one from another OS? Ubuntu, for example, or Mac.

Do you start seeing the point? One of the great things of using a Virtual Machine, is the possibility to run side by side programs that can only run on a specific platform. So, for example, you could be able to run at the same time an application from a Mac computer and another one for a Windows computer, keep them side by side, and be more productive that having to reboot your computer every time you have to switch from one application to the other.

Or maybe, you are one of those guys who likes testing all possible programs that come in your hands and, once you are done, you may want to discard some of the programs from your computer, leaving no traces of it.  Using a Virtual Machine to emulate a PC would just help you on this. The Virtual Machine would create an isolated environment for you where you can do all the experiments you like. Then, once you’re done, you could actually remove from your computer the whole Virtual Machine and leave your PC exactly the way it was before you started your experimentation.

And what about browsing on the Internet with the constant fear that you could catch a virus that would infect your machine and damage it? Again, a Virtual Machine would help you in this case, because the virus would be imprisoned in it, unable to spread in to the host computer where the Virtual Machine runs. Stopping the Virtual Machine and simply deleting it, would eliminate the virus from your computer with very little effort.

Finally, running a virtual machine on your computer, would allow you to run that old program that you liked so much and that is not supported anymore in your new version of Windows. How about that?

Am I intriguing you? I really hope so because when you’ll experience all the benefits that the use of a VM can bring to you, you will actually starting loving it.

So, follow me through the next posts, and I will show you how you can actually install a Virtual Machine Manager on your computer (any OS you are using will work), and how you can use it to safely browse the web, or run your old programs, or experiment with a new OS by installing it and all, without altering the setup of your real computer.

See you soon and … Happy browsing.

»
S
I
D
E
B
A
R
«

INFORMATION IN THIS WEB SITE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED. THE USER ASSUMES THE ENTIRE RISK AS TO THE ACCURACY AND THE USE OF THIS INFORMATION.

Trademarks: All brand names and product names used in this web site are trade names, service marks, trademarks, or registered trademarks of their respective owners. Dazzling Solutions is not associated with any product or vendor mentioned in the site, unless otherwise specified.

»  Substance: WordPress   »  Style: Ahren Ahimsa