Perlbrew
curl -kL http://xrl.us/perlbrewinstall | bash
echo 'source ~/perl5/perlbrew/etc/bashrc' >> ~/.bashrc
. ~/.bashrc
perlbrew install perl-5.14.2
perlbrew switch perl-5.14.2
perlbrew install-cpanm
ものすごい勢いで忘れる私のために未整理でもいいからとりあえずメモ
curl -kL http://xrl.us/perlbrewinstall | bash
echo 'source ~/perl5/perlbrew/etc/bashrc' >> ~/.bashrc
. ~/.bashrc
perlbrew install perl-5.14.2
perlbrew switch perl-5.14.2
perlbrew install-cpanm
# PCI device 0x1af4:0x1000 (virtio-pci) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:2a:7a:d9", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
yum -y install yum-conf-sl-other yum-plugin-fastestmirror yum-plugin-priorities
cd /etc/yum.repos.d/ mv sl.repo sl.repo.default mv sl-other.repo sl-other.repo.default
cat << '_EOF_' > /etc/yum.repos.d/sl.repo [sl] name=Scientific Linux $releasever - $basearch mirrorlist = file:///etc/yum.repos.d/mirrors-sl enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson priority=1 [sl-security] name=Scientific Linux $releasever - $basearch - security updates mirrorlist = file:///etc/yum.repos.d/mirrors-sl-security enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson priority=1 [sl-source] name=Scientific Linux $releasever - Source mirrorlist = file:///etc/yum.repos.d/mirrors-sl-source enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson priority=1 _EOF_ cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/$basearch/os/ http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/$basearch/os/ http://ftp.riken.jp/Linux/scientific/$releasever/$basearch/os/ http://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/os/ http://ftp1.scientificlinux.org/linux/scientific/$releasever/$basearch/os/ http://ftp2.scientificlinux.org/linux/scientific/$releasever/$basearch/os/ ftp://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/os/ _EOF_ cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-security http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/$basearch/updates/security/ http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/$basearch/updates/security/ http://ftp.riken.jp/Linux/scientific/$releasever/$basearch/updates/security/ http://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/security/ http://ftp1.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/security/ http://ftp2.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/security/ ftp://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/security/ _EOF_ cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-source http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/SRPMS/ http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/SRPMS/ http://ftp.riken.jp/Linux/scientific/$releasever/SRPMS/ http://ftp.scientificlinux.org/linux/scientific/$releasever/SRPMS/ http://ftp1.scientificlinux.org/linux/scientific/$releasever/SRPMS/ http://ftp2.scientificlinux.org/linux/scientific/$releasever/SRPMS/ ftp://ftp.scientificlinux.org/linux/scientific/$releasever/SRPMS/ _EOF_
cat << '_EOF_' > /etc/yum.repos.d/sl-other.repo [sl-fastbugs] name=Scientific Linux $releasever - $basearch - fastbug updates mirrorlist = file:///etc/yum.repos.d/mirrors-sl-fastbugs enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson priority=1 [sl-debuginfo] name=Scientific Linux Debuginfo mirrorlist = file:///etc/yum.repos.d/mirrors-sl-debuginfo enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson priority=1 [sl-testing] name=Scientific Linux Testing - $basearch mirrorlist = file:///etc/yum.repos.d/mirrors-sl-testing enabled=0 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson priority=1 [sl-testing-source] name=Scientific Linux Testing - Source mirrorlist = file:///etc/yum.repos.d/mirrors-sl-testing-source enabled=0 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-sl file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson priority=1 _EOF_ cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-fastbugs http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/$basearch/updates/fastbugs/ http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/$basearch/updates/fastbugs/ http://ftp.riken.jp/Linux/scientific/$releasever/$basearch/updates/fastbugs/ http://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/fastbugs/ http://ftp1.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/fastbugs/ http://ftp2.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/fastbugs/ ftp://ftp.scientificlinux.org/linux/scientific/$releasever/$basearch/updates/fastbugs/ _EOF_ cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-debuginfo http://ftp.ne.jp/Linux/packages/scientificlinux/$releasever/archive/debuginfo/ http://ftp.jaist.ac.jp/pub/Linux/scientific/$releasever/archive/debuginfo/ http://ftp.riken.jp/Linux/scientific/$releasever/archive/debuginfo/ http://ftp.scientificlinux.org/linux/scientific/$releasever/archive/debuginfo/ http://ftp1.scientificlinux.org/linux/scientific/$releasever/archive/debuginfo/ http://ftp2.scientificlinux.org/linux/scientific/$releasever/archive/debuginfo/ ftp://ftp.scientificlinux.org/linux/scientific/$releasever/archive/debuginfo/ _EOF_ cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-testing http://ftp.ne.jp/Linux/packages/scientificlinux/6rolling/testing/$basearch/ http://ftp.jaist.ac.jp/pub/Linux/scientific/6rolling/testing/$basearch/ http://ftp.riken.jp/Linux/scientific/6rolling/testing/$basearch/ http://ftp.scientificlinux.org/linux/scientific/6rolling/testing/$basearch/ http://ftp1.scientificlinux.org/linux/scientific/6rolling/testing/$basearch/ http://ftp2.scientificlinux.org/linux/scientific/6rolling/testing/$basearch/ ftp://ftp.scientificlinux.org/linux/scientific/6rolling/testing/$basearch/ _EOF_ cat << '_EOF_' > /etc/yum.repos.d/mirrors-sl-testing-source http://ftp.ne.jp/Linux/packages/scientificlinux/6rolling/testing/SRPMS/ http://ftp.jaist.ac.jp/pub/Linux/scientific/6rolling/testing/SRPMS/ http://ftp.riken.jp/Linux/scientific/6rolling/testing/SRPMS/ http://ftp.scientificlinux.org/linux/scientific/6rolling/testing/SRPMS/ http://ftp1.scientificlinux.org/linux/scientific/6rolling/testing/SRPMS/ http://ftp2.scientificlinux.org/linux/scientific/6rolling/testing/SRPMS/ ftp://ftp.scientificlinux.org/linux/scientific/6rolling/testing/SRPMS/ _EOF_
mkdir -p /var/kvm/images
virt-install -n www \ -r 1024 \ -f /var/kvm/images/www.img \ -s 20 \ --vcpus=2 \ --os-type linux \ --os-variant=rhel6 \ --network bridge=br0 \ --nographics \ --location='http://ftp.riken.jp/Linux/scientific/6.1/x86_64/os/' \ --extra-args='console=tty0 console=ttyS0,115200n8'
yum update
virt-clone --original www --name template --file /var/kvm/images/template.imgクローンするたびにゲストでifconfig -aで見たときにイーサデバイスの名前がeth1, eth2と変わっていくことが判明。virt-clone したら eth0 が eth1 になっていた件 | MyNotebookでも同じ現象があったようだ。
mkdir /etc/libvirt/storage
cat << _EOF_ > /etc/libvirt/storage/disk01.xml <pool type='dir'> <name>disk01</name> <capacity>0</capacity> <allocation>0</allocation> <available>0</available> <source> </source> <target> <path>/var/kvm/images</path> <permissions> <mode>0700</mode> <owner>-1</owner> <group>-1</group> </permissions> </target> </pool> _EOF_
virsh pool-define /etc/libvirt/storage/disk01.xml
virsh pool-start disk01
virsh pool-autostart disk01
virsh pool-list
virsh pool-info disk01
DEVICE="eth0" BOOTPROTO="none" HWADDR="XX:XX:XX:XX:XX:XX" IPV6INIT="yes" IPV6_AUTOCONF="yes" NM_CONTROLLED="yes" ONBOOT="yes" TYPE=Ethernet IPADDR=192.168.11.103 PREFIX=24 GATEWAY=192.168.11.1 DNS1=192.168.11.1 DEFROUTE=yes IPV4_FAILURE_FATAL=yes NAME="System eth0"
# yum -y install qemu-kvm libvirt python-virtinst bridge-utils
# lsmod | grep kvm kvm_intel 47790 0 kvm 300762 1 kvm_intel
# /etc/init.d/libvirtd startlibvirtdの自動起動設定。
# chkconfig libvirtd on
DEVICE=eth0 #BOOTPROTO=none HWADDR=6C:62:6D:67:2E:A4 #IPV6INIT=no #IPV6_AUTOCONF=yes #NM_CONTROLLED=no ONBOOT=yes TYPE=Ethernet BRIDGE=br0 #IPADDR=192.168.11.103 #PREFIX=24 #GATEWAY=192.168.11.1 #DNS1=192.168.11.1 #DEFROUTE=yes #IPV4_FAILURE_FATAL=yes #NAME=System eth0
DEVICE=br0 BOOTPROTO=static #HWADDR=6C:62:6D:67:2E:A4 IPV6INIT=no IPV6_AUTOCONF=yes NM_CONTROLLED=no ONBOOT=yes TYPE=Bridge IPADDR=192.168.11.103 PREFIX=24 GATEWAY=192.168.11.1 DNS1=192.168.11.1 DEFROUTE=yes IPV4_FAILURE_FATAL=yes #NAME=System br0
# /etc/init.d/network reload
- -tcp -noddp -uamlist uams_dhx.so,uams_dhx2.so -nosavepassword -setuplog "defau lt INFO_LOG /var/log/netatalk.log"
:DEFAULT: options:upriv,usedots dperm:0700 fperm:0600 ea:sys
# The "~" below indicates that Home directories are visible by default. # If you do not wish to have people accessing their Home directories, # please put a pound sign in front of the tilde or delete it. # ~
# Time Machine /mnt/TimeMachine "Time Machine" options:tm volsizelimit:512000
chkconfig netatalk on
/etc/init.d/netatalk start
ps auxww | grep afpd
root 21762 0.2 0.0 182236 2940 ? S 22:18 0:00 /usr/sbin/afpd -U uams_dhx.so,uams_dhx2.so -g nobody -c 20 -n sunshine103 root 21855 0.0 0.0 107432 952 pts/0 S+ 22:21 0:00 grep afpd
netstat -an --program | grep "^tcp.*21762"
tcp 0 0 0.0.0.0:548 0.0.0.0:* LISTEN 21762/afpd
-A INPUT -m state --state NEW -m tcp -p tcp --dport 548 -j ACCEPT
/etc/init.d/iptables restart
wget http://www003.upp.so-net.ne.jp/hat/files/netatalk-2.2.1-0.1.5.el6.src.rpm
rpm -ivh netatalk-2.2.1-0.1.5.el6.src.rpm
yum install rpm-build
cd rpmbuild/SPECS/
rpmbuild -bb netatalk.spec
エラー: ビルド依存性の失敗: cracklib-devel は netatalk-4:2.2.1-0.1.5.el6.x86_64 に必要とされています quota-devel は netatalk-4:2.2.1-0.1.5.el6.x86_64 に必要とされています libtool は netatalk-4:2.2.1-0.1.5.el6.x86_64 に必要とされています db4-devel は netatalk-4:2.2.1-0.1.5.el6.x86_64 に必要とされています pam-devel は netatalk-4:2.2.1-0.1.5.el6.x86_64 に必要とされています tcp_wrappers-devel は netatalk-4:2.2.1-0.1.5.el6.x86_64 に必要とされています libgcrypt-devel は netatalk-4:2.2.1-0.1.5.el6.x86_64 に必要とされています avahi-devel は netatalk-4:2.2.1-0.1.5.el6.x86_64 に必要とされています libacl-devel は netatalk-4:2.2.1-0.1.5.el6.x86_64 に必要とされています openldap-devel は netatalk-4:2.2.1-0.1.5.el6.x86_64 に必要とされています
yum install cracklib-devel quota-devel libtool db4-devel pam-devel tcp_wrappers-devel \ libgcrypt-devel avahi-devel libacl-devel openldap-devel
rpmbuild -bb netatalk.spec
cd ~/rpmbuild/RPMS/x86_64/
rpm -ivh netatalk-2.2.1-0.1.5.el6.x86_64.rpm
rpm -ivh netatalk-devel-2.2.1-0.1.5.el6.x86_64.rpm
yum install dmraid mdadm
fdisk /dev/sdbパーティションがある場合はまず削除します。
fdisk /dev/sdc
# RAID1 on two 1TB disks DEVICE /dev/sd[bc]1 ARRAY /dev/md0 devices=/dev/sdb1,/dev/sdc1
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sd[bc]1
mdadm: /dev/sdb1 appears to contain an ext2fs file system size=488287608K mtime=Wed Nov 2 18:33:48 2011 mdadm: Note: this array has metadata at the start and may not be suitable as a boot device. If you plan to store '/boot' on this device please ensure that your boot-loader understands md/v1.x metadata, or use --metadata=0.90 mdadm: /dev/sdc1 appears to contain an ext2fs file system size=976760000K mtime=Wed Nov 2 18:33:48 2011 Continue creating array? y mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md0 started.
mdadm --detail /dev/md0
Personalities : [raid1] md0 : active raid1 sdc1[1] sdb1[0] 976758841 blocks super 1.2 [2/2] [UU] [>....................] resync = 1.9% (18636544/976758841) finish=168.2min speed=94907K/sec unused devices:[root@sunshine103 etc]# mdadm --detail /dev/md0 /dev/md0: Version : 1.2 Creation Time : Wed Nov 2 20:29:13 2011 Raid Level : raid1 Array Size : 976758841 (931.51 GiB 1000.20 GB) Used Dev Size : 976758841 (931.51 GiB 1000.20 GB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Update Time : Wed Nov 2 20:29:13 2011 State : clean, resyncing Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Rebuild Status : 2% complete Name : sunshine103:0 (local to host sunshine103) UUID : 85baee8b:5601c9d3:146ff925:09e772cf Events : 0 Number Major Minor RaidDevice State 0 8 17 0 active sync /dev/sdb1 1 8 33 1 active sync /dev/sdc1
pvcreate /dev/md0
bc
1024*1024/65000 16
vgcreate -s 16M lvm-raid /dev/md0
vgdisplay lvm-raid
--- Volume group --- VG Name lvm-raid System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 931.50 GiB PE Size 16.00 MiB Total PE 59616 Alloc PE / Size 0 / 0 Free PE / Size 59616 / 931.50 GiB VG UUID E0vNd7-vrMF-3CSL-tdhA-uIfW-opeQ-hy22su
lvcreate --size 512G lvm-raid -n lvm0
vgdisplay lvm-raid
--- Volume group --- VG Name lvm-raid System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 2 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 931.50 GiB PE Size 16.00 MiB Total PE 59616 Alloc PE / Size 32768 / 512.00 GiB Free PE / Size 26848 / 419.50 GiB VG UUID E0vNd7-vrMF-3CSL-tdhA-uIfW-opeQ-hy22su
lvcreate -l 26848 lvm-raid -n lvm1
vgdisplay lvm-raid
--- Volume group --- VG Name lvm-raid System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 5 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 931.50 GiB PE Size 16.00 MiB Total PE 59616 Alloc PE / Size 59616 / 931.50 GiB Free PE / Size 0 / 0 VG UUID E0vNd7-vrMF-3CSL-tdhA-uIfW-opeQ-hy22su
mkfs -t ext4 /dev/lvm-raid/lvm0
mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 33554432 inodes, 134217728 blocks 6710886 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 4096 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 34 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
mkfs -t ext4 /dev/lvm-raid/lvm1
mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 27492352 inodes, 109969408 blocks 5498470 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 3356 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 22 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
mkdir /mnt/{TimeMachine,data}
/dev/lvm-raid/lvm0 /mnt/TimeMachine ext4 defaults 0 0 /dev/lvm-raid/lvm1 /mnt/data ext4 defaults 0 0
mount -a