免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1224 | 回复: 0
打印 上一主题 下一主题

Setting Up a Windows/Linux Dual Boot System [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-10-30 14:14 |只看该作者 |倒序浏览

Setting Up a Windows/Linux Dual Boot System
Written by CopperTop of the
http://www.linuxforums.org
team.
Reference source:
http://www.littlewhitedog.com
Skill level: Intermediate
Location of Operating Systems
It is recommended to load the Windows o/s (operating system) to the drive that is first booted by the BIOS. Depending on how your system is set up, there are a couple possible configurations:
  • One physical hard drive partitioned into multiple logical drives[list:c1198636d5]
  • suppose your drive was partitioned into 3 logical drives – C:\, D:\ and E:\
  • you would want to keep the Windows o/s on C:\ and maybe keep D:\ for data – this frees up E:\ for Linux
  • the install of Linux on E:\ will automatically split this partition into three sub-partitions - /boot (boot sector), / (root), and /swap (swap space)
  • Multiple physical hard drives

    • with Windows on the first primary master drive, you may have it partitioned into C:\ D:\ and E:\
    • installing Linux to the primary slave drive, or the secondary master drive, will result in an automatic portioning into three sub-partitions - /boot (boot sector), / (root), and /swap (swap space)
    [/list

    :c1198636d5]
    Keep track of where you install Linux to for use in a later step. For IDE drives, Linux uses the prefix hd followed by a letter for each physical drive:
    a for primary master
    b for primary slave
    c for secondary master
    d for secondary slave
    This is then followed by a number representing each partition on that drive. (NB: For SCSI drives, Linux uses the sd prefix instead.)
    For the examples given above, the drives are labeled by Linux as follows:
  • One physical hard drive partitioned into multiple logical drives
    C:\ = /dev/hda1, D:\ = /dev/hda2, E:\ = /dev/hda3, /boot = /dev/hda4, / = /dev/hda5, /swap = /dev/hda6
  • Multiple physical hard drives
    C:\ = /dev/hda1, D:\ = /dev/hda2, E:\ = /dev/hda3, /boot = /dev/hdb1, / = /dev/dhb2, /swap = /dev/hdb3
    Installing Linux
    Install Linux to one of the locations mentioned above and make sure you understand where /boot is located (/dev/hdxn). If you choose to manually partition Linux and skipped the /boot partition, then use the location of the root partition. No matter what distribution of Linux you decide to use, make sure you create a bootdisk. If you skip this step and something goes wrong with your boot loader set up, then you may not be able to boot into Linux without re-installing. So make sure you create a bootdisk!
    During the installation, Linux will also prompt you to install a boot loader. The most common two are LILO and GRUB. If you choose to skip this step, your only option for loading Linux will be to use the bootdisk that you just created. (You did create one, didn’t you?!?) You can always boot Linux with your bootdisk and configure LILO or GRUB manually later via the lilo.conf or grub.conf files. Installing either LILO or GRUB will present you with two options:
  • Install the boot loader to MBR[list:c1198636d5]
  • this overwrites the Windows bootloader and could result in neither o/s loading if a problem is encountered
  • should your Windows bootloader become corrupt, see Fixing the Windows Bootloadersection below
  • otherwise, your Linux bootloader will now be the default loader for your system, giving you the choice of either Windows or Linux
  • Install the boot loader to the Linux partition

    • requires a modification to the boot.ini file in Windows to be able to find and load the Linux /boot partition
    • see Using the Windows Bootloader section below
    [/list

    :c1198636d5]
    Using the Windows Bootloader
    By default, the installation of a Windows o/s will create a Windows bootloader on the MBR (master boot record). This is the first sector that is booted by the BIOS when you start the machine. Here you will find the windows file boot.ini that tells the system where to get the files necessary for booting each o/s. This file normally resides in your C:\ directory, but may not be visible if you have “Do not show hidden files and folders” and “Hide protected operating system files (Recommended)” activated. Deactivate both of these settings through the following navigation in any explorer window:
    Tools | Folder Options | View
    Your boot.ini file should now be accessible.
    With both Windows and Linux successfully installed, the next step is to make a copy of the Linux boot sector and copy it to Windows. To do this, boot into Linux (using your bootdisk) and switch user (su -) to root. After entering the password for root, your command prompt will change from $ to #. Mount a floppy for creating MS DOS files by issuing the following command:
    Code:mount –t msdos /dev/fd0 /mnt/floppyWith a DOS formatted floppy in the drive, issue the following command to create a 512 byte copy of the boot sector:
    Code:dd if=/dev/hdb1 of=/mnt/floppy/linux.bin bs=512 count=1where hdb1 is the location of where you installed LILO or GRUB to.
    Unmount the floppy and reboot into Windows. Copy the linux.bin file from the floppy to your C:\ directory. Edit the boot.ini file in Notepad by adding a line like the following to the end of the file:
    Code:C:\linux.bin=”My Linux Partition”Also, make sure that the timeout option is set to a value greater then zero. If the timeout option is missing, add the following to the boot.ini file underneath the header [boot loader]:
    Code:Timeout=10
    Fixing the Windows Bootloader
    For Windows9x systems, boot from a Windows boot floppy and at the a: prompt, issue the command:
    Code:fdisk /mbrFor Windows 2000/NT, boot from the install CD and enter the Recovery Console. Then issue the command:
    Code:fixmbrFor Windows XP, boot from the install CD and enter the Recovery Console. Then issue the command:
    Code:bootcfg /rebuild
    Testing Your New Dual System
    Remove all disks from the system and reboot. You should now be prompted by the Windows boot loader as to which o/s to load. Try them both and make sure they work!
    __________________
    \"Everything should be made as simple as possible, but not simpler.\"
    Albert Einstein


    all above is copy from
    http://www.linuxforums.org/forum/linux-tutorials-howtos-reference-material/3443-dual-booting-windows.html


    本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/49071/showart_410701.html
  • 您需要登录后才可以回帖 登录 | 注册

    本版积分规则 发表回复

      

    北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
    未成年举报专区
    中国互联网协会会员  联系我们:huangweiwei@itpub.net
    感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP