Archive for the ‘1 – Partitions & root folders’ Category

I – Partitions & root folders

torsdag, juni 10th, 2010

    Partitions increase safety. If you fill up a harddrive with only one partition you’re fucked. If you have several your data partition might be out of mem but your system partition will still be functional. Also, you can increase disk space efficiency – if you have a lot of small files with an avarage size of 1 kb and your partition block size is set to 4 kb you’ll be wasting 3 kb for each file allocation. With several partitions you can optimize them for the avarage filesize on that partition.
Linux have several partitions.

    Linux comes with swap partition and some other shit that you really don’t have to care about. I’d say roll up a joint and skip next section. If you have some sort of mental disorder or, worse, for some unimagenable reason are truly interested, here is the brief go through:

    All partitions are attached to the system via a mount point. In Linux, usually all partitions are connected through the root partition. This partition is indicated with the slash (/). Partitions however, should not be confused with regular folders and when you’re looking in the root folder there seem to be folders, just folders, no partitions. How come?
You can look at it this way – a cargo ship fills the role of a partition, a container the roll of a folder. All you have to care about is to remember in what container you stacked your cocain, crack, etc. You don’t have to worry about what cargo ship that takes them over the ocean. I put my heroin in container ‘fun_and_games’ and I put my weapons in container ‘diffensore’ and then I just don’t give a shit which cargo ship that brings ‘em. I put my private files in folder ‘private’ which might be on partition A or B or… and I take my public files and put them in folder ‘public’ which might reside on partition A or B or…
You can check the partition of the current folder by using cmd ‘df -h .’. Again, some of these folders are kept on different partitions to make the world, or at least your work station, a safer place.

Okey, move along.

    So I stole that picture honestly from ‘’. As you can see there are a lot of folders in your root directory. I’d like to explain them to you some day. Eeh, wait a minute, correction – I don’t want to explain the to you. Not now, not ever. You’ll have to check ‘em out on your own, cowboy.

    All folders in the root folder, no matter what partition it belongs to, starts with a ‘/’. For an avarage grade you should have come to the conclusion that all absolute paths starts with the sign of the root ‘/’ e.g. ‘/dev’, ‘/usr/bin’, ‘/home’ etc. The ‘/’ character is just to show that we want a folder in the root. ‘cd /dev’ relates to the folder in the root directory. ‘cd dev’ relates to a ‘dev’ subfolder in your current directory.