找回密码
 新注册用户
搜索
楼主: ONLY

[原创] 从零开始安装Gentoo Linux,释放多路平台木亥火暴威力!

  [复制链接]
发表于 2012-9-14 18:01:52 | 显示全部楼层
本帖最后由 Lynt 于 2012-9-14 18:04 编辑

回复 15# 金鹏

带#的是注释行,删不删应该没有影响的吧,已保存就没办法了,除非之前有备份,再不行请O版把他的贴出来
回复

使用道具 举报

发表于 2012-9-14 20:22:47 | 显示全部楼层
回复 16# Lynt

VB虚拟机下进行到  将分区信息写入到fstab文件中 这步了,前面的应该自动保存了吧?
回复

使用道具 举报

发表于 2012-9-14 21:39:08 | 显示全部楼层
这个确实辛苦了。
回复

使用道具 举报

发表于 2012-9-15 10:41:49 | 显示全部楼层
本帖最后由 金鹏 于 2012-9-15 10:46 编辑

回复 1# ONLY

不带#号的如何删除?搞不定

靠,移动光标后删除,搞定了
  1. GNU nano 2.3.1              File: /etc/fstab

  2. # /etc/fstab: static file system information.
  3. #
  4. # noatime turns off atimes for increased performance (atimes normally aren't
  5. # needed); notail increases performance of ReiserFS (at the expense of storage
  6. # efficiency).  It's safe to drop the noatime options if you want and to
  7. # switch between notail / tail freely.
  8. #
  9. # The root filesystem should have a pass number of either 0 or 1.
  10. # All other filesystems should have a pass number of 0 or greater than 1.
  11. #
  12. # See the manpage fstab(5) for more information.
  13. #

  14. # <fs>                  <mountpoint>    <type>          <opts>          <dump/p$

  15. # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
  16. /dev/BOOT               /boot           ext2            noauto,noatime  1 2
  17. /dev/ROOT               /               ext3            noatime         0 1
  18. /dev/SWAP               none            swap            sw              0 0
  19. /dev/cdrom              /mnt/cdrom      auto            noauto,ro       0 0
  20. /dev/fd0                /mnt/floppy     auto            noauto          0 0

  21. ^G Get Help  ^O WriteOut  ^W Where Is  ^V Next Page ^U UnCut TextM-| First Line
  22. ^X Exit      ^R Read File ^Y Prev Page ^K Cut Text  ^C Cur Pos   M-? Last Line
复制代码
回复

使用道具 举报

 楼主| 发表于 2012-9-15 11:42:59 | 显示全部楼层
本帖最后由 ONLY 于 2012-9-15 11:56 编辑
回复  ONLY

在VB里折腾到
将fstab文件中除了前面是#注释符的行都删掉,粘贴下面的内容:
由于删除把带#的 ...
金鹏 发表于 2012-9-14 17:30


如果在安装过程中意外关闭putty,那么再开新的putty窗口,然后执行下面的命令:
  1. mount /dev/sda3 /mnt/gentoo
  2. mount /dev/sda1 /mnt/gentoo/boot
  3. swapon /dev/sda2
  4. mount -t proc none /mnt/gentoo/proc
  5. chroot /mnt/gentoo /bin/bash
  6. env-update && source /etc/profile
复制代码
后面就从chroot环境接着进行即可~~~

fstab文件修改好后的内容应该如下所示:

GNU nano 2.3.1              File: /etc/fstab

# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed); notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>                  <mountpoint>    <type>          <opts>          <dump/p$

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda1   /boot     ext3    noauto,noatime     1 2
/dev/sda3   /         ext3    noatime            0 1
/dev/sda2   none      swap    sw                 0 0


^G Get Help  ^O WriteOut  ^W Where Is  ^V Next Page ^U UnCut TextM-| First Line
^X Exit      ^R Read File ^Y Prev Page ^K Cut Text  ^C Cur Pos   M-? Last Line


上面蓝色的便是修改后的内容~~~

在Linux的各种配置文件中,前面带#提示符的一般都是注释行,可要可不要,即便删除也木问题的~~~
回复

使用道具 举报

发表于 2012-9-15 15:43:31 | 显示全部楼层
本帖最后由 金鹏 于 2012-9-15 15:48 编辑

回复 20# ONLY

grub木有?输入nano -w /boot/grub/grub.conf回车后里面一片空白

搞了几次都不行,求解
  1. livecd linux # cp arch/x86/boot/bzImage /boot/kernel
  2. livecd linux # nano -w /etc/fstab
  3. livecd linux # cd /etc
  4. livecd etc # cd init.d
  5. livecd init.d # ln -s net.lo net.eth0
  6. livecd init.d # cd ../conf.d
  7. livecd conf.d # echo 'config_eth0="192.168.0.66 netmask 255.255.255.0 brd 192.16       8.0.66"' >> net
  8. livecd conf.d # echo 'routes_eth0="default via 192.168.0.1"' >> net
  9. livecd conf.d # echo 'hostname="BigBang"' > hostname
  10. livecd conf.d # rc-update add net.eth0 default
  11. * service net.eth0 added to runlevel default
  12. livecd conf.d # rc-update add sshd default
  13. * service sshd added to runlevel default
  14. livecd conf.d # rc-update add syslog-ng default
  15. * rc-update: service `syslog-ng' does not exist
  16. livecd conf.d # rc-update add vixie-cron default
  17. * rc-update: service `vixie-cron' does not exist
  18. livecd conf.d # passwd
  19. New password:
  20. BAD PASSWORD: it is too short
  21. BAD PASSWORD: is a palindrome
  22. Retype new password:
  23. passwd: password updated successfully
  24. livecd conf.d # nano -w /boot/grub/grub.conf
  25.   GNU nano 2.3.1             File: /boot/grub/grub.conf                      Modified

  26. default 0
  27. timeout 5

  28. title Gentoo Linux
  29. root (hd0,0)
  30. kernel /boot/kernel root=/dev/sda3


  31.            [ Error writing /boot/grub/grub.conf: No such file or directory ]
  32. ^G Get Help   ^O WriteOut   ^W Where Is   ^V Next Page  ^U UnCut Text M-| First Line
  33. ^X Exit       ^R Read File  ^Y Prev Page  ^K Cut Text   ^C Cur Pos    M-? Last Line

复制代码
回复

使用道具 举报

 楼主| 发表于 2012-9-15 17:47:44 | 显示全部楼层
本帖最后由 ONLY 于 2012-9-15 17:50 编辑

回复 21# 金鹏

在前面的步骤中,安装grub了么?

  • 输入下面的命令更新软件树:
    1. emerge --sync
    复制代码
  • 输入下面的命令安装核心源代码和必要的软件:
    1. emerge gentoo-sources grub grep syslog-ng vixie-cron portage samba
    复制代码
    这一步是比较耗时间的,网快U强的话大约在一个小时左右可以搞定。


这里安装了grub,后面才能用哦,木有安装的话,是不能用的哦~~~

另外,对/boot分区进行操作,需要先挂载:
  1. mount /boot
复制代码
如果是已经挂载,会出现已挂载的提示~~~
回复

使用道具 举报

发表于 2012-9-15 17:59:55 | 显示全部楼层
4P的技术储备已经具备,坐等4P主力舰订单
回复

使用道具 举报

发表于 2012-9-15 19:51:46 | 显示全部楼层
本帖最后由 mrks 于 2012-9-15 19:53 编辑
4P的技术储备已经具备,坐等4P主力舰订单
CCCP0081 发表于 2012-9-15 17:59


CCCP ? 81? 封锁 fah 服务器的共x党的人?
回复

使用道具 举报

发表于 2012-9-15 20:15:08 | 显示全部楼层
回复 22# ONLY

图上操作都按照教程进行的

捕获.PNG


重装三次都是卡在 nano -w /boot/grub/grub.conf  这里,打开后是空白,编辑后不能保存
回复

使用道具 举报

发表于 2012-9-15 21:12:09 | 显示全部楼层
CCCP ? 81? 封锁 fah 服务器的共x党的人?
mrks 发表于 2012-9-15 19:51



    共X匪关我蛋蛋事。服务器又关我蛋蛋事。好吧,我承认是我封了卡扎菲的服务器
回复

使用道具 举报

 楼主| 发表于 2012-9-15 22:06:41 | 显示全部楼层
本帖最后由 ONLY 于 2012-9-15 22:07 编辑
回复  ONLY

图上操作都按照教程进行的




重装三次都是卡在 nano -w /boot/grub/grub.conf  这里,打开 ...
金鹏 发表于 2012-9-15 20:15


输入下面的命令,看看屏幕有什么输出:

mount /boot
ls -l /boot
回复

使用道具 举报

发表于 2012-9-16 05:56:29 | 显示全部楼层
共X匪关我蛋蛋事。服务器又关我蛋蛋事。好吧,我承认是我封了卡扎菲的服务器 ...
CCCP0081 发表于 2012-9-15 21:12


不要激动嘛,不是共X匪,那就是正经好人咯。
回复

使用道具 举报

 楼主| 发表于 2012-9-17 19:02:07 | 显示全部楼层
本帖最后由 ONLY 于 2012-9-17 19:05 编辑
回复  ONLY

图上操作都按照教程进行的

重装三次都是卡在 nano -w /boot/grub/grub.conf  这里,打开 ...
金鹏 发表于 2012-9-15 20:15


刚才按着教程在虚拟机中重新安装一遍,知道了问题所在~~~

在编辑/etc/fstab文件那步,由于Windows和Linux对回车的处理不同,造成复制下来的fstab文件内容变成了一行,而不是教程中的三行~~~

见图如下:

快照45.jpg

默认的/etc/fstab文件,内含三行示例,为无效内容,需要全部删除(使用Backspace键和Delete键删除)~~~

快照46.jpg

无效内容删除后如上图所示~~~

快照47.jpg

然后在putty中复制/粘贴正确的fstab文件内容~~~

这里需要注意的是,由于Discuz论坛程序处理回车的代码不同,所以直接复制过去,在putty中粘贴时会变成一行~~~   

由于/boot分区的信息错误,所以就造成了后面在修改grub启动信息时,无法正确加载/boot分区,或者加载后无法进行读写操作~~~

解决办法:

使用记事本之类的程序进行“中转”~~~

先将/etc/fstab文件内容复制到记事本中,手动敲回车进行分行,如下图:

快照51.jpg

分行完毕,再用putty复制/粘贴,并保存退出。

对于/boot/grub/grub.con文件,大致情况类似,如下图,为默认的文件内容:

快照48.jpg

只需要在这个文件中,相应的修改对应行的内容即可,修改完毕后的内容如下图所示:

快照50.jpg
回复

使用道具 举报

发表于 2012-9-17 22:34:26 | 显示全部楼层
回复 29# ONLY

putty中复制/粘贴正确的fstab文件内容我注意到了,并且是分行黏贴的,保存时和兄弟的截图一致,
就是到编辑输入nano -w /boot/grub/grub.conf回车后里面一片空白,内容也是分行黏贴进去的,保存时提示目录不存在,我用mkdir /boot/grub 建立了目录后也不能保存
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 新注册用户

本版积分规则

论坛官方淘宝店开业啦~
欢迎大家多多支持基金会~

Archiver|手机版|小黑屋|中国分布式计算总站 ( 沪ICP备05042587号 )

GMT+8, 2025-5-8 19:27

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表