CentOS 6.4 Netinstall

Download the network installation iso file and burn to CD.
Place the CD in the CD-Rom and reboot the system.
When ask to select the network install method, choose “HTTP” and enter the following:

1) for 32 Bit
Host: mirror.centos.org
Directory: centos/6.4/os/i386

2) for 64 Bit
Host: mirror.centos.org
Directory: centos/6.4/os/x86_64

Posted in CentOS, Linux, Linux Installation and tagged , , by with comments disabled.

CentOS 6.3 NetInstall

Download the network installation iso file and burn to CD.

Place the CD in the CD-Rom and reboot the system.

When ask to select the network install method, choose “HTTP” and enter the following:

1) for 32 Bit
Host: mirror.centos.org
Directory: centos/6.3/os/i386

2) for 64 Bit
Host: mirror.centos.org
Directory: centos/6.3/os/x86_64


Posted in CentOS, Linux, Linux Installation and tagged , , , by with comments disabled.

Add Gnome/Gui to a Minimal CentOS 6.3 Linux System

I recently used the netinstall CentOS CD to install one of my Linux systems. During the installation process, I decided to install CentOS 6.3 minimal to quiken the overall install process. After the successful installation, I decided it was time to add Gnome/GUI to the system. The following were the steps taken to achive this task.

First, it is worth mentioning that there are two versions of this installation.

a.) Short version

b.) Long version

 

STEPS:

a. ) Short version:

Start a new terminal and enter the following:

yum -y groupinstall basic-desktop basic-platform x11 fonts

b.) Long version:

yum -y install “Desktop” “Desktop Platform” “X Window System” “Fonts”

 

That’s it! It will work regardless the method used ;-)


Posted in CentOS, Linux, Linux Installation and tagged , , , , , by with comments disabled.

HowTo Disable the “ZEROCONF” in Linux

Most linux distribution uses the zero configuration network ( ZEROCONF) suite to automatically configure themselves and communicate on a network without the need of DHCP or DNS servers. ZEROCONF is an IETF organ that planned and coordinated a series of dynamic protocols to allow many operating systems to automatically configure themselves.

 

ZEROCONF commonly referred to as IPv4 Link-Local (IPv4LL) and Automatic Private IP Addressing (APIPA) utilises the 169.254.0.0/16 network address to auto-configure a network interface. It uses a series of unanswered “ARP” queries and then assumes an address if the queries yield an empty result. As a result, a route to the ZEROCONF network is added to the routing table by the network initscripts. Example:

The ZEROCONF route

ZEROCONF can be disabled by adding the following entry to the “/etc/sysconfig/network” configuration file.

 

[bash] # vi /etc/sysconfig/network
NOZEROCONF=yes or no (either answer will disable the “ZEROCONF route”)

It is important to note that the value of the “NOZEROCONF” parameter can actually be set to any value. The initscripts can only check to determine whether the parameter has a zero length or not. In other words, setting “NOZEROCONF=no” will have the same effect as setting it to “yes”. In order to reactivate ZEROCONF, the above entry “NOZEROCONF=yes/no” will have to either be commented out or removed entirely.

The network service must be restarted for the changes above to take effect.

[bash] # vi /etc/init.d/network restart

To see if the ZEROCONF route has been disabled, we have to check the routing table again.

The IP routing table

If you ever wonder and want to know more about the the makeup and history of the ZEROCONF, check this very informative zeroconf article written by John C. Welch and this zeroconf article on wikipadia.


Posted in CentOS, ESX, ESXi, Linux and tagged , by with comments disabled.

How to Create a Swap File

A swap file is an ordinary file that is in noway special to the kernel. The purpose of the swap file is to reserve the disk space so that the kernel can quickly swap out a page without having to go through all the things that are necessary when allocating a disk sector to a file.Because a hole in a file means that there are no disk sectors allocated (for that place in the file), it is not good for the kernel to try to use them.

In order to create the swap file without holes, use the following command:

1.) Assuming we want to create a swap file with 2GB size (1024 x 1024 x 2 = 2097152).

[bash]# dd if=/dev/zero of=/swapfile bs=1024 count=2097152

     where if is source, of is output file for dd to write to which is /swapfile in this case, bs is read/write byte size at a time and count is number of blocks.

2.) The next step is to make it a swap file

[bash]# mkswap /swapfile

3.) Activate the swap file

[bash]# swapon /swapfile

4.) Check the newly created swap space usinf free or top

[bash]# free -m

     or 

[bash]# top

5.) Write it to fstab to make it available for the system even after a reboot

[bash]# echo swapfile swap swap defaults 0 0 >> /etc/fstab

 

**) Using cat give you the following output:

[bash]# cat /etc/fstab
/swapfile1 swap swap defaults 0 0

Posted in CentOS, ESX, ESXi, Linux and tagged , by with comments disabled.

CentOS 5.8 NetInstall

Download the network installation iso file and burn to CD.

Place the CD in the CD-Rom and reboot the system.

When ask to select the network install method, choose “HTTP” and enter the following:

1) for 32 Bit
Host: mirror.centos.org
Directory: centos/5.8/os/i386

2) for 64 Bit
Host: mirror.centos.org
Directory: centos/5.8/os/x86_64


Posted in CentOS, Linux, Linux Installation and tagged , , , by with comments disabled.

CentOS 5.4 NetInstall

Download the network installation iso file and burn to CD.

Place the CD in the CD-Rom and reboot the system.

When ask to select the network install method, choose “HTTP” and enter the following:

1) for 32 Bit
Host: mirror.centos.org
Directory: centos/5.4/os/i386/

2) for 64 Bit
Host: mirror.centos.org
Directory: centos/5.4/os/x86_64/


Posted in CentOS, Linux, Linux Installation and tagged , , by with comments disabled.

How To Mount NTFS disks on CentOS

Type this command to determine your kernel version:

[root@lnx ~]# uname -r
2.6.18-128.el5

Download the NTFS kernel modules from:

http://www.linux-ntfs.org/doku.php?id=redhat:rhel5

The current kernel module version of my system at the time of this writing was:
kernel-module-ntfs-2.6.18-128.el5-2.1.27-0.rr.10.11.i686.rpm

Install the RPM :

rpm -ihv kernel-module-ntfs-2.6.18-128.el5-2.1.27-0.rr.10.11.i686.rpm

 

Load the kernel module :

modprobe ntfs

 

Find the disk info : fdisk -l

One partition should be mentionned as HPFS/NTFS

 

Mount the partition :

mkdir /g_drive

mount -t ntfs /dev/hdb2 /g_drive

That’s it!


Posted in CentOS, Linux, Mounting and tagged , , by with comments disabled.

How To Reset The Root Password In A Linux OS

You are hired to take charge of a Linux or Unix production system and no password has been provided for whatever reason (maybe the administrator has just been fired). There are two basic methods to reset the root password:
Method 1:
—————

1. Place the first installation CD/DVD in the CD/DVD-Rom

2. Reboot the system

3. enter “linux rescue” as boot option + ENTER

4. click continue to mount the system

5. cd /mnt/sysimage/ (or chroot /mnt/sysimage/ and skip to step 9)

6. type “ls” (to show the none root environment) – optional

7. type “pwd” (to show the “present working directory” in a none root environment) – optional

8. chroot . bash -i (in order to get the root environment with “bash shell”)

9. type “pwd” (to show the “present working directory” in root environment) – optional

10. type “ls” (to show root environment) – optional

11. type “passwd”    –> to reset the root password

*) other forms of system repairs (instead of just changing root password) can be perfomed here.

12. type “exit”  —> until the system reboots

Method 2:
—————

1. Reboot

2. at the menu of the boot manager (e.g. grub), type ‘e’ for editing

3. navigate to the kernel you want to boot

4. at the right of the line, enter “init 1″ or “single” and press enter

5. type ‘b’ to boot the system into the single user mode

6. type “passwd” to reset the root password

7. type “reboot” to restart the system

Check out this link below for how to recover VMware ESXi root password:

Posted in CentOS, ESX, ESXi, Linux and tagged , , , by with comments disabled.

Low-Level formating vs Zero-Filling an IDE Hard Drive

Very often, Zero-Filling an IDE hard drive is easy confused with Low-Level format. Let me start by saying that you don’t “low-level-format” IDE or ATA hard drives. This term is misnomer from old MFM hard drives days when drives could have the tracks and sectors defined using low-level-format.

All IDE or ATA drives we use today have their tracks and sectors preset at the factory and a real low level format would destroy the drive or at least slow it down drastically… in order words, you cannot redefine the tracks and sectors on these drives with low level format. At least it is fair to say that it is absolutely impossible to change the physical geometry of current IDE/ATA drives without destroying it. In conclusion, low-level-format is an old term that really doesn’t apply to today’s IDE/ATA hard drives.

Now, in today’s situation, there is a different approach in redefining the logical geometry of an IDE/ATA hard drive by building partition(s) on the drive. Keep in mind that there are also the differences between physical and logical geometry of a drive.

When people today use the term low-level-format, there is every indication that this is a real problem. Usually, one of the following issues may have occured:

  • The drive has a boot sector virus and can no long be accessed to clean it off the drive
  •  

  • The drive has begun to develope numerous bad sectors and they are increasing (usually seen when running Scan Disk)
  •  

  • The drive has Linux, WindowsNT or other operating system installed which makes creating a Fat System on the drive incompatible with the new operating sytem to be installed.
  •  

What next… when people have these problems? They are usually wrongly told to low-level-format their hard drives. What really need to be done is reinitializing or mid-level format the drive.

ReInitializing an IDE/ATA Drive:

Now that we have the terminology straightened out, the next question would be… why does this matter? It is extremly important for you to know what exactly you’re doing to your drive.

When you reinitialize a hard drive, you basically use the appropriate tools to zero-fill the drive and as a result, cleaning every area of the hard drive. Most hard drive manufacturers provide on their web sites such utilities for downloading. One of such tools can be found on linux or UNIX operating systems and is simply called “dd”.

dd is the abbreviation for “dataset definition”. It is also jokingly said to stand for “disk destroyer” or “data destroyer”. since being used for low-level operations on hard disks, a small reversing the if and of parameters, can possibly result in the loss of all or some data on a hard disk.

    Example:

                 Using dd to wipe an entire disk with random data.
                 We are going to use a flash drive for thepurpose of this example.

                 first, we need to switch to root account

                 [stan@lnx]$su –

                 Enter the root password and type:

                 [root@lnx]#dd if=/dev/zero of=/dev/hdd

                 or

                 [root@lnx]#dd if=/dev/urandom of=/dev/hdd

                 or

                 for n in {1..7}; do dd if=/dev/urandom of=/dev/sdd bs=8b conv=notrunc; done

Once this process is complete, the drive will be void of any partitions. You will need to use FDISK for microsoft products to partition the drive and then format the new drive.

On a linux system, do the following:

[root@lnx]#fdisk /dev/sdd

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sdd: 1010 MB, 1010827264 bytes
32 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes

Device Boot Start End Blocks Id System

Command (m for help): n
Command action
e extended

p primary partition (1-4): p
Partition number (1-4): 1
First cylinder (1-1011, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1011, default 1011): 1011

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

Now, format the new partition:

[root@lnx]#mkfs.vfat -F 32 /dev/sdd1

 


Posted in CentOS, ESX, Linux and tagged , , by with comments disabled.