ข่าว: ข่าวประกาศ

  • 31 พฤษภาคม 2024, 04:10:38

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

ผู้เขียน หัวข้อ: สำหรับผู้ที่มีเวลาศึกษา Diskless  (อ่าน 13879 ครั้ง)

T@NR@K

  • ตัวแทนที่ได้รับการแต่งตั้ง
  • Hero Member
  • *****
  • กระทู้: 856
  • ทุกอย่างย่อมมีเหตุและผล
    • MSN Messenger - tonrak_ms@hotmail.com
    • ดูรายละเอียด
    • TONRAK Networks : เปิดร้านเน็ต เปิดร้านเกมส์ เปิดร้านอินเตอร์เน็ต ระบบ network ระบบ no hdd
สำหรับผู้ที่มีเวลาศึกษา Diskless
« เมื่อ: 15 มิถุนายน 2009, 21:16:17 »
What is diskless booting?

Diskless booting is using a remote system or systems to store the kernel and the filesystem that will be used on other computer(s).

Why do it?

Imagine my case I admin about 25 public workstations for a local library, if they want something changed across the board I can either go sit at each PC and spend X minutes on it, adding up to who knows how many hours, or I can simply make the change at any one of the 25 systems and have it effect every system equally. The same goes for updates and many other operations. It really eases support issues.

Getting Started

• Install the required packages

โค๊ด: [Select]
apt-get install dhcp3-server tftpd-hpa syslinux nfs-kernel-server initramfs-tools
• Configure your DHCP server

โค๊ด: [Select]
allow booting;
allow bootp;

subnet 192.168.2.0 netmask 255.255.255.0 {
  range 192.168.2.xxx 192.168.2.xxx;
  option broadcast-address 192.168.2.255;
  option routers 192.168.2.xxx;
  option domain-name-servers 192.168.2.xxx;

  filename "/pxelinux.0";
}

# force the client to this ip for pxe.
# This is only necessary assuming you want to send different images to different computers.
host pxe_client {
  hardware ethernet xx:xx:xx:xx:xx:xx;
  fixed-address 192.168.2.xxx;
}

• Configure the TFTP Server

โค๊ด: [Select]
#Defaults for tftpd-hpa
RUN_DAEMON="yes"
OPTIONS="-l -s /tftpboot"

• Configure your tftp root directory

โค๊ด: [Select]
mkdir -p /tftpboot/pxelinux.cfg
โค๊ด: [Select]
cp /usr/lib/syslinux/pxelinux.0 /tftpboot
โค๊ด: [Select]
LABEL linux
KERNEL vmlinuz-2.6.15-23-686
APPEND root=/dev/nfs initrd=initrd.img-2.6.15-23-686 nfsroot=192.168.2.2:/nfsroot ip=dhcp rw

โค๊ด: [Select]
chmod -R 777 /tftpboot
โค๊ด: [Select]
/etc/init.d/tftp-hpa start
• Configure OS root

โค๊ด: [Select]
mkdir /nfsroot
โค๊ด: [Select]
/nfsroot             192.168.2.xxx(rw,no_root_squash,async)
โค๊ด: [Select]
exportfs -rv
• Creating your NFS installation

โค๊ด: [Select]
ls -ltr /boot/vmlinuz-*
-rw-r--r-- 1 root root 1745100 2007-04-15 03:07 /boot/vmlinuz-2.6.20-15-generic
-rw-r--r-- 1 root root 1746636 2007-06-07 15:58 /boot/vmlinuz-2.6.20-16-generic
sudo cp /boot/vmlinuz-2.6.20-16-generic /home/<USERNAME>

• Create an initrd.img file

โค๊ด: [Select]
# 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

โค๊ด: [Select]
mkinitramfs -o /home/<USERNAME>/initrd.img-2.6.20-16-generic
• Copy OS files to the server

โค๊ด: [Select]
mount -tnfs -onolock 192.168.1.2:/nfsroot /mnt
cp -ax /. /mnt/.
cp -ax /dev/. /mnt/dev/.

• Copy kernel and initrd to tftp root

โค๊ด: [Select]
cp /nfsroot/home/<USERNAME>/<vmlinuz-xxxx> /tftpboot/
cp /nfsroot/home/<USERNAME>/<initrd.img-xxxx> /tftpboot/

• Modify /nfsroot/etc/network/interfaces

โค๊ด: [Select]
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface, commented out for NFS root
#auto eth0
#iface eth0 inet dhcp
iface eth0 inet manual

• Configure fstab

โค๊ด: [Select]
# /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

* Setup your client Enter your BIOS settings and configure your system to boot from LAN
* If you have options for different LAN boot methods choose PXE

• Adding a swap file

โค๊ด: [Select]
apt-get install dphys-swapfile
โค๊ด: [Select]
losetup /dev/loop0 /var/swap
โค๊ด: [Select]
swapon /dev/loop0
• Static IP

โค๊ด: [Select]
ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
<client-ip> IP address of the client. If empty, the address will

either be determined by RARP/BOOTP/DHCP. What protocol
is used de- pends on the <autoconf> parameter. If this parameter is not empty, autoconf will be used.

<server-ip> IP address of the NFS server. If RARP is used to

determine the client address and this parameter is NOT empty only replies from the specified server are accepted. To use different RARP and NFS server, specify your RARP server here (or leave it blank), and specify your NFS server in the `nfsroot' parameter (see above). If this entry is blank the address of the server is used which answered the RARP/BOOTP/DHCP request.
<gw-ip> IP address of a gateway if the server is on a different

subnet. If this entry is empty no gateway is used and the server is assumed to be on the local network, unless a value has been received by BOOTP/DHCP.
<netmask> Netmask for local network interface. If this is empty,

the netmask is derived from the client IP address assuming classful addressing, unless overridden in BOOTP/DHCP reply.
<hostname> Name of the client. If empty, the client IP address is

used in ASCII notation, or the value received by BOOTP/DHCP.
<device> Name of network device to use. If this is empty, all

devices are used for RARP/BOOTP/DHCP requests, and the first one we receive a reply on is configured. If you have only one device, you can safely leave this blank.
<autoconf> Method to use for autoconfiguration. If this is either

'rarp', 'bootp', or 'dhcp' the specified protocol is used. If the value is 'both', 'all' or empty, all protocols are used. 'off', 'static' or 'none' means no autoconfiguration.


abiz

  • บุคคลทั่วไป
Re: สำหรับผู้ที่มีเวลาศึกษา Diskless
« ตอบกลับ #1 เมื่อ: 17 มิถุนายน 2009, 21:51:31 »
ขอบคุณครับ

อยากศึกษาแต่งงครับ มีป้ายกำกับที่เป็นภาษาไทยบ้างมั้ยครับ

แล้วคุณ tonrak

ใช้เจ้าของสถานที่แห่งนี้ด้วยหรือเปล่าครับ www.tonrak.net

ถ้าเข้าใจผิดก็ขออภัยด้วยครับ

Man_Utd007

  • Customer Lv.1
  • Sr. Member
  • ***
  • กระทู้: 452
    • ดูรายละเอียด
    • อีเมล์
Re: สำหรับผู้ที่มีเวลาศึกษา Diskless
« ตอบกลับ #2 เมื่อ: 17 มิถุนายน 2009, 22:10:54 »
เว็บสวยมากครับ  ;D
ความรู้ ไม่ค้นหา ไม่มีวันเจอ

nevermore

  • Customer Lv.4
  • Full Member
  • *****
  • กระทู้: 101
    • ดูรายละเอียด
Re: สำหรับผู้ที่มีเวลาศึกษา Diskless
« ตอบกลับ #3 เมื่อ: 19 มิถุนายน 2009, 01:47:05 »
ผมทำได้หมดแล้วครับ เหลือแต่ให้มัน Recovery ตอนใช้งานเสร็จครับ

abiz

  • บุคคลทั่วไป
Re: สำหรับผู้ที่มีเวลาศึกษา Diskless
« ตอบกลับ #4 เมื่อ: 19 มิถุนายน 2009, 03:19:17 »
ไหน ๆ เอามาสอน เอาศึกษาหน่อย สิ

 :o :o :o :o ::) ::) ::) ::)

T@NR@K

  • ตัวแทนที่ได้รับการแต่งตั้ง
  • Hero Member
  • *****
  • กระทู้: 856
  • ทุกอย่างย่อมมีเหตุและผล
    • MSN Messenger - tonrak_ms@hotmail.com
    • ดูรายละเอียด
    • TONRAK Networks : เปิดร้านเน็ต เปิดร้านเกมส์ เปิดร้านอินเตอร์เน็ต ระบบ network ระบบ no hdd
Re: สำหรับผู้ที่มีเวลาศึกษา Diskless
« ตอบกลับ #5 เมื่อ: 13 ตุลาคม 2009, 21:27:06 »
ขอบคุณครับ

อยากศึกษาแต่งงครับ มีป้ายกำกับที่เป็นภาษาไทยบ้างมั้ยครับ

แล้วคุณ tonrak

ใช้เจ้าของสถานที่แห่งนี้ด้วยหรือเปล่าครับ www.tonrak.net

ถ้าเข้าใจผิดก็ขออภัยด้วยครับ

♣ สมความปรารถนาแล้วนะครับท่าน imagine  ;D  ;D

♣ สำหรับเว็บเจ้าเดียวกันครับ ศึกษาไปเรื่อยๆ ครับ ลองทำกราฟฟิกดู

♣ เผื่อติดยศกับเขา จะได้มีพื้นที่บริหารงานครับ  ;D  ;D  ;D