debian linux u盘安装,使用U盘安装debian

使用U盘安装debian

发布时间:2007-05-01 16:44:54来源:红联作者:readywin

省去刻盘或是下镜像...

这个在U盘上的内容大约为5.5M

我是初学者...写写只是为了初学者,各位牛人就省去了

前提你的U盘还有板子支持USB启动

因为我是两台机器,所以我从另一台DEBIAN下做的U盘启动盘

*网上有另一种方法,就是通过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/dists/etch/main/installer-i386/current/images/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

接下来就看到正常的安装画面了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值