Tuesday, December 22, 2009

How to Install Windows XP without Deleting Linux Partition



[Click to enlarge the image]

You try to start installation of Windows XP from a bootable CD/DVDROM. It displays a message saying “Setup is inspecting your computer's hardware configuration” and after a while screen goes black. It seems like as if the installation procedure hanged up.

It happens when you have a Linux partition (mostly ext3) in your disk (HDD). Easiest way is to avoid Windows XP. For example, Windows Vista and Seven doesn’t have this requirement that hard-disk should not contain a Linux partition. You can install them flawlessly.

If it is strictly required that you should install Windows XP, if you don’t need Linux anymore you can delete those Linux partitions from disk management (Right click My Computer -> click Manage -> click Disk Management and you go there).


[Click to enlarge the image]

But if you require to install Windows XP and to keep the Linux unaffected at the same time this is what this page is mainly about.

If you can access Windows in your computer then try first solution. But if you cannot access Windows or want to fix it up using Linux even if you cannot boot into Linux for bootloader problem try second solution.

You need a gnu utility called testdisk to do this. Thanks GNU for their nicest work. Download testdisk from here.
      http://www.cgsecurity.org/wiki/TestDisk_Download

First Solution
  • For Windows you should click Windows on the download page and then complete the download.

    Unzip the downloaded file.

    Go the testdisk directory. Enter into win directory.

    Double click testdisk_win.exe.


    [Click to enlarge the image]
  •  
  • If you have more than one hard-disk select the hard-disk containing Operating Systems first.


    [Click to enlarge the image]
  •  
  • Now select “proceed” and then pres enter. [pressing left or right arrow key selects an option].


    [Click to enlarge the image]
  •  
  • Select Intel (if you are using other system you know it) and then press enter.


    [Click to enlarge the image]
  •  
  • Select analyse and hit enter.


    [Click to enlarge the image]
  • Let’s first keep a back of the existing partition table.
    Select Backup and then press enter.


    [Click to enlarge the image]
  • Press ‘n’ if you were not using Windows Vista/Seven to create partitions and hit enter.

    Select quick search and then press enter. Testdisk will now be searching for lost partitions. Don’t worry about that.


    [Click to enlarge the image]
    And finally it you will be complete and a list of partitions will be displayed.
     

    [Click to enlarge the image]
  • We are temporarily going to delete Linux entries from partition table. Select every Linux partition and press left/right arrow key to change their status. Make them D as shown in image above. Please be careful in this step.

    And then press enter. Updated list of partitions will be displayed.


    [Click to enlarge the image]
  • Now select write as shown in image and then press enter.
  • It will ask for confirmation. Press ‘y’ and then enter.

    After restart you will be able to install Windows XP.
  • After installation run testdisk again. Follow the steps same like first solution but select quick search this time and hit enter key.
  • Press l to load back up in partition list window. Following screen will be displayed.


    [Click to enlarge the image]
  • Select load and hit enter.
  • Partition list will be displayed again. Hit enter. Now select write. And then y and then enter again. Now your linux partitions are back. To fix linux bootloader now follow this link.
          http://sa-os.blogspot.com/2009/11/linux-gone-after-installing-windows.html


Second Solution
If you have Linux in your disk but cannot boot into then check this link out to recover your linux bootloader.
      http://sa-os.blogspot.com/2009/11/linux-gone-after-installing-windows.html

After booting into your Linux system. Download the linux version of testdisk (rpm for Fedora Core, Suse, RHEL, CentOS and .tar.bz2 for other versions) you will have to type testdisk in a terminal after loggin in as root or doing an su.

Now follow the steps described in first solution starting from running testdisk.

N.B: Be careful about losing data giving wrong commands or committing mistakes. We suggest you to keep backup of your essential data.

If you face a problem still write in comments.

[Copy-right material. Contents of this post shouldn’t be copied to any other website for any kind of profit without permission. Contact unix9n at gmail dot com]

Monday, December 21, 2009

How to Configure Dial Up Internet Connection on Solaris 10

Googling for the solution with many types of workarounds in different references brings confusion. It's why I"m describing actually how I configured it.

Follow the steps given below correctly.
  • If you have selected non-networked during installation of Solaris 10 then you have to activate your network interface using the following command:

    # ifconfig interfaceName plumb up ipAddress netmask subnetMask

    In my PC the default network interface is rtls0. You can get your interfacename using following command and then looking up a while.
    # ifconfig -a

    ipAddress means ip Address of your Machine in LAN (you can get it
    from Windows if you have or contact your ISP).

    Subnet Mask is the subnet mask of your PC something like this 255.255.0.0.
  • Create a file /etc/ppp/peer/isp with following contents:

    sppptun 
    plugin pppoe.so 
    connect "/usr/lib/inet/pppoec interfaceName" 
    user atiq...@smile.com.bd           # my account name at my ISP 
    remotename smile.com.bd # name of the ISP; for pap-secrets 
    noauth                  # do not authenticate the ISP's identity (client) 
    noipdefault             # assume no IP address; get it from ISP 
    defaultroute            # install default route; ISP is Internet gateway 
    updetach                # log errors and CONNECT string to invoker 
    noccp                   # ISP doesn't support free compression 
    
  • Append to /etc/ppp/pap-sectrects and /etc/ppp/chap-sectrects

    ispProvidedUserName     ispName password

    Be careful no space as separator should be used. You must place tab instead. For example,
    abcd...@smile.com.bd        smile.com.bd    abcdef
  • Create /etc/ppp/pppoe.if with content
    interfaceName
    You have to set your interface name. interfaceName in my case is rtls0.
  • Create /etc/resolv.conf with content
    nameserver primaryDNSServer 
    nameserver secondoryDNSServer
    You can get them from Windows(peeping into your dialup connection
    detais) or asking your ISP. For example, mine is:
    nameserver 114.31.0.66 
    nameserver 4.2.2.2
  • Apply following commands
    # sppptun plumb pppoed interfaceName
    # sppptun plumb pppoe interfaceName # pppd call isp

    Or you can use debug to check for errors.
    # pppd debug call isp

How to Install Network Simulator (NS) and nsnam on Solaris 10

Follow the steps given below.
  • Download the ns-allinone package from here:
  • Extract it or apply following command and cd to the directory where you downloaded the file. Now apply following commands.
    # gtar xzvf \
    http://nchc.dl.sourceforge.net/sourceforge/nsnam/ns-allinone-2.33.tar.gz
    # cd ns-allinone-2.33
  • Now download all the files attached with this post (look at the bottom) in the same directory. After download is complete enter following commands.

    # chmod a+x ns_fix.sh
    # ./ns_fix.sh
Say yes if it asks to over-write any file.

Wordarounds

What fixes have been done to make the installation successful is described here.

I chose ns-allinone-2.33 package which contains
* Tcl release 8.4.18 (required component)
* Tk release 8.4.18 (required component)
* Otcl release 1.13 (required component)
* TclCL release 1.19 (required component)
* Ns release 2.33 (required component)
* Nam release 1.13 (optional component)
* Xgraph version 12 (optional component)
* CWeb version 3.4g (optional component)
* SGB version 1.0 (?) (optional component, builds sgblib for all UNIX
type platforms)
* Gt-itm gt-itm and sgb2ns 1.1 (optional component)
* Zlib version 1.2.3 (optional, but required should Nam be used)

First, Make your system gnu compatible (fix cc, make).

I have seen cases where setting enveronmental variables does not help. Still
you can try.
$ CC=gcc 
$ MAKE=gmake 

Better try this,
# ln -s /usr/sfw/bin/gcc /usr/sfw/bin/cc 
# ln -s /usr/sfw/bin/gmake /usr/sfw/bin/make

Put /usr/sfw/bin in PATH variable.
# export PATH=/usr/sfw/bin/:$PATH
To make it permanent add it to .bashrc in your home directory if you are using bourne again shell. Else add to .profile. To know which shell: give this command "echo $SHELL" without quotations exactly.

After doing this gcc will be used instead of Sun's default compiler. And gnu make will be default make. If there were no problems if you just extracted the package installed them using ./install command inside the dir it was enough. But it is actually not enough.

There is a problem with the Solaris MIN MAX macros. To fix it I have provided files: config.h and mobile/mip-reg.cc Finally provide tcp_cong.c where replaced strsep with getToken function because strsep is not in Solaris 10 (details here: http://does-not-exist.org/mail-archives/mutt-dev/msg10335.html)

It is included with later releases of Solaris. So you might find it easier to install ns in Solaris Express versions (OpenSolaris, SXCE). (Note: Architecture dependant fix: config.h and mip-reg.cc, OS dependant
fix: tcp_cong.c)

Files are attached with this post. Click to download files.
          config.h
          mip-reg.cc
          tcp_cong.c
          ns_fix.sh