Friday, 29 April 2016

create and mount ext4 filesystem


mkfs.ext4  "Device Name"


mke2fs -t ext4 "Device Name"

# mkfs.ext4 /dev/sda3

# mkdir /ext4_filesystem

# mount -t ext4 /dev/sda3  /ext4_filesystem

Burn CD or DVD from ISO file (CLI)

Assuming that you already have an ISO file and all you want to create CD based on the ISO 9660 standard. You can burn an ISO using below command,

# cdrecord -v -pad speed=1 dev=0,0,0 daddy-linux.iso
If you are not comfortable with the above mentioned process, follow below method.

First Identify CD ROM letter from /dev/

# ll /dev/ | grep -i cdrom
lrwxrwxrwx  1 root root
3 2010-09-30 15:13 cdrom -> sr0
lrwxrwxrwx  1 root root
3 2010-09-30 15:17 cdrom1 -> sr1

Here, sr0 is our first CD drive and you want to use same drive for burning,

# dd if=/root/Download/daddy-linux.iso of=/dev/sr0 bs=512
Here, if = Source place of an ISO file and of = Destination place or where to write.

Sunday, 24 April 2016

ImportError undefined symbol: lo_truncate64

If you are getting above error in psycopg2 , then for sure on loading an older libpq library is used than the one with which the psycopg2 was installed.

To identify which libpq is the is using issue below command, the output of command should point to right file which is latest

ldd /path/to/venv/lib/python2.6/site-packages/psycopg2/ | grep libpq => /usr/pgsql-9.4/lib/ (0x00007f0d6c027000)

if above output is the correct .so file and you are still getting above error then, try to locate in default libraries like /usr/lib64 (on centOS), For me it was below under /usr/lib64
lrwxrwxrwx.  1 root root       12 Mar 31 10:15 ->
-rwxr-xr-x.  1 root root   162760 Feb 25  2014

As you can see the for some reason is trying to load above which is an older one. So I removed this softlink file and created a new one which points to /usr/pgsql-9.4/lib/ in /usr/lib64, by
issuing below commands
cd /usr/lib64
ln -s /usr/pgsql-9.4/lib/

Above should fix the issue.