Posts Tagged ‘GNU/Linux’

Linux File System Summary

Saturday, January 19th, 2008

As you probably know in Ubuntu everything is under the root or /. All drives that you will ever use will start with /. That doesn’t mean that they’re not segregated from your OS and application stuff.

Let’s say you have 3 drives. You have one drive house the / paritition. Within that, you can have another drive house the /home partition, and yet another the /media/files partition. If your / drive somehow dies, you still have the /home and /media/files housing drives intact! You can simply reinstall the OS and get back to work. The point I’m trying to make is that while it seems that everything in Ubuntu is a single drive, is may only seem this way.

By default, unfortunately, everything like / and /home and /etc and /bin and al the other directories are on the same drive. In this case, you are putting everything on the equivalent of the C: drive in Windows. So the thing that you need to do if you happen to be a neat freak like me, is put /home on a separate partition (or preferably drive). This will allow you to keep using your /home after reinstalling and often even using other flavors of Linux. And best of all, you keep most of your program settings. This is the equivalent of being able to move Windows user folders located under documents and settings between computers (which you can’t). Most people I know who use more than a couple of hard drives simply mount all their hard drives under /media. Let’s say that you have /media/storage and /media/storage2. This is the equivalent of D: and E: in windows. If you lose the main OS install for some reason, you will still be left with both storage and storage2.

So in conclusion, in Linux you will always see the same basic structure, but beneath it you can have the order you love.
You can easily see which partition is mapped to which location in your file system by running a simple command. Open a Terminal window and type:

df -h (note: the -h modifier is used to present you with human readable size information)

Linux Partitions — They Make Sense!

Saturday, January 19th, 2008

90% of computer users use Windows. In Windows the command line is largely foregone in favour of GUI (graphical user interface) tools like ‘Computer Management’ and just right-clicking on everything and selecting ‘Properties.’ While Linux (a.k.a. GNU/Linux) has about as many GUI tools intended for administration, it is much more convenient and consistent to use a single tool–the command line interface (CLI).

Regardless of the Linux distribution (i.e. Ubuntu, Mint, Fedora, etc.) that you’re running, you have your CLI interface available with largely the same functionality, regardless of the flavour of Linux (and even BSD) you happen to be running.

Today I’m going to show my fellow Windows users how to look at their partition and drive information using the CLI. Using a few simple commands, you can instantly see your drive configuration, usage information, and much more useful stuff.

In Windows all hard drive/flash drive partitions get a drive letter, as do CD/DVD-Rom and Floppy drives. Usually the main system partition is called C:, the CD-DVD-Rom drive gets the D: letter, and the floppy drive gets the A: letter. A hard drive partition can consist of a whole drive or just a part of a drive. Usually, drives are not “sliced up” in several partitions. The C: drive can just be the C: drive, or is can be the C:, E:, F:, and G: drives.

In Linux the concept of drive letters does not exist. Instead, drives have names and numbers. PATA (wide cables) drive get the name of ‘hd,’ while SATA (narrow cables) drives get the name of ’sd’. After the name of the drive comes a letter which signifies the order in which the drive is looked at. For example, the first PATA drive is ‘hda’ and the first SATA drive is ’sda’. After the order of the drive comes the partition number. Again, the PATA drive’s two partitions will be known as ‘hda1′ and ‘hda2,’ similarly, the SATA drives get ’sda1′ and ’sda2.’

Let’s say that you have two SATA drives in your system, each with three partitions. You will have the following naming scheme:

First SATA drive: sda1, sda2
Second SATA drive: sdb1, sdb2

So, how do you find out what kind of hard drive configuation you have? It’s simple! Open up a Terminal window (if you don’t know how to do this, google “terminal [your distro]“)

less /boot/grub/device.map (note: this will show your your physical drives and their order)
sudo fdisk -l [or] su && fdisk -l (note: this will expand upon the previous command by showing you all parition information)

Next up, I’ll write about the linux file system. It too makes sense!

IPCop — Fun For The Casual Hacker (O’Reilly Definition)

Friday, October 12th, 2007

Would you like a corporate grade firewall and IDS for your SOHO network? Do you have an old spare PC sitting around? If you answered yes to both questions then you’re in luck because IPCop is there for you. IPCop is a Linux firewall distribution which is configured to allow even new users to configure and use it.

First make sure that you have an old but functional computer lying around. Anything will do as long as if has a 386+ CPU, 32MB+ RAM and 200MB+ (5GB+ if you want to run a proxy server) of storage space. Now the most important thing you have to keep in mind that will will be just like your “router” (the little NetGear/Linksys/Dlink box) you have at home. In fact those like boxes are in fact just tiny computers themselves. Well, what do they all have in common? They have multiple ports. Usually there is one port called something along the lines of Cable, or Internet. This is the connection which goes into your cable modem or DSL model. They also have 4-6 connections which you can use to connect your local computers to. Well, you will need at least 2 network cards if you want to use IPCop. One will be the “Internet” interface and the other will be your local interface.

Make sure that the computer you’ve built is running reliably and that both network cards are plugged in securely. You may also want to check the hardware compatibility list to make sure that your network cards will be recognized.

Next download the appropriate IPCop ISO image and burn it with software like Nero or the free CDBurnerXP Pro. Put the CD in the CD tray of your spare computer, boot it up and make sure you set the BIOS boot sequence to boot from CD. Once you’re in the main setup screen, follow the prompts and configure your GREEN (local) and RED (internet) interfaces with the appropriate IP addresses. Make sure that the local network has an IP address somewhere in the 192.168.x.x, 172.16.x.x, or 10.x.x.x ranges and set the internet interface to get all of its information via DHCP. Connect the cable coming from your modem box to the RED interface and the cable from your home computer to your GREEN interface. If you have more than one computer on your network, you can instead connect the green interface to a switch or a hub and plug in all your boxes in it. If you have a wireless access point or you want to have a DMZ network, I STRONGLY urge you to get separate network cards for them and configure them as the BLUE (wireless) and ORANGE (DMZ) networks and put them on different subnets.

When you’re done with the setup, go back into the BIOS and disable the CD-Rom from participating in the boot sequence. You can also remove the CD-Drive altogether because you won’t need it anymore. Boot up the newly installed firewall and watch it boot. Once you’re presented with a login screen, go to a computer which is on the GREEN (local) network and connect to https://ipofgreeninterface:445. Use the admin password you set during setup to configure all the options you want. By default, the original configuration will keep you very safe.

If you get stuck somewhere along the way, just e-mail me and we’ll solve the problem together.

Edit:

I forgot to mention that there are awesome guides for both installing and configuring IPCop at IPCop.com > Documentation

Remember to visit the donations page and see how you can help if you like IPCop.