[FreeBSD] Root-on-ZFS recovery by using snapshots

Introduction An HDD for a rootFS of my FreeBSD machine has broken. I installed a new HDD and recovered the rootFS from ZFS snapshots. Partitioning The new HDD is recognized as /dev/da1. In this section, da1 is conformed to a broken disk. # gpart destroy -F da1 da1 destroyed # gpart create -s gpt /dev/da1 da1 created # gpart add -s 64K -b 34 -t freebsd-boot -l /boot/boot0 /dev/da1 da1p1 added # gpart add -s 1G -t freebsd-swap -l swap0 /dev/da1 da1p2 added # gpart add -t freebsd-zfs -l disk0 /dev/da1 da1p3 added # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 /dev/da1 bootcode written to da1 Create zpool for rootFS I named a new zpool rpool2....

2014-03-28 · aoi

[FreeBSD] Several installations and settings

What I installed are listed below. sudo Installation # pkg install sudo Settings # visudo %wheel ALL=(ALL) ALL zsh Installation % sudo pkg install zsh Settings % vi ~/.zshrc % whereis zsh zsh: /usr/local/bin/zsh /usr/local/man/man1/zsh.1.gz /usr/ports/shells/zsh % chsh Shell: /usr/local/bin/zsh % zsh ipfw % sudo vi /etc/rc.conf firewall_enable="YES" firewall_script="/etc/ipfw.rules" firewall_logging="YES" % sudo vi /etc/ipfw.rules % sudo /etc/rc.d/ipfw start ntp % sudo vi /etc/ntp.conf server yourNtpServer % sudo /etc/rc.d/ntpd restart ssmtp % sudo /etc/rc....

2014-03-27 · aoi

[FreeBSD] Using the ports collection

Initial process To download a compressed snapshot into /var/db/portsnap # portsnap fetch # du -sh /var/db/portsnap/ 153M /var/db/portsnap/ To extract the snapshot into /usr/ports # portsnap extract # du -sh /usr/ports/ 860M /usr/ports/ After the first steps shown above, /usr/ports can be updated by running # portsnap fetch && portsnap update Cron setting To keep a ports tree latest, it is recommended to set cron jobs. # crontab -e 0 3 * * * /usr/sbin/portsnap cron && /usr/sbin/portsnap update >/dev/null portsnap cron executes portsnap fetch after random (from 1 to 3600) seconds....

2014-03-27 · aoi

[FreeBSD] SSH settings

Notice: during the installation of FreeBSD, I enabled sshd. Configuration # cp /etc/ssh/sshd_config /etc/ssh/sshd_config.org # vi /etc/ssh/sshd_config PermitRootLogin no RSAAuthentication yes PubkeyAuthentication yes PasswordAuthentication no PermitEmptyPasswords no ChallengeResponseAuthentication no AllowUsers yourUserName Key generation % mkdir ~/.ssh % chmod 700 ~/.ssh % cd ~/.ssh % vi ssh-key.pub yourPublicKey # ssh-keygen -i -f ssh-key.pub > authorized_keys # chown yourUserName:yourGourp authorized_keys # chmod 600 authorized_keys % rm -f ssh-key.pub Confirmation # /etc/rc.d/sshd restart % netstat -a | grep LISTEN tcp4 0 0 *....

2014-03-27 · aoi

Installation of FreeBSD 10.0 on ConoHa VPS

I installed FreeBSD 10.0 on my ConoHa VPS. Fortunately, ConoHa prepared a FreeBSD 10.0 image to make installation easy. In this installation, I enabled virtio and Root-on-ZFS. ConoHa allows us to use virtio by default. Automatic Root-on-ZFS is one of the features of FreeBSD 10.0. Before 10.0, we had troubles in setting Root-on-ZFS. Now, several results for commands/experiments are shown below. Benchmark for virtio Notice: there is no result when...

2014-03-26 · aoi

[Kinesis] Advantage USB Contoured Keyboard 購入記 (発送から到着まで)

※2012/08/08 追記 サーバトラブルのため,掲載していた画像を紛失してしまいました.よって,不完全な記事となっています. 12/20 に無事に荷物を...

2010-12-21 · aoi

[Kinesis] Advantage USB Contoured Keyboard 購入記 (注文から発送まで)

※2012/08/08 追記 サーバトラブルのため,掲載していた画像を紛失してしまいました.よって,不完全な記事となっています. エルゴノミックデ...

2010-12-15 · aoi

[Ubuntu 10.04 LTS] サービスの起動と停止

Ubuntu で chkconfig コマンドを打ったところ,そんなコマンドは存在しないとのこと.そこで, chkconfig の代わりとなる sysv-rc-conf を導入する. sysv-rc-conf のインストール $ sudo apt-get install sysv-rc-conf sysv-rc-conf の使い方...

2010-05-13 · aoi

[CentOS 5.4] DLNA サーバ構築

MediaTomb を導入して DLNA サーバを構築する. MediaTomb のインストール # wget http://downloads.sourceforge.net/mediatomb/mediatomb-0.11.0.tar.gz # tar zxvf mediatomb-0.11.0.tar.gz # cp mediatomb-0.11.0/mediatomb.spec /usr/src/redhat/SPECS/ # cp mediatomb-0.11.0.tar.gz /usr/src/redhat/SOURCES/ # vi /usr/src/redhat/SPECS/mediatomb.spec BuildRequires: sqlite-devel, mysql-devel, libexif-devel, taglib-devel, file, js-devel, zlib-devel, expat-devel # rpmbuild -bb --clean /usr/src/redhat/SPECS/mediatomb.spec エラー: ビルド依存性の失敗:...

2010-03-30 · aoi

[CentOS 5.4] yum に RPMforge を登録する

yum に RPMforge リポジトリを登録する. wiki の手順通りに進めて問題なく導入完了した. RPMforge リポジトリの登録 # wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm # rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt # rpm -K rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm # rpm -ivh rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm # yum check-update # rm -f rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm 設定 普段...

2010-02-26 · aoi