Saturday, September 26, 2009

Install Virtual Box in your Linux machine

Here is a quick way to install VirtualBox in your linux PC.

The Preparation

Before you begin installing, I would suggest upgrading your PC

Fedora/RHEL/CentOS users can run
yum update -y

For Debian/Ubuntu sudo apt-get upgrade

Next, Install build-essential, Linux headers

For Ubuntu/Debian
sudo apt-get install build-essential linux-headers-generic

Fedora/RHEL/CentOS may need the following packages:
    binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel

You may install then all with yum
sudo yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel

Installation

Now install virtualbox from the repository

Fedora/RHEL/CentOS users
yum install virtualbox

Debian/Ubuntu users
sudo apt-get install virtualbox

If all goes well, you would be able to run Virtual Box now.

Common Error Messages

Error! Your kernel source for kernel -server cannot be found at /lib/modules/server/build or /lib/modules/server/source.

Starting VirtualBox kernel module...                                  [fail]

Possible causes: Correct version of linux headers are not installed

Resolution:

Install the correct headers

RHEL/Fedora/CentOS users
yum install linux-headers-$(uname -r)

Debian / Ubuntu  users
sudo apt-get install linux-headers-$(uname -r)

Remove and reinstall virtualbox again

RHEL/Fedora/CentOS users
yum remove virtualbox
yum install virtualbox


Debian / Ubuntu  users
sudo apt-get remove virtualbox
sudo apt-get install virtualbox

Sunday, September 20, 2009

Data Recovery from crashed Hard disk free

TestDisk is OpenSource software and is licensed under the terms of the GNU Public License (GPL).

TestDisk is a powerful free data recovery software! It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table). Partition table recovery using TestDisk is really easy.

TestDisk can
  • Fix partition table, recover deleted partition
  • Recover FAT32 boot sector from its backup
  • Rebuild FAT12/FAT16/FAT32 boot sector
  • Fix FAT tables
  • Rebuild NTFS boot sector
  • Recover NTFS boot sector from its backup
  • Fix MFT using MFT mirror
  • Locate ext2/ext3 Backup SuperBlock
  • Undelete files from FAT, NTFS and ext2 filesystem
  • Copy files from deleted FAT, NTFS and ext2/ext3 partitions.

TestDisk has features for both novices and experts. For those who know little or nothing about data recovery techniques, TestDisk can be used to collect detailed information about a non-booting drive which can then be sent to a tech for further analysis. Those more familiar with such procedures should find TestDisk a handy tool in performing onsite recovery.

testdisk

Operating systems


TestDisk can run under
  • DOS (either real or in a Windows 9x DOS-box),
  • Windows (NT4, 2000, XP, 2003, Vista),
  • Linux,
  • FreeBSD, NetBSD, OpenBSD,
  • SunOS and
  • MacOS

Source files and precompiled binary executables are available for DOS, Win32, MacOSX and Linux from the download page


Filesystems


TestDisk can find lost partitions for all of these file systems:
  • BeFS ( BeOS )
  • BSD disklabel ( FreeBSD/OpenBSD/NetBSD )
  • CramFS, Compressed File System
  • DOS/Windows FAT12, FAT16 and FAT32
  • Windows exFAT
  • HFS, HFS+ and HFSX, Hierarchical File System
  • JFS, IBM's Journaled File System
  • Linux ext2 and ext3
  • Linux LUKS encrypted partition
  • Linux RAID md 0.9/1.0/1.1/1.2

    • RAID 1: mirroring
    • RAID 4: striped array with parity device
    • RAID 5: striped array with distributed parity information
    • RAID 6: striped array with distributed dual redundancy information

  • Linux Swap (versions 1 and 2)
  • LVM and LVM2, Linux Logical Volume Manager
  • Mac partition map
  • Novell Storage Services NSS
  • NTFS ( Windows NT/2000/XP/2003/Vista/2008 )
  • ReiserFS 3.5, 3.6 and 4
  • Sun Solaris i386 disklabel
  • Unix File System UFS and UFS2 (Sun/BSD/...)
  • XFS, SGI's Journaled File System


Documentation


How to get TestDisk
  • Download - Binary executables and source files are available for DOS, Win32, MacOSX and Linux.

Accessing WebDAV Filespace from Linux

First, you must install the WebDAV Linux file system driver on your Linux computer. It is recommended to use a fairly new version of davfs2 (e.g., 1.1.4 or later). Early versions have severe security problems.
Download and Installation
First check whether your Linux distribution comes with a precompiled version of davfs2. If it does, simply install the package and your are done with the installation. If your Linux distribution does not contain a davfs2 package, it is not difficult to compile the driver yourself:
  • First get the source code from the WedDAV download site and download the latest version available (at the time of writing this was 1.1.4). Save the tar file at a suitable location, e.g., /tmp.
  • Make sure that you have the neon and neon-devel packages installed.
  • Untar the downloaded tarball at a suitable location (I prefer /usr/local/src), change to the directory (e.g., cd /usr/local/src/davfs2-1.1.4) and run the following commands: "./configure", "make", "make install" (you must become root before running the "make install" command). This will install the driver in the /usr/local/directory tree, e.g., the mount.davfs command will get installed in /usr/local/sbin.

Mounting WebDAV Directories

First you must create the mount point for your WebDAV directories, i.e., an empty directory that will after the mount hold your WebDAV files. I prefer to create a directory "webdav" in the home directory on my Linux computer and create within that directory suitably named subdirectories that will serve as mount points for your webdav directories. Then you can mount your webdav file space by typing something like
su
mount.davfs -ouid=partha,gid=users https://webdav.url.com/files/personal/partha /home/patha/backup
exit

where the first argument, -ouid=partha,gid=users specifies your username and group on your own Linux computer, i.e., replace "partha" with your own username and replace "users" with your group (execute the command "id -n -g" to find your group, if you are not sure). The second argument, https://webdav.url.com/files/personal/partha

in this example, specifies the location of your webdav file space on the WebDAV server. The last argument is the mount point that you created before, i.e., the name of the directory that is going to hold your WebDAV files. The mount.davfs (in CentOS I had to do /sbin/mount.davfs in place of mount.davfs) command is going to ask you for a username and password. These are your SFU username and password - not the username and password that you are using for your Linux computer.

If everything goes well, you now can access your WebDAV files in the directory that you chose as the mount point.

TroubleShooting:

_____________________

Incase you get
/sbin/mount.davfs: Mounting failed.
401 Unauthorized

the webdav server may be Windows and you need to enable Basic Authentication through IIS in the server

______________________________________

______________________________________

Incase you get the error

/sbin/mount.davfs: can’t open fuse device
/sbin/mount.davfs: trying coda kernel file system
/sbin/mount.davfs: no free coda device to mount

You may need to install
fuse fuse-ntfs-3g dkms dkms-fuse

In CentOS box I simply did

yum install fuse fuse-ntfs-3g dkms dkms-fuse


Saturday, September 12, 2009

Installing java in Ubuntu Linux

On Debian/Ubuntu Linux for example all you need to do is make sure that your apt-get is pointed at the right place. In your /etc/apt/sources.list add in the following (and make sure you are okay with adding in stuff that is not in the default environment).

deb http://us.archive.ubuntu.com/ubuntu dapper main restricted
deb http://us.archive.ubuntu.com/ubuntu dapper universe multiverse

After this have apt updates its repository

sudo apt-get update

And finally, just tell it to install java :)

sudo apt-get install sun-java5-jdk

After this the rest of the process will display a dialog that will require you to accept the license agreement. When you do, the rest of the setup will happen on its own.

When you're on the command prompt type

javac -version

or

java -version
_____________
Edit: There is an Update to this post