Linux无盘工作站(02)

Disk Ubuntu

The configuration of PXE linux server is all the same, only the creation of boot file system is different.


The Ubuntu version is Ubuntu 12.04 LTS 32


1. Install the required packages

sudo apt-get install dhcp3-server tftpd-hpa syslinux nfs-kernel-server initramfs-tools nfs-common


2. Copy current kernel version to home directory

sudocp /boot/vmlinuz-3.11.0-18-generic ~


3. Create an initrd.img file


(1)change the BOOT flag to nfs in /etc/initramfs-tools/initramfs.conf

   #
   # BOOT: [ local | nfs ]
   #
   # local - Boot off of local media (harddrive, USB stick).
   #
   # nfs - Boot using an NFS drive as the root of the drive.
   #

    BOOT=nfs


  
(2)Change the MODULES flag to netboot in /etc/initramfs-tools/initramfs.conf 
  #
   # MODULES: [ most | netboot | dep | list ]
   #
   # most - Add all framebuffer, acpi, filesystem, and harddrive drivers.
   #
   # dep - Try and guess which modules to load.
   #
   # netboot - Add the base modules, network modules, but skip block devices.
   #
   # list - Only include modules from the 'additional modules' list
   #

    MODULES=netboot

4. Run mkinitramfs

  
mkinitramfs -o ~/initrd.img-3.11.0-18-generic
5. Copy OS files to the server
   mount -t nfs -onolock 10.10.10.11:/nfsroot /mnt
   cp -ax /. /mnt/.
   cp -ax /dev/. /mnt/dev/.



6. Copy kernel and initrd to tftp root

sudo cp ~/ vmlinuz-3.11.0-18-generic /tftpboot/

sudo cp ~/initrd.img-3.11.0-18-generic /tftpboot/



7. Configure fstab

      # /etc/fstab: static file system information.
   #
   # <file system> <mount point>   <type>  <options>       <dump>  <pass>
   proc            /proc           proc    defaults        0       0
   /dev/nfs       /               nfs    defaults          1       1
   none            /tmp            tmpfs   defaults        0       0 
   none            /var/run        tmpfs   defaults        0       0
   none            /var/lock       tmpfs   defaults        0       0
   none            /var/tmp        tmpfs   defaults        0       0
   /dev/hdc        /media/cdrom0   udf,iso9660 user,noauto 0       0


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值