[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
# 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
auto eth1
iface eth1 inet dhcp
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
broadcast 192.168.0.255
network 192.168.0.0
[/dropshadowbox]
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
# apt-get install btrfs-tools
[/dropshadowbox]
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
root@hannim:~# blkid /dev/sde1/dev/sde1: UUID=”5ee9b839-e651-4263-ac84-40e1ee51fcdc” UUID_SUB=”114eab71-8465-402b-a46c-392af5551c9a” TYPE=”btrfs”
fstab을 열어서 아래처럼 추가 한다.
root@hannim:~# vi /etc/fstab
UID=’5ee9b839-e651-4263-ac84-40e1ee51fcdc’ /pxe btrfs defaults 0 1
[/dropshadowbox]
작업을 위해 마운트를 한다.
roo@hannim:~# mount /dev/sde1 /pxe
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
# mkdir /pxe/iscsi
# chmod 755 /pxe/iscsi
# btrfsctl -S blank /pxe/iscsi
# chmod 755 /pxe/iscsi/blank
[/dropshadowbox]
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
# dd if=/dev/zero of=/pxe/iscsi/blank/sde.img bs=1048576 count=300000
[/dropshadowbox]
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
# cd /pxe/iscsi
# btrfsctl -s Win8 blank
[/dropshadowbox]
blank 를 Win8 으로 복제(클론)합니다.
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
# apt-get install iscsitarget
[/dropshadowbox]
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
ISCSITARGET_ENABLE=true
[/dropshadowbox]
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
Target iqn.1991-01.com.example:Win8
Lun 0 Path=/pxe/iscsi/Win8/sde.img,Type=fileio
Alias Win8
MaxConnections 1
[/dropshadowbox]
Target iqn 부분의 1991-01 은 도메인 획득 년도를 의미하지만 그냥 아무거나 써도 됩니다.
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
# service iscsitarget restart
[/dropshadowbox]
http://www.rom-o-matic.net/gpxe/gpxe-git/gpxe.git/contrib/rom-o-matic/ 에서 아래처럼 세팅하고 를 다운로드받습니다.
다운받은 파일을 gpex.kpxe 로 변경하고 /tftpboot 디렉토리에 넣어둡니다. 다운받은 직후의 파일명은 아마 gpxe-1.0.1+-gpxe.kpxe 와 같이 돼 있을 겁니다. gpex.kpxe 로 이름을 바꿉니다.
현재 우분투 서버 에디션이 설치된 머신에서 직접 다운로드받기 어려우니까 SFTP 로 올리시던지 하세요.
아니면 웹서버에 올려놓고 wget 으로 받아오시거나요. 더 이상의 자세한 설명은 생략합니다.
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
#mkdir /tftpboot
#chmod 777 /tftpboot
[/dropshadowbox]
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
# apt-get install isc-dhcp-server
# apt-get install tftpd xinetd tftp
[/dropshadowbox]
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
subnet 192.168.0.0 netmask 255.255.255.0 {
range dynamic-bootp 192.168.0.2 192.168.0.254;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
}
host Win8 {
hardware ethernet 08:00:2B:86:55:DB;
fixed-address 192.168.0.13;
option host-name “Win8”;
if exists user-class and option user-class = “gPXE” {
filename “”;
option root-path “iscsi:192.168.0.1::::iqn.1991-01.com.example:Win8”;
} else {
filename “gpex.kpxe”;
}
}
[/dropshadowbox]
08:00:2B:86:55:DB 가 아까 적어놓으라고 했던 클라이언트의 MAC주소입니다.
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
}
[/dropshadowbox]
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
# /etc/init.d/xinetd restart
[/dropshadowbox]
[dropshadowbox align=”left” effect=”curled” width=”100%” height=”” background_color=”#c6c0c0″ border_width=”1″ border_color=”#dddddd” ]
# service isc-dhcp-server restart
[/dropshadowbox]