2017年10月3日 星期二

Samba SWAT安裝

/etc/services 加入
swat 901/tcp

/etc/inited.conf 加入
swat stream tcp nowait.400 root /usr/sbin/swat swat

連線測試
http://localhost:901

移除軟體RAID

umount /dev/md2

1.RAID 狀態
# mdadm --detail /dev/md2
    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sdb1     
       2       8       33        2      active sync   /dev/sdd1

2.停用 RAID
mdadm --stop /dev/md2


3.移除 RAID
mdadm --remove /dev/md2

4.移除 superblocks
# mdadm --zero-superblock /dev/sdb1 /dev/sdd1

修改相關設定
/etc/mdadm/mdadm.conf

2017年10月2日 星期一

openvz cifs 摘要

不支援  container 掛載,必須先掛載至 host,再 bind 至  container

mount -t cifs //cifs-server/share-name /mnt-cifs -o username=username
/bin/mount -n --bind /mnt-cifs /var/lib/vz/root/${VEID}/mnt

2017年9月29日 星期五

booting ipxe from pxelinux 設定摘要

/tftpboot 目錄下內容
/tftpboot/ipxe.lkrn
/tftpboot/pxelinux.0
/tftpboot/ldlinux.c32

/tftpboot/pxelinux.cfg/default 內容
DEFAULT ipxe
LABEL ipxe
menu default
kernel ipxe.lkrn :a cpair -b 0 -f 0 0 && dhcp || goto a && chain menu.ipxe

/tftpboot/menu.ipxe  內容
#!ipxe
shell

/etc/dnsmasq.conf 相關設定
dhcp-boot=pxelinux.0

2017年9月28日 星期四

ipxe chainload with dnsmasq 設定範例

dhcp-match=set:ipxe,175 # iPXE sends a 175 option.
dhcp-boot=tag:!ipxe,undionly.kpxe

dhcp-boot=http://192.168.10.1/menu.ipxe
# dhcp-boot=menu.ipxe

2017年9月22日 星期五

Linux ext2 image 加大空間

dd if=/dev/zero bs=1024 count=220000 >> fs.ext2
e2fsck -f fs.ext2
resize2fs fs.ext2

2017年9月20日 星期三

tftp timeout

1.查看 /var/log/ademon.log
connection refused from ...
tftpd: read(ack): Connection refused

2.檢查 /etc/hosts.*
/etc/hosts.deny
/etc/hosts.allow

3.檢查 iptables 相關模組
kernel 2.4.x
ip_conntrack_tftp
ip_nat_tftp

kernel 2.6.x
nf_nat_tftp
nf_conntrack_tftp
nf_conntrack