2015/10/15 (木)

2015-10-15:OpenBlocks AX3 with SSD

OpenBlocks AX3 に 16G の SSD を搭載したのを入手。
ruby 環境を rbenv で入れようとして、いきなりはまった。/tmp の容量不足!
SSD 搭載の場合、/etc とか /usr とかもろもろは /dev/sda1 な SSD を ext4 フォーマットで /.rw とマウントされたとこの下に aufs でマウントされているんだけど、それでも /tmp は本体 RAM 上なのね。

$ mount
/dev/root on / type ext2 (rw,relatime,errors=continue,user_xattr,acl)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=103444k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev type tmpfs (rw,relatime,size=10240k,mode=755)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=206880k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/sda1 on /.rw type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered,discard)
aufs on /etc type aufs (rw,relatime,si=8baef055)
aufs on /bin type aufs (rw,relatime,si=88e78055)
aufs on /home type aufs (rw,relatime,si=976ea055)
aufs on /lib type aufs (rw,relatime,si=82ec9855)
aufs on /sbin type aufs (rw,relatime,si=b8e83855)
aufs on /usr type aufs (rw,relatime,si=82ec9055)
aufs on /var type aufs (rw,relatime,si=b8e83055)
aufs on /root type aufs (rw,relatime,si=86e5a855)
aufs on /opt type aufs (rw,relatime,si=86e5a055)
aufs on /srv type aufs (rw,relatime,si=82ebd855)
aufs on /media type aufs (rw,relatime,si=82ebd055)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)

ここらのマウントは /etc/init.d/openblocks-setup の中でやっているみたいで、

        # if using DEBIAN storage, /tmp directory mount under storage.
        #if [ -n "$rwdev" ] ; then
        #        UNIONFS_DIRS="$UNIONFS_DIRS tmp"
        #fi

という部分があったので、この下三行のコメントを外して再起動。。。してみたが、うまくいかない。残念。
いいや、手動でやっちゃえ、と

mount -n -t aufs -o xino=/.aufs.xino.tmp,dirs=/.rw:/tmp=ro aufs /tmp

を実行。これで /tmp が SSD 上になった。

で、rbenv install 2.2.1 みたいにビルドができるようになったけど、、、さすがに1時間コースだな。けっこう重い。^^;
ちなみに、ruby 環境を作った後、rails 入れて、Gemfile 書いて bundle install しようとしたら、therubyracer でこける。
ググッたら github の作者のとこにスレを発見。

unable to build therubyracer/libv8 on arm A10 #255
https://github.com/cowboyd/therubyracer/issues/255

ここの2013年8月24日の投稿のやり方で therubyracer のインストールに自分も成功。
事前に sudo gem uninstall libv8 しておいて、git clone してから、の手順。

bundle install で必要な gem が一通り入り、手製の rails アプリが動くことまで確認。
ちょっと重いけど、使えなくはなさそうだ。

comment

2014/07/07 (月)

2014-07-07:Debian squeeze で簡易ルータ&オレオレDNS

とある端末をネットにつなぎたいんだけど、特定のサイトにだけはDNS詐称して別サーバに誘導したい、というニーズがあって、ちょうど OpenBlockS600D が余ってたので、現実逃避でセットアップしたお話。
Debian での流儀もいろいろ忘れてたので、備忘に。

  • OpenBlockS の eth0, eth1 は固定。eth0 を上流(外部インターネット)へ、eth1 を今回の目的の端末向けに。
  • 目的の端末向けに DHCP でアドレスを配る。

ネットワーク設定は /etc/network/interfaces。

# cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
     address 192.168.0.2
     network 192.168.0.0
     netmask 255.255.255.0
     broadcast 192.168.0.255
     gateway 192.168.0.1

auto eth1
iface eth1 inet static
     address 192.168.254.254
     network 192.168.254.0
     netmask 255.255.255.0
     broadcast 192.168.254.255

eth1 から eth0 に抜けてルーティングする設定。
/etc/sysctl.conf での ip_forward 設定と、/etc/network/if-up.d/ 以下にネットワーク有効化後の iptables のコマンド。

 
# cat /etc/sysctl.conf
...
net.ipv4.ip_forward=1
...

# cat /etc/network/if-up.d/ipmasquerade 
#!/bin/sh
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# chmod +x /etc/network/if-up.d/ipmasquerade

続けて、オレオレDNSの設定。
debian の bind9 は /etc/bind/ ディレクトリ以下の named.conf はいじらず、named.conf.local や named.conf.options をいじる。
なお、配布される /etc/bind/named.conf.options には /var/cache/bind/ がディレクトリ指定されているけど、自分は無視して zone ファイルもフルパス指定で /etc/bind/ 以下に置いちゃう。

# apt-get install bind9
# cat /etc/bind/named.conf.options
...
        forwarders {
                192.168.20.1;
        };
...
# cat /etc/bind/named.conf.local
zone "example.com" {
        type master;
        file "/etc/bind/example.com.zone";
};
# cat /etc/bind/example.com.zone
$TTL    1800
@       IN      SOA     dns.example.com.     root.example.com. (
                        14070701        ;serial
                            3600        ;refresh
                            1800        ;retry
                          172800        ;expire
                           86400 )      ;negative cache ttl

                IN      NS      test01.example.com.
test01          IN      A       192.168.0.5

最後に dhcpd の設定。
ターゲットの NIC のベンダーコードを見て、ターゲットの機器以外はアドレスあげないように。

# apt-get install isc-dhcp-server
# cat /etc/dhcp/dhcpd.conf
max-lease-time infinite;
default-lease-time infinite;
shared-network testnetwork {
    subnet 192.168.254.0 netmask 255.255.255.0 {
        option routers 192.168.254.254;
        option broadcast-address 192.168.254.255;
        option domain-name-servers 192.168.254.254;
    }

    class "target" {
        match if substring (hardware,1,3) = 00:11:22;
    }
    pool {
        allow members of "target";
        range 192.168.254.101 192.168.254.150;
    }
}

余らせてた OpenBlockS が有効利用できてよかった。

comment

2008/03/03 (月)

2008-03-03:OpenBlockS266 に Debian をインストール

眠っていた OpenBlockS266 を引っ張りだして、120G の HDD を買ってきて、我が家のルータ兼ファイル置場にしようという計画。
作業手順は別ページで。

OpenBlockS266 に Debian をインストール

comment

2003/08/20 (水)

2003-08-20:OpenBlockS 266 セットアップ

こっちは長いので別ページ。
OpenBlockS 266 セットアップ

comment