Technofunction

Formatting a partition in Linux

mkfs(make file system) or mke2fs(make 2min file system) are the commands used for formatting a partition in Linux. If a partition has previously formatted, you need to use mkfs command, and Linux will reformat the partition to same filesystem. Or you can add “-t” parameter in order to specify the type of filesystem to be built(ext2/3,vfat, reiserfs) or “-c” for checking the bad blocks before formatting.

For example; the following commands format the /dev/sda2 partitions to noted filesystems:

# mkfs -t ext2 /dev/sda2

# mkfs -t ext3 /dev/sda2
# mkfs -t vfat /dev/sda2
# mkfs -t reiserfs /dev/sda2

Or you can use:-
# mkfs -j /dev/sda2
(-j creates a journal with ext3 filesystem)

Or,

mke2fs -O journal_dev [ -b block-size ] [ -L volume-label ] [ -n ] [ -q ] [ -v ] external-journal [ blocks-count ]

and mkswap command is used to format the Linux swap space. For example, if you want  /dev/sda3 as a swap partition, the command is

# mkswap /dev/sda3

Creating a Simple Redhat Yum Server Repository

The yum stands for “Yellow Update dog Management“. The yum is used to resolve the dependencies and install packages in Red Hat Enterprise Linux(RHEL)/ CentOS/ Fedora. The yum is made on XML(Xtended Markup Language).

By default, yum command doesn’t work in RHEL if you don’t have an Licensed Enterprise Linux. But RHEL and above mentioned distros are shipped with large number of packages which are usually stored in folders Server and VT.

The main problem in installing packages via rpm are there dependencies. Softwares like java and others have large dependicies i.e they require large number of rpms to be installed which cant be done manually. So it is convinient to create a Simple RedHat Yum Repository.

When you convert all the packages to XML  it is called a repository. A repository can be thought of as a collection of all the software’s ( around 2550 approx) in XML format. Once a repository is been made you can simply install any package by simply using the command

# yum install packagename*

or even remove all the software’s and dependents once by using

# yum remove packagename*

The configuration file location is /etc/yum.repos.d/rheldebug.info

To create a simple yum server follow the commands given below:-

Note:- Here we are creating Yum Server via CD/DVD if you have installation files on server than you can make a yum client rather than a yum server by using FTP or NFS. Both of the above method i will be covering in my later posts.

  • Create a directory /yum . We would be copying the directory “Server” to this directory in this example and than specifying this directory in the configuration file. Obviously you could change it as you desire.
  • Simple insert the CD/DVD of RHEL5.* in the Cd Drive.
  • Next go the the RHEL directory which contains all the installation files and packages by using

# cd /media/RHEL_ 5.4\  i386\  DVD/

Here  RHEL_ 5.4\  i386\  DVD/ is the directory in the CD

Install Vuze(Azureus) Bittorent client on Linux

About Vuze:-
Vuze is torrent pear2pear client which helps you to download files and software’s across various torrents present world wide. You need to have an p2p client for downloading contents from any torrent. There are many torrent clients like bittorrent, utorrent and many more but Vuze is one of the far best choices for Linux and also i personally recommend it because i never faced any issue with vuze.

It is quite simple to install and use vuze on Linux just follow the steps below:-
Note:- You must have Java Runtime Environment installed already before installing Vuze.

  • Simply download the software by visiting the Vuze official site http://www.vuze.com .

  • Save it on Desktop or were ever you like in our case it is on Desktop.
  • Follow with the steps below if you are login as root if not than precede the commands with sudo if you assingned desired priviledge.
  • Open a terminal and go to the directory were you have saved the installation files in our case it is on desktop so

# cd /root/Desktop

# ls

Vuze_Installer.tar.bz2      (This is the installation file for vuze which will be saved on your desktop)

  • To run this .tar.bz2 file use the following command:-
    .

    # tar -jxvf filename.tar.bz2
    in this case it is
    # tar -jxvf Vuze_Installer.tar.bz2

(more…)

Increasing/Resizing swap partition size in Linux

Starting with Swap space it is Virtual memory that has functionality similar to physical memory but it is not an alternative to physical memory. Usually we keep the Swap space double the size of the RAM(Random Access Memory). But what if you have increase the size of RAM or may be applications like open office demanding more memory. So you need to increase the size of swap space.

The best way is simply to increase the size of the swap partition and afterwards by using the command Partprobe we can simply force the Linux kernel to read the newly created partitions. This avoids the need of restarting the system.

  • Open the Terminal while logged in as root
  • #fdisk -l (It gives the information about the current partitions)

Device Boot     Start     End       Blocks     Id     System
/dev/sda1   *      1         13       104391         83    Linux
/dev/sda2          14      3837     30716280     83    Linux
/dev/sda3        3838    5749     15358140     83    Linux
/dev/sda4        5750    7832     16731697+   5     Extended
/dev/sda5        5750    6010     2096451       82    Linux swap / Solaris

As you can see there are 5 partitions sda on hard disk.

  • #fdisk /dev/sda (Here you can edit the partitions)

Press m to show all the options.

Press p to print the partitions.

(more…)