Archive for January, 2010

Separating standard output from standard error

Constructs like these are often used by programmers, so that output is displayed in one terminal window, and errors in another. Find out which pseudo terminal you are using issuing the tty command first:

#make all 2> /dev/pts/7

To find the tty type

root@dell:~# tty
/dev/pts/1
SBDavid

Redhat Rescue Mode

Redhat Rescue Mode

Rescue mode provides the ability to boot a small Red Hat Enterprise Linux environment entirely from boot media or some other boot method instead of the system’s hard drive.

There may be times when you are unable to get Red Hat Enterprise Linux running completely enough to access files on your system’s hard drive. Using rescue mode, you can access the files stored on your system’s hard drive, even if you cannot actually run Red Hat Enterprise Linux from that hard drive. If you need to use rescue mode, try the following method:

Using the CD-ROM to boot an x86, AMD64, or IntelĀ® EM64T system, type

linux rescue

at the installation boot prompt. Itanium users should type elilo linux rescue to enter rescue mode.

SBDavid

Size of swap partition

Size of swap partition

Swap should equal 2x physical RAM for up to 2 GB of physical RAM, and then 1x physical RAM for any amount above 2 GB, but never less than 32 MB.

Using this formula, a system with 2 GB of physical RAM would have 4 GB of swap, while one with 3 GB of physical RAM would have 5 GB of swap.

Creating a large swap space partition can be especially helpful if you plan to upgrade your RAM at a later time.

If your partitioning scheme requires a swap partition that is larger than 2 GB, you should create an additional swap partition. For example, if you need 4 GB of swap, you should create two 2 GB swap partitions. If you have 4 GB of RAM, you should create three 2 GB swap partitions. Red Hat Enterprise Linux supports up to 32 swap files.

How Many Partitions in general for RHEL?

While preparing to install Red Hat Enterprise Linux, you must give some consideration to the number and size of the partitions to be used by your new operating system.

You should at least create the following partitions: swap, /boot/ (or a /boot/efi/ partition for Itanium systems), a /var/ partition for Itanium systems, and / (root).

Dedicated partitions needed:

For x86 and AMD64 systems, at least two partitions ( / and swap ) must be dedicated to Red Hat Enterprise Linux.

For Itanium systems, at least three partitions ( / , /boot/efi/ , and swap ) must be dedicated to Red Hat Enterprise Linux.

If your partitioning scheme requires a swap partition that is larger than 2 GB, you should create an additional swap partition. For example, if you need 4 GB of swap, you should create two 2 GB swap partitions. If you have 4 GB of RAM, you should create three 2 GB swap partitions. Red Hat Enterprise Linux supports up to 32 swap files.

SBDavid

Use of file descriptors

Use of file descriptors

There are three types of I/O, which each have their own identifier, called a file descriptor:

standard input: 0

standard output: 1

standard error: 2

In the following descriptions, if the file descriptor number is omitted, and the first character of the redirection operator is , the redirection refers to the standard output (file descriptor 1).

Some practical examples will make this more clear:

ls > dirlist 2>&1

Will direct both standard output and standard error to the file dirlist, while the command

ls 2>&1 > dirlist

Will only direct standard output to dirlist. This can be a useful option for programmers.

ampersand is used to run a process in the background. Here, it merely serves as an indication that the number that follows is not a file name, but rather a location that the data stream is pointed to.

« Prev - Next »