Chinaunix首页 | 论坛 | 博客
  • 博客访问: 240725
  • 博文数量: 108
  • 博客积分: 3045
  • 博客等级: 中校
  • 技术积分: 1162
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-19 18:26
文章分类

全部博文(108)

分类: LINUX

2007-04-19 18:26:09

*网上有另一种方法,就是通过zcat boot.img.gz > /dev/sda1 或是
zcat netboot.tar.gz > /dev/sda1
再通过syslinux这样去做..可能是我下的那个那个netboot.tar.gz有问题
这样的方法反正是没装上.
*另一个就是如果在WIN下面装GRUB的话,我也试过了,方法差不多的.
只是那个也有两个方法的.最简单的一个就是做一个DOS启动盘,再下一个
grub4dos,放到U盘上直接运行就可以了.
另一个方法看一次资料吧,记不清了.



#df
看看你的USB所在设备,我的是/dev/sda1
其实有没有这一步无所谓,接下来对U盘分区,如果你有分区,
那么你就得看看是sdaX....
如果你的U盘已有分区要另说了~我的只是为了快,就直接分区了.

#fdisk /dev/sda
请注意这里是sda,不是sda1,sda2..或是别的什么..

分区的命令大家不用细说吧.
Command (m for help): p

Disk /dev/sda: 1048 MB, 1048576000 bytes
255 heads, 63 sectors/track, 127 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 127 1020096 83 Linux

Command (m for help): d
Selected partition 1

Command (m for help): 1
1: unknown command
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-127, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-127, default 127): //这里我空白是把全间全部都用了,不分了,大家可以慢慢分的... 格式如: +100M
Using default value 127

Command (m for help): a
Partition number (1-4): 1

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.


#umount /dev/sda1 格式化前要umount(我这里一分完区,马上自动mount)
#mkfs.ext2 /dev/sda1 格式化,没有这个命令apt-get install dosfstools
#mount /dev/sda1 /yourDir 再把U盘挂上来
#mkdir /yourDir/boot 在U盘上建个boot的目录
#cp -R /boot/grub/ /yourDir/boot cp本机上的/boot/grub里的内容

//这里还有一种方法把grub装上U盘用grub-install 这个方法试了一下下,不过在写的时候有点问题没成了,还是用下面的快

#grub 执行grub为了把grub写在MBR上
grub> root (hd1,0) 为什么是(hd1,0)?这个很容易理解的.(hdx,y) x(0--3)从0开始,y(0--3)
也是从0开始.如第一个硬盘的第一个区(hd0.0) 第一个硬盘的第4个区(hd0,3)
第二个硬盘的第一个区(hd1,0)USB在这里是认为HDD的.
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd1)
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 (hd1)"... 15 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd1) (hd1)1+15 p (hd1,0)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.

你可以这时编写那个menu.lst
本人懒就没改动,只是在引导时写一下


download一个网络安装包:

把 netboot.tar.gz这个下下来
抽取其中两个文件:
linux + initrd.gz
要这两个就足够了

#cp /yourDir/../linux /yourDir(mount的USB)/boot
#cp /yourDir/../initrd.gz /yourDir(mount的USB)/boot
当然可以一起CP

此时U盘可以启动,且可以安装了~
个人安装时的爱好,自已选内容吧.

在BIOS里面设好U盘启动
设已引导GRUB,出现画面

按"c"进入命令提示
grub>kernel /boot/linux vga=771
grub>initrd /boot/initrd.gz
grub>boot

接下来就看到正常的安装画面了~
阅读(766) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:scim与fcitx

给主人留下些什么吧!~~