linux 常用技巧

來源:互聯網
上載者:User

1 雙啟動

一是修改預設的啟動項,就是說預設是Windows呢,還是預設是Linux呢;第二個是修改啟動項的位置。其實這二個都不是什麼問題,需要修改Linux下的一個設定檔,該檔案是:/boot/grub/grub.conf,以文字檔方式開啟,我的grub.conf設定檔是:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,4)
#          kernel /vmlinuz-version ro root=/dev/hda7
#          initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=5
gfxmenu (hd0,4)/message
title RedFlag (2.6.22.6-1)
       root (hd0,4)
       kernel /vmlinuz-2.6.22.6-1 ro root=LABEL=/ vga=788 splash=silent
       initrd /initrd-2.6.22.6-1.img
title Windows Vista(SP1)
       rootnoverify (hd0,0)
       chainloader +1

注意從 #boot=/dev/hda 行看,default=1表示預設的啟動項是第二個,0表示第一個,1表示第二個,以此類推。
timeout=5表示預設的等待時間(單位秒)。再往下看,有兩個啟動項:

title RedFlag (2.6.22.6-1)
       root (hd0,4)
       kernel /vmlinuz-2.6.22.6-1 ro root=LABEL=/ vga=788 splash=silent
       initrd /initrd-2.6.22.6-1.img
這個是Linux啟動項,還有:
title Windows Vista(SP1)
       rootnoverify (hd0,0)
       chainloader +1
這個是Vista啟動項。

2  修改 啟動層級 linux

以管理員身份進入Linux,修改檔案:/etc/inittab
    找到“id:5:initdefault:”,其中的5就是X-Window,為預設運行層級,一般我們把5改為3即可。
    一共有7種啟動層級,分別為:
#   0 - halt (Do NOT set initdefault to this) 
#   1 - Single user mode 
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking) 
#   3 - Full multiuser mode 
#   4 - unused 
#   5 - X11 
#   6 - reboot (Do NOT set initdefault to this)

各個運行級的詳細解釋: 
0 為停機,機器關閉。 
1 為單一使用者模式,就像Win9x下的安全模式類似。 
2 為多使用者模式,但是沒有NFS支援。 
3 為完整的多使用者模式,是標準的運行級。 
4 一般不用,在一些特殊情況下可以用它來做一些事情。例如在膝上型電腦的電池用盡時,可以切換到這個模式來做一些設定。 
5 就是X11,進到X Window系統了。 
6 為重啟,運行init 6機器就會重啟。

0和6一般不用;
運行startx可啟動到層級5。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.