Wednesday, November 12, 2014

PXE Setup

PXE legacy/uefi NFS[RHEL6.4]
PXE legacy/uefi HTTP/FTP[RHEL6.4]
Set up Pxe Server with RHEL7.X/ Centos7.X HTTP

Set up Pxe Server with kicstart automation (uefi /legacy ) NFS

introduce folder and create folder: 
[root@localhost ~]# cd /
[root@localhost /]# mkdir /install/nfs_share
[root@localhost /]# mkdir /install/tftpboot

/install/nfs_share  ==>put kicstart file, and out centos images
/install/tftpboot ==>put your pxe menu page

1.Disable Firewall:
[root@localhost ~]# service iptables stop

2.Disable SELinux
[root@localhost ~]# setenforce 0

3. copy cdrom file from dvd rom into desktop
[root@localhost ~]# cp –av /media/CentOS_6.4_Final /*

4.Convert centos images folder into iso file
command: mkisofs –r –o [filename].iso /[file destination/
[root@localhost ~]# mkisofs –r –o Centos_6.4.iso / CentOS_6.4_Final

5. Set your ip address.
Eth0 set 192.168.2.1, mask: 24, gateway: 192.168.2.254
Eth1: set 192.168.1.1, mask: 24, gateway: 192.168.1.254
Reboot DUT

6.DHCP service
[root@localhost ~]#vi /etc/sysconfig/dhcpd
DHCPD_INTERFACE="et01 eth1"
[root@localhost ~]# vi /etc/dhcp/dhcpd.conf

dhcpd.conf: 

ignore client-updates;
ddns-update-style interim;
default-lease-time 259200;
max-lease-time 518400;
option arch code 93 = unsigned integer 16;
next-server 192.168.2.1;
subnet 192.168.2.0 netmask 255.255.255.0 {
range dynamic-bootp 192.168.2.2 192.168.2.200;
if option arch = 00:07{

#for uefi
filename "BOOTX64.efi";
}else{

#for legacy
filename "pxelinux.0";
}


}

7. TFTP service
[root@localhost ~]# vim /etc/xinetd.d/tftp

tftp:
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /install/tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}

8. Create tftpboot directory

[root@localhost tftpboot]# chcon --reference /var/lib/tftpboot /install/tftpboot
[root@localhost /]# cp /usr/share/syslinux/menu.c32 /usr/share/syslinux/vesamenu.c32 /usr/share/syslinux/pxelinux.0 /install/tftpboot/
[root@localhost /]# mkdir /install/tftpboot/pxelinux.cfg
[root@localhost /]# mount -o loop Centos_6.4.iso /mnt/
[root@localhost /]# mkdir -p /install/tftpboot/kernel/centos6.4
[root@localhost /]# cp /mnt/isolinux/vmlinuz /install/tftpboot/kernel/centos6.4
[root@localhost /]# cp /mnt/isolinux/initrd.img /install/tftpboot/kernel/centos6.4
[root@localhost /]# cp /mnt/isolinux/isolinux.cfg /install/tftpboot/pxelinux.cfg/
[root@localhost /]# cp /mnt/isolinux/boot.msg /install/tftpboot/
[root@localhost /]# cp /mnt/EFI/BOOT/*.* /install/tftpboot/
[root@localhost /]# cp /efidefault /insatll/tftpboot/

9.NFS service
[root@localhost /]# mkdir -p /install/nfs_share/centos6.4
[root@localhost /]# vim /etc/fstab

fstab:
/dev/mapper/VolGroup-lv_root / ext4 defaults 1 1
UUID=46cb1b57-c057-4963-9682-23d850a3fc9d /boot ext4 defaults 1 2
/dev/mapper/VolGroup-lv_home /home ext4 defaults 1 2
/dev/mapper/VolGroup-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
#add this line
/Centos_6.4.iso /install/nfs_share/centos6.4 iso9660 defaults,loop 0 0

to enable mount
[root@localhost /]# mount -a
#check to see if it is mounted
[root@localhost /]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
51606140 16999308 31985392 35% /
tmpfs 987372 228 987144 1% /dev/shm
/dev/sda1 495844 39677 430567 9% /boot
/dev/mapper/VolGroup-lv_home
184350796 191852 174794464 1% /home
/Centos_6.4.iso 3681792 3681792 0 100% /install/nfs_share/centos6.4


9.Edit exports
[root@localhost /]# vim /etc/exports

[root@localhost /]# mkdir -p /home/leopard

exports:
#/install/nfs_share/ 192.168.2.*(ro)
/install/nfs_share/ 192.168.2.0/24(ro,async,nohide,crossmnt) localhost(ro,async,nohide,crossmnt)
/home/leopard *(rw,no_root_squash,sync)

10.   Set up UEFI and Legacy configure menu boot

Set up UEFI PXE configuration
[root@localhost /]# cd /install/tftpboot
[root@localhost tftpboot]# vi efidefault

#debug --graphics
default=0
#splashimage=(nd)/splash.xpm.gz
timeout 40
#hiddenmenu

title [Leopard_uEFI] CentOS 6.4 x64 for SOL kickstart
root (nd)
kernel /kernel/centos6.4/vmlinuz ip=dhcp ks=nfs:192.168.2.1:/install/nfs_share/sol.ks text console=ttyS1,57600
initrd /kernel/centos6.4/initrd.img

title [Leopard_uEFI] CentOS 6.4 x64 for com kickstart
root (nd)
kernel /kernel/centos6.4/vmlinuz ip=dhcp ks=nfs:192.168.2.1:/install/nfs_share/com.ks text console=ttyS0,57600
initrd /kernel/centos6.4/initrd.img

title [Leopard_uEFI] CentOS 6.4 x64 manual
root (nd)
kernel /EFI_kernel/centos64x64/vmlinuz ip=dhcp method=nfs:192.168.2.1:/images/centos64x64
initrd /EFI_kernel/centos64x64/initrd.img

title [Leopard_uEFI] CentOS 6.4 x64 for guifullap
root (nd)
kernel /kernel/centos6.4/vmlinuz ip=dhcp ks=nfs:192.168.2.1:/install/nfs_share/guifullap.cfg 
initrd /kernel/centos6.4/initrd.img

 Set up  legacy BIOS PXE configuration
[root@localhost /]# cd /install/tftpboot/pxelinux.cfg
[root@localhost pxelinux.cfg]# vi default

default menu.c32
    prompt 0
    timeout 300
    
      menu title ==== Boot Menu ====

#LABEL 1)CENTOSX64 LEDGACY (NFS method)   
#MENU  [Leopard_uEFI] CentOS 6.4 x64 for SOL kickstart
#kernel /kernel/centos6.4/vmlinuz ip=dhcp ks=nfs:192.168.2.1:/install/nfs_share/sol.ks text console=ttyS1,57600
#initrd /kernel/centos6.4/initrd.img

LABEL 1) Boot from local drive
   menu label ^2) Boot from local drive
   localboot

LABEL 2) CentOS 6.4 x64 final SOL kickstart(http:// method)
kernel kernel/centos6.4/vmlinuz
append initrd=kernel/centos6.4/initrd.img text quiet console=ttyS1,57600n8 ks=nfs://192.168.2.1:/install/nfs_share/sol.ks

LABEL 2) CentOS 6.4 x64 final SOL kickstart(http:// method)
kernel kernel/centos6.4/vmlinuz
append initrd=kernel/centos6.4/initrd.img text quiet console=ttyS0,57600n8 ks=nfs://192.168.2.1:/install/nfs_share/com.ks

LABEL 4) CentOS 6.4 x64 final manual (http:// method)
kernel kernel/centos6.4/vmlinuz
append initrd=kernel/centos6.4/initrd.img method=nfs://192.168.2.1:/Centos6.4 ip=dhcp

11. kickstart setup
[root@localhost /]# cp /sol.ks com.ks /install/nfs_share/


11.vftfp setup (put driver inside ftp)
[root@localhost /]#cp /V9_20141028.tar /var/ftp

12.chkconfig setup (enable services)
[root@localhost /]# chkconfig xinetd on
[root@localhost /]# chkconfig tftp on
[root@localhost /]# chkconfig rpcbind on
[root@localhost /]# chkconfig nfs on
[root@localhost /]# chkconfig rpcidmapd on
[root@localhost /]# chkconfig nfslock on
[root@localhost /]# chkconfig vsftpd on
[root@localhost /]# chkconfig dhcpd on

13.Reboot server or start service
[root@localhost ~]# /etc/init.d/dhcpd restart
[root@localhost tftpboot]# /etc/init.d/xinetd restart
[root@localhost /]# /etc/init.d/rpcbind restart
[root@localhost /]# /etc/init.d/nfs restart
[root@localhost /]# /etc/init.d/rpcidmapd restart
[root@localhost /]# /etc/init.d/nfslock restart

# make sure vsftpd services is running
[root@localhost /]# /etc/init.d/vsftpd start

14 give permission to kernel
chmod 777 /install/tftpboot/kernel
chmod 777 /install/tftpboot/kernel/centos6.4

_______________________________________________________________________

Set up Pxe Server with kicstart automation (uefi /legacy ) HTTP

introduce folder and create folder: 
[root@localhost ~]# cd /
[root@localhost /]# mkdir /tftpboot


1.Disable Firewall:
[root@localhost ~]# service iptables stop

2.Disable SELinux
[root@localhost ~]# setenforce 0

3. copy cdrom file from dvd rom into desktop, and create into iso filoe
[root@localhost ~]# mkdir /var/www/html/Centos6.4
[root@localhost ~]# cd /var/www/html
[root@localhost html]# mkisofs -r -o /centos6.4.iso Centos6.4/

4. Set your ip address.
Eth0 set 192.168.2.1, mask: 24, gateway: 192.168.2.254
Eth1: set 192.168.1.1, mask: 24, gateway: 192.168.1.254
Reboot DUT

5.DHCP service
[root@localhost ~]#vi /etc/sysconfig/dhcpd
DHCPD_INTERFACE="et01 eth1"
[root@localhost ~]# vi /etc/dhcp/dhcpd.conf

dhcpd.conf: 

ignore client-updates;
ddns-update-style interim;
default-lease-time 259200;
max-lease-time 518400;
option arch code 93 = unsigned integer 16;
next-server 192.168.2.1;
subnet 192.168.2.0 netmask 255.255.255.0 {
range dynamic-bootp 192.168.2.2 192.168.2.200;
if option arch = 00:07{

#for uefi
filename "BOOTX64.efi";
}else{

#for legacy
filename "pxelinux.0";
}


}

6. TFTP service
[root@localhost ~]# vim /etc/xinetd.d/tftp

tftp:
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /install/tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}

7. Create tftpboot directory

[root@localhost tftpboot]# chcon --reference /var/lib/tftpboot /tftpboot
[root@localhost /]# cp /usr/share/syslinux/menu.c32 /usr/share/syslinux/vesamenu.c32 /usr/share/syslinux/pxelinux.0 /tftpboot/
[root@localhost /]# mkdir /tftpboot/pxelinux.cfg
[root@localhost /]# mkdir -p /tftpboot/kernel/centos6.4
[root@localhost /]# cp /mnt/isolinux/vmlinuz /tftpboot/kernel/centos6.4
[root@localhost /]# cp /mnt/isolinux/initrd.img /tftpboot/kernel/centos6.4
[root@localhost /]# cp /mnt/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/
[root@localhost /]# cp /mnt/isolinux/boot.msg /tftpboot/
[root@localhost /]# cp /mnt/EFI/BOOT/*.* /tftpboot/
[root@localhost /]# cp /efidefault /tftpboot/


8. Create file in httpd directory
[root@localhost /]#  cd /var/www/html
[root@localhost html]# mkdir Centos6.4
[root@localhost /]# mount -o loop centos6.4.iso /var/www/html/Centos6.4


fstab:
/dev/mapper/VolGroup-lv_root / ext4 defaults 1 1
UUID=46cb1b57-c057-4963-9682-23d850a3fc9d /boot ext4 defaults 1 2
/dev/mapper/VolGroup-lv_home /home ext4 defaults 1 2
/dev/mapper/VolGroup-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
#add this line

/centos6.4.iso /var/www/html/Centos6.4 iso9660 defaults,loop 0 0

9.   Set up UEFI and Legacy configure menu boot

Set up UEFI PXE configuration
[root@localhost /]# cd /install/tftpboot
[root@localhost tftpboot]# vi efidefault

#debug --graphics
default=0
#splashimage=(nd)/splash.xpm.gz
timeout 40
#hiddenmenu

title [Leopard_uEFI] CentOS 6.4 x64 for SOL kickstart 111
root (nd)
kernel /kernel/centos6.4/vmlinuz ip=dhcp ks=http://192.168.2.1/kickstart/centos6.4/sol.ks text console=ttyS1,57600
initrd /kernel/centos6.4/initrd.img

title [Leopard_uEFI] CentOS 6.4 x64 for com kickstart
root (nd)
kernel /kernel/centos6.4/vmlinuz ip=dhcp ks=http://192.168.2.1/kickstart/centos6.4/com.ks text console=ttyS0,57600
initrd /kernel/centos6.4/initrd.img

title [Leopard_uEFI] CentOS 6.4 x64 for guifullap
root (nd)
kernel /kernel/centos6.4/vmlinuz ip=dhcp ks=http://192.168.2.1/kickstart/centos6.4/guifullap.ks
initrd /kernel/centos6.4/initrd.img

title [Leopard_uEFI] CentOS 6.4 x64 for guifullap_manual
root (nd)
kernel /kernel/centos6.4/vmlinuz ip=dhcp method=http//192.168.2.1/Centos6.4
initrd /kernel/centos6.4/initrd.img

 Set up  legacy BIOS PXE configuration
[root@localhost /]# cd /install/tftpboot/pxelinux.cfg
[root@localhost pxelinux.cfg]# vi default
 default menu.c32
    prompt 0
    timeout 300
    
      menu title ==== Boot Menu ====

#LABEL 1)CENTOSX64 LEDGACY (NFS method)   
#MENU  [Leopard_uEFI] CentOS 6.4 x64 for SOL kickstart
#kernel /kernel/centos6.4/vmlinuz ip=dhcp ks=nfs:192.168.2.1:/install/nfs_share/sol.ks text console=ttyS1,57600
#initrd /kernel/centos6.4/initrd.img

LABEL 1) Boot from local drive
   menu label ^2) Boot from local drive
   localboot

LABEL 2) CentOS 6.4 x64 final (http:// method)
kernel kernel/centos6.4/vmlinuz
#append initrd=kernel/centos6.4/initrd.img \ method=http://192.168.2.1/Centos6.4 ip=dhcp
append initrd=kernel/centos6.4/initrd.img ks=http://192.168.2.1/kickstart/centos6.4/guifullap.ks ip=dhcp


LABEL 3) CentOS 6.4 x64 final SOL kickstart(http:// method)
kernel kernel/centos6.4/vmlinuz
append initrd=kernel/centos6.4/initrd.img text quiet console=ttyS1,57600n8 ks=http://192.168.2.1/kickstart/centos6.4/sol.ks

LABEL 4) CentOS 6.4 x64 final manual (http:// method)
kernel kernel/centos6.4/vmlinuz
append initrd=kernel/centos6.4/initrd.img method=http://192.168.2.1/Centos6.4 ip=dhcp



11. kickstart setup
[root@localhost /]# cd /var/www/html
[root@localhost html]# mkdir kickstart
[root@localhost kickstart]# mkdir centos6.4
[root@localhost /]# cp /sol.ks com.ks /var/www/html/kickstart/centos6.4

12.vftfp setup (put driver inside ftp) optional
[root@localhost /]#cp /V9_20141028.tar /var/ftp

13.chkconfig setup (enable services)
[root@localhost /]# chkconfig xinetd on
[root@localhost /]# chkconfig tftp on
[root@localhost /]# chkconfig rpcbind on
[root@localhost /]# chkconfig nfs on
[root@localhost /]# chkconfig rpcidmapd on
[root@localhost /]# chkconfig nfslock on
[root@localhost /]# chkconfig vsftpd on
[root@localhost /]# chkconfig dhcpd on
[root@localhost /]# chkconfig httpd on

14.Reboot server or start service
[root@localhost ~]# /etc/init.d/dhcpd restart
[root@localhost tftpboot]# /etc/init.d/xinetd restart
[root@localhost /]# /etc/init.d/rpcbind restart
[root@localhost /]# /etc/init.d/nfs restart
[root@localhost /]# /etc/init.d/rpcidmapd restart
[root@localhost /]# /etc/init.d/nfslock restart
[root@localhost /]#  /etc/init.d/httpd restart
# make sure vsftpd services is running
[root@localhost /]# /etc/init.d/vsftpd start

15 give permission to kernel
chmod 777 /tftpboot/kernel
chmod 777 /tftpboot/kernel/centos6.4


_______________________________________________________________________

Set up Pxe Server with RHEL7.X/ Centos7.X HTTP
all the settingis the same, except efidefault is different.

title [Leopard_uEFI] CentOS 6.4 x64 for guifullap_manual
root (nd)
kernel /kernel/rhel7.1/vmlinuz inst.stage2=http//192.168.2.1/rhel7.1
initrd /kernel/rhel7.1/initrd.img
-----------------------------------------------------------------------------------------------------------------

reference:
Chinese: 
http://benjr.tw/83/5
http://blog.xuite.net/geniusn/note/29065663-%E7%94%A8CentOS%E6%9E%B6%E8%A8%ADPXE+Server
http://www.dotblogs.com.tw/ghoseliang/archive/2013/05/01/102558.aspx
English:
http://djmimi-linux.blogspot.tw/2014/03/how-to-build-pxe-server-support-legacy.html

Sunday, November 9, 2014

BIOS

what is a bios?

BIOS的全名是「Basic Input Output System」,它是啟動電腦組件功能的鑰匙,主機板上有一顆上面貼著發光貼紙的IC,這就是BIOS。BIOS的作用是提供電腦基本運作的程式,電腦一開機,會先載入BIOS中基本的程式,然後再執行作業系統,所以如果沒有BIOS,電腦就無法開機喔!

所謂的BIOS是電腦中用來控制與設定硬體基本功能並提供作業系統掌控硬體設備與各種裝置的媒介。我們可以藉由修改BIOS設定值來開啟或關閉某個硬體裝置的功能,也可藉此調整硬體的運作方式與運作效能(如對CPU或顯示卡做超頻… 等)。


reference: 
http://mail.mcjh.kl.edu.tw/~lin/teach/computer/bios/bios.htm
http://briian.com/6117/bios-boot-option.html

簡單說就是bios 就是電腦開機,bios會先偵測到所有devices的資訊,如cpu, ram, hdd, 等等。一但開機它會先到bios那才到OS。

我們BIOS分Legacy跟UEFI 兩鐘。

BIOS分為兩種,Legacy跟UEFI。Legacy應該就是你講的所謂「傳統BIOS」,是用組合語言撰寫,缺乏擴充性、沒有彈性,很難加上一些新功能,目前的電腦絕大多數都還是用Legacy BIOS。

而UEFI BIOS,是用C語言撰寫,是由個別的程式模組構成,因此擴充性高,可根據需要加入新程式模組、載入驅動程式。新的晶片組開始支援UEFI,因此未來新的電腦BIOS,絕大多數都會採用UEFI BIOS。

For more information please link this site: http://x86asm.net/articles/introduction-to-uefi/
Reference: https://tw.knowledge.yahoo.com/question/question?qid=1611123005237

Saturday, November 8, 2014

34 Free Cloud Storage Services

34 Free Cloud Storage Services

Please go to reference website to see more cloud storage

1. MEGA
2. Pydio
3. Hive
4. MediaFire
5. pCloud
6. SurDoc
7. Dump Truck
8. Dropbox
9. Box
10. SeaCloud
11. Inbox.com
12. Copy
13. PromptFile
14. FlipDrive
15. Google Drive
16. OneDrive
17. Mightyupload
18. Amazon Cloud Drive
19. HiDrive
20. Cubby
21. OziBox
22. StreamNation
23. ADrive
24. Yandex.Disk

reference http://freebies.about.com/od/computerfreebies/tp/free-cloud-storage.htm