Tuesday, May 27, 2008

Running UNIX and Windows Together on the Same Machine

Partitioning a Hard Disk for Use by both UNIX and Windows

One way to have access to both systems on the same machine is to create two separate partitions on your hard disk: one for the UNIX System and one for Windows. Within either partition you run the corresponding operating system and have all of its normal features. You can use a UNIX System application at one moment, and then switch over to the Windows partition and run a Windows application.

This approach allows you to use both systems, to move between them, and to have all of the normal features of the system you are using at the moment. Unfortunately, for most UNIX variants, it is cumbersome to move from one operating system partition to the other. To do so you have to switch partitions, shut down the current system, and start up (boot) the other.

If you are using the UNIX System and want to move to Windows, you begin by selecting the active partition on your machine. Similar to using FDISK for partition management on Windows machines, you use the UNIX fdisk command, which brings up a menu that you use to change the active partition. (Note that to use fdisk you have to have superuser permission.) For example,

$ su
# fdisk
Hard disk size is 4035 cylinders
Partition Status Type Start End Length %
========= ====== ==== ===== ===== ====== ===
1 FAT32 0 1181 1182 31
2 Active UNIX Sys 1182 4034 2852 69

1. Create a partition

2. Change Active (Boot from) partition
3. Delete a partition
4. Exit (Update disk configuration and exit)
5. Cancel (Exit without updating disk configuration)
Enter Selection: 2
Enter the number of the partition you want to boot from
(or enter 0 for none): 1

This sets the computer hardware so that the next time you boot, it will start up in the DOS partition.

After changing the active partition, shut down your UNIX System. To shut down the system, follow one of the methods using either the menu-based system administration commands or the command-line sequence. If you boot the system following the previous steps, it will come up running DOS in the DOS partition.

In addition to the complexity involved in moving between two systems this way, using separate partitions for each system has some important limitations because each partition with the programs and files it contains is independent of the other. In most cases, without special software, you cannot directly move files or data between partitions, and you cannot send the output of a DOS command to a UNIX System command.

No comments: