Kodama's home / tips.
shfs kernel module のソースを取得する. 以下は shfs-0.35 のインストールの例.
$ tar zxvf shfs-0.35.tar.gz $ ls shfs-0.35/docs/html Makefile* images/ install.html* shfs.css* faq.html* index.html* internals.html* shfsv4.css*ちゃんと読むと,この文書のここから下は不要になりますね.
GCC の版の確認方法:
$ gcc --version gcc (GCC) 3.4.1 $ cat /proc/version Linux version 2.4.30 (root@guppy) (gcc バージョン 3.4.1) #2 2005年 4月10日 (日) 04:32:02 JST
$ cd shfs-0.35 $ make (コンパイルする)
$ su Password: # /sbin/insmod shfs/shfs.o (shfsモジュールを読み込む) # shfsmount/shfsmount localhost:/tmp /mnt shfsmountのテスト (注. localhost が ssh サーバになっているとする.) root@localhost's password: (rootのパスワードを入力) # mount (マウントを確認する.) ....略 localhost:/tmp on /mnt type shfs (version=2,mnt=/mnt,fd=4) # ls /mnt ....略 (/tmp と同じ物が /mnt に見えているはず.) # umount /mnt (確認できたらアンマウントする.)
# make install # depmod -aこれで完了.
# make uninstall # depmod -a
上では module としてコンパイルして insmod したが, カーネルに組み込むこともできる.
# ls shfs-0.35/shfs Linux-2.4/ Linux-2.6/ Makefile # cd shfs-0.35/shfs/Linux-2.4 (使用するカーネルの版のためのディレクトリに移動) # make patch 以下, カーネルを再構築すると良い.
# shfsmount 192.168.10.2:/tmp /mnt root@192.168.10.2's password: ←rootのパスワードを入力同じ事を mount コマンドでもできる.
# mount -t shfs 192.168.10.2:/tmp /mnt
# mount -t shfs kodama@192.168.10.2 /mnt kodama@192.168.10.2's password: # ls -l /mnt/public_html/tips* -rw-r--r-- 1 root root 2073 6月 13日 11:01 /mnt/public_html/tips-AKS-prime.html -rw-r--r-- 1 root root 2361 6月 13日 11:01 /mnt/public_html/tips-APRCL-prime.html ....略しかし, これでは, 手元では root 権限で見える事になってしまう.
# mount -t shfs -o nocache,rw,stable,uid=kod kodama@192.168.10.2 /mnt kodama@192.168.10.2's password: # ls -l /mnt/public_html/tips* -rw-r--r-- 1 kod root 2073 6月 13日 11:01 /mnt/public_html/tips-AKS-prime.html -rw-r--r-- 1 kod root 2361 6月 13日 11:01 /mnt/public_html/tips-APRCL-prime.html ....略
Kodama's home / tips.