|
发表于 2003-6-16 10:14:58
|
显示全部楼层
#grub
grub> root (hd0, //在这里按Tab键就可以显示下表,选择linux引导分区我分区号,我的分区号为1
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0x7
Partition num: 1, Filesystem type is ext2fs, partition type 0x83
Partition num: 4, Filesystem type unknown, partition type 0x7
Partition num: 5, Filesystem type is ext2fs, partition type 0x83
Partition num: 6, Filesystem type is fat, partition type 0xb
Partition num: 7, Filesystem type is fat, partition type 0xb
Partition num: 8, Filesystem type unknown, partition type 0x82
Partition num: 9, Filesystem type unknown, partition type 0x7
grub> root (hd0,1)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0,1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0,1)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,1)"... failed (this is not fatal)
Running "install /boot/grub/stage1 (hd0,1) /boot/grub/stage2 p /boot/grub/grub.conf "... succeeded
Done.
grub>quit
这样就把grub安在了linux引导分区的第一个扇区,然后
# fdisk /dev/hda
The number of cylinders for this disk is set to 4865.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p //p为显示分区的情况
Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 653 5245191 7 HPFS/NTFS
/dev/hda2 654 1307 5253255 83 Linux
/dev/hda3 1308 4865 28579635 f Win95 Ext'd (LBA)
/dev/hda5 1308 2091 6297448+ 7 HPFS/NTFS
/dev/hda6 2092 2876 6305481 83 Linux
/dev/hda7 2877 3661 6305481 b Win95 FAT32
/dev/hda8 3662 4577 7357738+ b Win95 FAT32
/dev/hda9 4578 4642 522081 82 Linux swap
/dev/hda10 4643 4865 1791216 7 HPFS/NTFS
Command (m for help): q //退出
比如我的linux引导分区是hda2就执行
#dd if=/dev/hda2 of=linux.sec bs=512 count=1
执行这步就会输出linux.sec这个文件,就在你当前的目录下,把它复制到windows的C盘下,再修改boot.ini就可以了。(最后一行加上c:\linux.sec="linux",引号里的东西可以随便) |
|