Skip to main content

Posts

Showing posts from July, 2011

How to erase the harddisk completly using linux ?

Erasing the entire hard disk using Linux: Run the following command to fill your entire hard disk with zeros $ dd  if=/dev/zero of=/dev/sda  bs=1M The above command will whole hard disk with zeros. Note: this will take long time to complete. Erasing/filling the hard Disk with random data : We can fill the hard disk with random data in case of any security requirement  to prevent data loss. Run the below $ dd  if=/dev/random of=/dev/sda  bs=1M Erasing the MBR(Master Boot Record) of the Hard Disk. To Erase only code area in your MBR:   Run        $ dd  if=/dev/zero of=/dev/sda  bs=446 count=1 To Erase entire MBR :   Run   $ dd if=/dev/zero of=/dev/sda  bs=512 count=1 Note : If linux is not installed, Boot into Linux image from Live CD to perform above operations  on the hard disk.  

How to add persistent/permanent routes in Mac OS X

Mac OS X looses static routes when it is rebooted. To preserve the static route on mac we would need to create a startup script which adds your static route upon system startup. The following steps will help  in achieving this. Create a directory named " addroute " under /System/Library/StartupItems/ with sudo privileges. Under addroute directory create "StartupParameters.plist" with below contents in it                   3. Now, create addroute shell script under  /System/Library/StartupItems/addroute directory. The addroute script should be like below.       #!/bin/sh # Setting up static routing tables for Mac OS X                  . /etc/rc.common syslogger ( ) {            printf "%s\n" "$*" >> /var/log/system.log }   StartService () {         syslogger $(/bin/date) " : Adding static route to route table"         syslogger $(sudo /sbin/route add 192.168.1.0/24 172.16.193.100)         return 0 } StopService (

How to add persistent/permanent routes in windows and linux

We can add static route in the system using route add command from the command prompt or terminal. But these routes gets erased when we reboot the system. To make your route's persistent even after reboot. follow below command on Windows or Linux On Windows : In Command Prompt, Run command as below C:\> route -p add 192.168.1.0   mask 255.255.255.0  172.16.193. 100 metric 1 -p switch will make the route persistent on windows. On Linux : Open Terminal , with root privileges create/edit below file to add the route details as below            $ vim /etc/sysconfig/network-scripts/route-eth0      2.   Add the route details like below and save the file.                         192.168.1.0/24 via 172.16.193.100      3.   Restart the network service by running " /etc/init.d/network restart ". Now you should be able connect the systems under 192.168.1.0/24 network through 172.16.193.100 gateway.     Note : if your ip address is configured to eth1 port then you would

How to enable ssh connection to vmware esxi server

SSH connection by default is disabled to the VMWare ESXi hosts. We can enable the SSH connection on the ESXi host with following steps: Login into ESXi shell with your root credentials. ( How login as root can be known here ) Open /etc/inetd.conf with vi. Look for #SSH by scrolling down or searching the string. Un-comment the line by removing "#" by pressing X from your keyboard. Save the file. Now get the process id of inetd by running command as " ps | grep inetd " Run "Kill -HUP . This would kill the inetd process daemon and inetd is relaunched again. Now again get the process id of inetd to make sure inetd was lauched again. Now SSH is enabled to the ESXi host.  If inetd was not launched, then restart your ESXi host. This would enable the SSH connection upon restart.

How to get shell access on the VMware ESXi host server

We might sometime need the root access on the VMWare ESXi host to debug an issue. But VMWare ESXi does not provide any console other than the default one. But there is a way to get the shell/terminal access for the root. The below steps should help in that.  Goto VMware ESXi console.  Press Alt+F1 from your keyboard.  Type "unsuported" even though you will not see the characters getting displayed on the console. Now , type the root password to get the root access to the ESXi host.

How to setup Redhat cluster and GFS2 on RedHat Enterprise Linux 6 on Vmware ESXi

1)     Installing RHEL6 on Vmware esxi  with clustering packages . a)     Creating a RedHat Enterprise Linux 6.0 Virtual image. i)       Open vSphere Client by connecting to a Vmware ESXi Server. ii)     Login into your vSphere Client iii)    Goto File -> New -> Virtual Machine (VM). iv)    Select Custom option in Create New Virtual Machine Window and click Next v)   Give a name to the virtual machine(VM) ( In my case name of my virtual machine is – RHEL6-ClusterNode1) and click next. vi)    Select a resource pool where you want your VM to  reside ( In my case , I have created a      resource pool named RHEL6-Cluster.) and click Next. vii)  Select a datastore  to store your VM files  and Click Next. viii) Select VM version which is suitable for your environment.( In my case VM version is 7) and click Next. ix)   Specify the guest operating system type as Linux and select version as RedHat Enterprise Linux 6.0 -32 bit. Click Next. x)   Select number of CPU for the VM ( you