免费注册 查看新帖 |

Chinaunix

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

u盘安装debian [复制链接]

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

                                *网上有另一种方法,就是通过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一个网络安装包:
http://ftp.nl.debian.org/debian/dist...mages/netboot/
把 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
接下来就看到正常的安装画面了~
               
               
               
               
               
               
               

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

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP