web analytics

Monthly Archives February 2016

Partitioning a new hard disk with parted

Fdisk is undoubtedly the most favorite disk partitioning tool for most linux savy peope. However fdisk has limitations when it comes to disk with space more than 2T. Redhat recommends parted now, starting from RHEL6. fdisk doesnt understand GUID partition table (GPT) and it is not suited for disk bigger than 2T. You will have to use a more advanced tool “parted” for that.

Let us see how a new 3T disk can be partitioned using parted command. I will be showing just 1 partition here, taking up all space rest can be done the same way. Normally, the disk will be labelled msdos, and you need to label it as GPT.

The list command will show you the current disks and their details.

[root@abc ~]# parted –list
Model: ATA ST33000650NS (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B...

Read More

Hetzner server with > 2TB disk

Recently I ordered a Hetzner server for one of our clients. The server had two 3TB disks. Hetzner provides a command line installation of the desired OS once we login to their server. As such, I logged in to the server and installed Centos6 by executing “installimage” option as suggested by Hetzner.

After installing OS and rebooting the server, I noticed that the 3T disk is not showing full space.

[root@abc ~]#df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        99G  2.5G   91G   3% /
tmpfs           463M     0  463M   0% /dev/shm
/dev/sda2       976M  126M  800M  14% /boot

/dev/sda4   2.3T     123M   2.2T  1% /home

If the disk size is greater than 2T you cannot use normal fdisk to create partition...

Read More

Fatal error: Class ‘Net_SMTP’ not found in /usr/local/lib/php/Mail/smtp.php on line 349″

I was trying to setup a php script to send mail with SMTP Authentication. The script was ready, but when executed in a browser, it displayed the following error.

Fatal error: Class ‘Net_SMTP’ not found in /usr/local/lib/php/Mail/smtp.php on line 349″

The problem appears because the php pear package Net_SMTP is not present in the server. You can install it in two way.

  1. Install the Mail package with –alldeps which will install all required dependencies like Net_SMTP

pear install –alldeps Mail

If Mail is already installed, and if it refuses to get installed then you can force the installation as follows.

pear install –alldeps -f Mail

2.  If Mail is already installed, then you can install the Net_SMTP option alone as follows.

pear install Net_SMTP

After that, execute the script again and...

Read More