Linux Guide/Installing (dual-boot)
||A Wikibookian suggests that GRUB Installation After Windows Installation be merged into this book or chapter.
Discuss whether or not this merger should happen on the discussion page.
Dual-boot systems - Run Linux and MS Windows
You need to run both MS Windows and Linux on your PC and you have only one hard disk. Follow these steps:
Windows needs the first partition on systems where grub is being used as a bootloader. (Note that this requirement does not apply to systems that use lilo). It is strongly advised to put windows in the first partition (/dev/hda1 or /dev/sda1) otherwise you will have to do hide and unhide of partitions during grub configuration. If you have Linux on first partition then you have to move it. Golden rule: Put windows in first partition and Linux can run easily off any other partition
Notation: If using SCSI or SATA drives use 'sda' and for IDE drives use 'hda'
- Download the partition tool LiveGParted from http://gparted.sourceforge.net/livecd.php and boot the LiveGparted CD-ROM
- Resize the MS Windows partition and then create new partition(s) for Linux.
- If Windows is NOT in first partition and if Linux is already existing on first partition then move the Linux from partition 1 to another partition like 2.
Open X-terminal console and mkdir /hda1 mkdir /new mount /dev/hda1 /hda1 mount /dev/hda2 /new cd /hda1 Use tar and not cp -r. tar cpf - . | tar xpvf - -C /new Edit /new/etc/fstab and /new/grub/menu.lst as appropriate
- Create primary partition 1 FAT32 for MS WindowsXP, Windows wants the first disk.
- If you do not have Windows already in partition 1, install Windows XP on partition 1 (format to NTFS)
- Boot Linux CD-ROM and install the grub and in menu.lst you do not need to do unhide and hide since MS-Windows is in first partition.
Troubleshooting: Grub not finding file or disk or partition. If the disk is not recognised inside the grub, then that partition is marked as "hidden". Also when you do 'find /boot/grub/stage1' it does not find the file. So you do this inside grub: Note: hd0 is /dev/hda1 and partition 1 is 0 in grub commands.
grub> unhide (hd0,0) grub> find /boot/grub/stage1 (Now this will succeed and show some output)
- GParted LiveCD http://gparted.sourceforge.net/livecd.php
- GParted Wiki http://en.wikipedia.org/wiki/GParted
- GRUB page: http://www.gnu.org/software/grub/manual/
- Grub Howto: http://tldp.org/HOWTO/Linux+Win9x+Grub-HOWTO/index.html
- Google Grub: Grub Topics
- Wiki Grub: http://en.wikipedia.org/wiki/GNU_GRUB
- Wiki Lilo: http://en.wikipedia.org/wiki/LILO_(boot_loader)
- Virtualization: http://en.wikipedia.org/wiki/Virtualization