亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 4167 | 回復: 3
打印 上一主題 下一主題

Linux from scratch livecd 安裝到硬盤 [復制鏈接]

論壇徽章:
0
跳轉到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2011-03-03 07:33 |只看該作者 |倒序瀏覽
1、用livecd啟動光盤,啟動系統(tǒng)

2、安裝網(wǎng)絡
net-setup

3、啟動ssh服務

/etc/rc.d/init.d/sshd start

4、設置root密碼
passwd

根據(jù)提示輸入你設置的密碼

5、通過遠程的ssh客戶端連接到機器

6、創(chuàng)建3個路徑

mkdir -v /livehd
mkdir -v /livecd
mkdir -v /sources

7、為空硬盤分區(qū)
使用cfdisk或fdisk ,建議使用cfdisk

建一個主分區(qū)加掛/                      存放系統(tǒng)及程序,  設置boot標志,意思可以啟動,不小于40G
建一個交換分區(qū)                           2G
剩下空間建一擴展分區(qū),用來建其它邏輯分區(qū),用于存放數(shù)據(jù)
建一個邏輯分區(qū)加掛/sources    存放源碼

8、對分區(qū)進行格式化
這里對磁盤使用xfs格式


# mkfs.xfs /dev/sda1
meta-data=/dev/sda1              isize=256    agcount=16, agsize=610344 blks
         =                       sectsz=512   attr=0
data     =                       bsize=4096   blocks=9765504, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096
log      =internal log           bsize=4096   blocks=4768, version=1
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0

創(chuàng)建交換分區(qū)

# mkswap /dev/sda5
Setting up swapspace version 1, size = 2048057 kB
no label, UUID=3e1a0984-a272-48e7-b3bc-e26c429b35f5
# mkfs.xfs /dev/sda6
meta-data=/dev/sda6              isize=256    agcount=16, agsize=305234 blks
         =                       sectsz=512   attr=0
data     =                       bsize=4096   blocks=4883744, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096
log      =internal log           bsize=4096   blocks=2560, version=1
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0

# mkfs.xfs /dev/sda7
meta-data=/dev/sda7              isize=256    agcount=16, agsize=363846 blks
         =                       sectsz=512   attr=0
data     =                       bsize=4096   blocks=5821536, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096
log      =internal log           bsize=4096   blocks=2842, version=1
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0

9、加掛上livecd和要安裝系統(tǒng)的硬盤/dev/sda1
我使用的是lfslivecd-x86-6.7,光盤啟動好后,已經(jīng)被掛載了/上。


光盤鏡像在/dev/shm/.cdrom/root.ext2
mount -o loop /dev/shm/.cdrom/root.ext2   /livecd

mount /dev/sda1  /livehd

10、系統(tǒng)復制到硬盤再做設置
cp -Rv /livecd/*      /livehd

11、加掛上設備
把dev設備掛上
mount -t  proc      proc              /livehd/proc
mount -t  sysfs   sysfs             /livehd/sys
mount -t  devpts devpts           /livehd/dev/pts
mount -t  tmpfs   tmpfs             /livehd/dev/shm
mount   --bind      /dev                /livehd/dev

掛上交換分區(qū)
swapon  /dev/sda5
# swapon -s
Filename                                Type            Size    Used    Priority
/dev/sda5                               partition       2000052 0       -1

12、切換到新的環(huán)境
chroot /livehd
創(chuàng)建boot目錄
mkdir /boot
加掛sources分區(qū)
mount /dev/sda6  /sources/

13、編譯一個新的內核
通過scp將linux內核linux-2.6.32.28.tar.bz2源碼
tar -xvf linux-2.6.32.28.tar.bz2
cd linux-2.6.32.28

make mrproper   //清理配置

make menuconfig  //配置內核
                                  General setup   
                                   <*> Kernel .config support      
                                 
  •    BSD Process Accounting version 3 file format
                                      <*> Kernel .config support                                                                 
                   
  •    Enable access to .config through /proc/config.gz        
                                     
  • enable deprecated sysfs features which may confuse old userspace tools
                                      這些必須要選則
                                      [ ] Optimize for size    默認是選中狀態(tài),必須去掉,不需要為點啟動優(yōu)化內核大小
                                      xfs的內容必須全部創(chuàng)建進內核  使用*選中相關項,分區(qū)類型必須全部選擇,否則啟動時無法加掛root系統(tǒng)
                                      file system
                                                               =>
                                                      <*> XFS filesystem support                                                                 
                         
  •    XFS Quota support                                                                    
                         
  •    XFS POSIX ACL support                                                               
                         
  •    XFS Realtime subvolume support                                                      
                          []   XFS Debugging support (EXPERIMENTAL)

                                        Partition Types全選為了保險
                                                                   
                                                    
  • Advanced partition selection                                                           
                         
  •    Acorn partition support                                                              
                         
  •      Cumana partition support                                                           
                         
  •      EESOX partition support                                                            
                         
  •      ICS partition support                                                              
                         
  •      Native filecore partition support                                                  
                         
  •      PowerTec partition support                                                         
                         
  •      RISCiX partition support                                                           
                         
  •    Alpha OSF partition support                                                         
                         
  •    Amiga partition table support                                                        
                         
  •    Atari partition table support                                                        
                         
  •    Macintosh partition map support                                                      
                         
  •    PC BIOS (MSDOS partition tables) support                                             
                         
  •      BSD disklabel (FreeBSD partition tables) support                                   
                         
  •      Minix subpartition support                                                         
                         
  •      Solaris (x86) partition table support                                             
                         
  •      Unixware slices support                                                            
                         
  •    Windows Logical Disk Manager (Dynamic Disk) support                                 
                         
  •      Windows LDM extra logging                                                         
                         
  •    SGI partition support                                                               
                         
  •    Ultrix partition table support                                                      
                         
  •    Sun partition tables support
                                                    
  •    Karma Partition support                                                              
                         
  •    EFI GUID Partition support                                                           
                         
  •    SYSV68 partition table support     
                                              
                                       由于使用是scsi接口硬盤所以所有scsi的驅動都創(chuàng)建到內核
                                      device  driver
                                                             --- Fusion MPT device support                                                              
                                         <*>   Fusion MPT ScsiHost drivers for SPI                                                  
                                         <*>   Fusion MPT ScsiHost drivers for FC                                                   
                                         <*>   Fusion MPT ScsiHost drivers for SAS                                                  
                                          (12 Maximum number of scatter gather entries (16 - 12 (NEW)                           
                                         <*>   Fusion MPT misc device (ioctl) driver                                                
                                        
  •    Fusion MPT logging facility           
                                                 
                              ------   SCSI device support  --->                                 
                                                                            <*> RAID Transport Class                                                                  
                                                 -*- SCSI device support                                                                    
                                                 <*> SCSI target support                                                                    
                                                 
  • legacy /proc/scsi/ support                                                            
                                              *** SCSI support type (disk, tape, CD-ROM) ***                                         
                                                 <*> SCSI disk support                                                                     
                                                  <*> SCSI tape support                                                                     
                                  <*> SCSI OnStream SC-x0 tape support                                                      
                                  <*> SCSI CDROM support                                                                     
                                  
  •    Enable vendor-specific extensions (for SCSI CDROM)                                   
                                  <*> SCSI generic support                                                                  
                                  <*> SCSI media changer support                                                            
                                  
  • Probe all LUNs on each SCSI device                                                     
                                  
  • Verbose SCSI error reporting (kernel size +=12K)                                       
                                  
  • SCSI logging facility                                                                  
                                  
  • Asynchronous SCSI scanning                                                            
                                      SCSI Transports  --->                                                                  
                                  
  • SCSI low-level drivers  --->                                                           
                                  
  • PCMCIA SCSI adapter support  --->                                                      
                                  <*> SCSI Device Handlers  --->                                                            
                                  <*> OSD-Initiator library                                                                  
                                  <*>   OSD Upper Level driver   
            網(wǎng)絡設備驅動必須選擇你的網(wǎng)卡
             
    保存配置

    make
    時間相當長,需要耐心

    make modules_install

    cp -v arch/x86/boot/bzImage /boot/vmlinux-2.6.32.28-lfs-6.7
    cp -v System.map /boot/System.map-2.6.32.28
    cp -v .config /boot/config-2.6.32.28
    cd ..
    install -v -m755 -d /etc/modprobe.d
    cat > /etc/modprobe.d/usb.conf << "EOF"
    # Begin /etc/modprobe.d/usb.conf
    install ohci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i ohci_hcd ; true
    install uhci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i uhci_hcd ; true
    # End /etc/modprobe.d/usb.conf
    EOF

    15、安裝grub1.8
    tar xvf grub-1.98.tar.gz

    cd grub-1.98

    ./configure --prefix=/usr              \
                 --sysconfdir=/etc       \
                 --disable-grub-emu-usb  \
                 --disable-grub-fstest   \
                 --disable-efiemu

    make
    make install
    cd ..
    rm -rf grub-1.98


    16、fstab配置
    cat > /etc/fstab << "EOF"
    # Begin /etc/fstab
    # file system  mount-point  type    options         dump   fsck
    #                                                            
    /dev/sda1       /            xfs    defaults        1         1
    /dev/sda5       swap         swap   pri=1           0      
    proc            /proc        proc   defaults        0        0

    sysfs           /sys         sysfs  defaults        0        0

    devpts          /dev/pts     devpts gid=4,mode=620  0        0

    shm             /dev/shm     tmpfs  defaults        0        0

    # End /etc/fstab
    EOF

    16、grub配置
    這里要根據(jù)具體情況調整你安裝的硬盤分區(qū)
    grub-install --grub-setup=/bin/true /dev/sda1
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-setup /dev/sda


    17、linux-from scratch bootscrpt安裝
    tar xvf lfs-bootscripts-20100627.tar.bz2
    cd lfs-bootscripts-20100627
    make install
    cd ..
    rm -rf lfs-bootscripts-20100627

    18、設置bash下的鍵盤功能鍵設置
    cat > /etc/inputrc << "EOF"
    # Begin /etc/inputrc
    # Modified by Chris Lynn <roryo@roryo.dynup.net>
    # Allow the command prompt to wrap to the next line
    set horizontal-scroll-mode Off
    # Enable 8bit input
    set meta-flag On
    set input-meta On
    # Turns off 8th bit stripping
    set convert-meta Off
    # Keep the 8th bit for display
    set output-meta On
    # none, visible or audible
    set bell-style none
    # All of the following map the escape sequence of the value
    # contained in the 1st argument to the readline specific functions
    "\eOd": backward-word
    "\eOc": forward-word
    # for linux console
    "\e[1~": beginning-of-line
    "\e[4~": end-of-line
    "\e[5~": beginning-of-history
    "\e[6~": end-of-history
    "\e[3~": delete-char
    "\e[2~": quoted-insert
    # for xterm
    "\eOH": beginning-of-line
    "\eOF": end-of-line
    # for Konsole
    "\e[H": beginning-of-line
    "\e[F": end-of-line
    # End /etc/inputrc
    EOF

    19、時間設置(Configuring the setclock Script)

    cat > /etc/sysconfig/clock << "EOF"
    # Begin /etc/sysconfig/clock
    UTC=1
    # Set this to any options you might need to give to hwclock,
    # such as machine hardware clock type for Alphas.
    CLOCKPARAMS=
    # End /etc/sysconfig/clock
    EOF

    20、設置DNS

    根據(jù)實際情況
    cat > /etc/resolv.conf << "EOF"
    # Begin /etc/resolv.conf
    nameserver 61.139.2.69
    # End /etc/resolv.conf
    EOF

    重啟系統(tǒng),ok一切都在硬盤上

    請看原文:http://www.greewater.com/view.asp?id=2
  • 論壇徽章:
    381
    CU十二周年紀念徽章
日期:2014-01-04 22:46:58CU大;照
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大;照
日期:2013-03-14 14:08:55CU大;照
日期:2013-04-17 11:17:19CU大;照
日期:2013-04-17 11:17:32CU大;照
日期:2013-04-17 11:17:37CU大;照
日期:2013-04-17 11:17:42CU大;照
日期:2013-04-17 11:17:47CU大;照
日期:2013-04-17 11:17:52CU大;照
日期:2013-04-17 11:17:56
    2 [報告]
    發(fā)表于 2011-03-03 08:01 |只看該作者
    總結的太詳細了,收藏先.

    論壇徽章:
    0
    3 [報告]
    發(fā)表于 2011-03-22 11:54 |只看該作者

    論壇徽章:
    0
    4 [報告]
    發(fā)表于 2011-04-21 10:09 |只看該作者
    這里搞lfs也很少?lfs是我們學習掌握如何構建一個linux操作系統(tǒng)的入門功呀
    您需要登錄后才可以回帖 登錄 | 注冊

    本版積分規(guī)則 發(fā)表回復

      

    北京盛拓優(yōu)訊信息技術有限公司. 版權所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
    未成年舉報專區(qū)
    中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
    感謝所有關心和支持過ChinaUnix的朋友們 轉載本站內容請注明原作者名及出處

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP