harumaki.net

インフラ屋の覚書や、ラーメン食べある記とか。

GNU/Linux network ssh

shfsをインストール

投稿日:2006年6月15日

Last Updated on 2013年2月2日 by かんりにん

[pukiwiki]

SSH版NFSともいえるshfsのインストールのドキュメント。これは便利。

【本家サイト】
お世話になっています。
http://shfs.sourceforge.net/

ただ、しばらく更新されていない様子…

**ソースの場合

***ダウンロードと展開

まずダウンロードして展開。
[root@example ~]# cd /usr/local/src/
[root@example src]# wget http://jaist.dl.sourceforge.net/sourceforge/shfs/shfs-0.35.tar.gz
[root@example src]# tar -zxvf shfs-0.35.tar.gz
[root@example src]# cd shfs-0.35

・事前にGCCとカーネルバージョンを確認しておく。

[root@example shfs-0.35]# gcc –version
gcc (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@example shfs-0.35]#
[root@example shfs-0.35]# cat /proc/version
Linux version 2.6.9-34.EL (buildcentos@build-i386) (gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)) #1 Wed Mar 8 00:07:35 CST 2006

***コンパイル

[root@example shfs-0.35]# make
[root@example shfs-0.35]# make install

出来上がったらshfsmount/ディレクトリを確認

[root@example shfs-0.35]# ll shfsmount/
合計 224
-rw——- 1 root root 1235 *月 1 2004 Makefile
-rw-r–r– 1 root root 11940 *月 15 18:19 perl-code.h
-rw——- 1 root root 9918 *月 1 2004 perl-code.in
-rw-r–r– 1 root root 436 *月 15 18:19 perl-test.h
-rw——- 1 root root 350 *月 1 2004 perl-test.in
-rw——- 1 root root 3964 *月 1 2004 proto.c
-rw——- 1 root root 143 *月 1 2004 proto.h
-rw-r–r– 1 root root 24324 *月 15 18:19 proto.o
-rw-r–r– 1 root root 7428 *月 15 18:19 shell-code.h
-rw——- 1 root root 6340 *月 1 2004 shell-code.in
-rw-r–r– 1 root root 259 *月 15 18:19 shell-test.h
-rw——- 1 root root 231 *月 1 2004 shell-test.in
-rwxr-xr-x 1 root root 50106 *月 15 18:19 shfsmount
-rw——- 1 root root 15191 *月 1 2004 shfsmount.c
-rw——- 1 root root 369 *月 1 2004 shfsmount.h
-rw-r–r– 1 root root 24204 *月 15 18:19 shfsmount.o
-rwxr-xr-x 1 root root 12873 *月 15 18:19 shfsumount
-rw——- 1 root root 3245 *月 1 2004 shfsumount.c
-rw-r–r– 1 root root 8484 *月 15 18:19 shfsumount.o
[root@example shfs-0.35]#

バイナリでshfsmountとshfsumountができている。
/usr/local/bin/へコピー。

[root@example shfsmount]# cp shfsmount /usr/local/bin/
[root@example shfsmount]# cp shfsumount /usr/local/bin/

***動作確認

-マウント
リモートホストの/usr/local/をローカルの/mntにマウントしてみる。
[root@example shfs-0.35]# shfsmount 192.168.***.***:/usr/local/ /mnt/
root@192.168.***.***’s password:
[root@example shfs-0.35]#
マウント状況を確認。
/usr/local以下のディレクトリがマウントされている。
[root@example shfs-0.35]# ll /mnt/
合計 36
drwxr-xr-x 2 root root 4096 8月 12 2004 bin
drwxr-xr-x 2 root root 4096 8月 12 2004 etc
drwxr-xr-x 2 root root 4096 8月 12 2004 games
drwxr-xr-x 2 root root 4096 8月 12 2004 include
drwxr-xr-x 2 root root 4096 8月 12 2004 lib
drwxr-xr-x 2 root root 4096 8月 12 2004 libexec
drwxr-xr-x 2 root root 4096 8月 12 2004 sbin
drwxr-xr-x 4 root root 4096 *月 6 10:45 share
drwxr-xr-x 2 root root 4096 8月 12 2004 src

-アンマウント
[root@example shfs-0.35]# shfsumount /mnt/
[root@example ~]# ls -al /mnt/
合計 16
drwxr-xr-x 2 root root 4096 2月 22 2005 .
drwxr-xr-x 23 root root 4096 *月 15 15:20 ..
[root@example ~]#

**パッケージをコンパイルする/RPMの場合

本家サイトで提供されているのはソースアーカイブのみだが
ソースからパッケージ(RPM/dev)のコンパイルもオッケー。

[root@example ~]# cd /usr/local/src/
[root@example src]# wget http://jaist.dl.sourceforge.net/sourceforge/shfs/shfs-0.35.tar.gz
[root@example src]# tar -zxvf shfs-0.35.tar.gz
[root@example src]# cd shfs-0.35
[root@example shfs-0.35]# gcc –version
[root@example shfs-0.35]# make rpm
これでオッケー。しばらくするとrpm/ディレクトリ以下にパッケージができている。
※ついでにソースパッケージ(src.rpm)もできている。

-ソースパッケージ確認
[root@example shfs-0.35]# ls -al rpm/SRPMS/
合計 280
drwxr-xr-x 2 root root 4096 *月 15 18:00 .
drwx—— 6 root root 4096 *月 15 18:00 ..
-rw-r–r– 1 root root 132143 *月 15 18:00 shfs-module-2.6.9-34.EL-0.35-1.src.rpm
-rw-r–r– 1 root root 132146 *月 15 18:00 shfs-utils-0.35-1.src.rpm
-RPMパッケージ確認
[root@example shfs-0.35]# ls -al rpm/RPMS/i686/
合計 396
drwxr-xr-x 2 root root 4096 *月 15 18:00 .
drwxr-xr-x 8 root root 4096 *月 15 18:00 ..
-rw-r–r– 1 root root 290548 *月 15 18:00 shfs-module-2.6.9-34.EL-0.35-1.i686.rpm
-rw-r–r– 1 root root 96865 *月 15 18:00 shfs-utils-0.35-1.i686.rpm
[root@example shfs-0.35]#

***インストール
[root@example shfs-0.35]# cd rpm/RPM/i686/
[root@example i686]# rpm -ivh shfs-*
Preparing… ########################################### [100%]
1:shfs-utils ########################################### [ 50%]
2:shfs-module-2.6.9-34.EL########################################### [100%]
[root@example i686]#

ちなみにインストールされるファイルはこんな感じ。

-shfs-module
[root@example i686]# rpm -ql shfs-module-2.6.9-34.EL-0.35-1
/lib/modules/2.6.9-34.EL/kernel/fs/shfs
/lib/modules/2.6.9-34.EL/kernel/fs/shfs/shfs.ko
-shfs-utils
[root@example i686]# rpm -ql shfs-utils-0.35-1
/sbin/mount.shfs
/usr/bin/shfsmount
/usr/bin/shfsumount
/usr/share/doc/shfs
/usr/share/doc/shfs/COPYING
/usr/share/doc/shfs/Changelog
/usr/share/doc/shfs/TODO
/usr/share/doc/shfs/html
/usr/share/doc/shfs/html/faq.html
/usr/share/doc/shfs/html/images
/usr/share/doc/shfs/html/images/ceres.jpg
/usr/share/doc/shfs/html/images/ean.png
/usr/share/doc/shfs/html/images/schema.png
/usr/share/doc/shfs/html/index.html
/usr/share/doc/shfs/html/install.html
/usr/share/doc/shfs/html/internals.html
/usr/share/doc/shfs/html/shfs.css
/usr/share/doc/shfs/html/shfsv4.css
/usr/share/man/man8/shfsmount.8
/usr/share/man/man8/shfsumount.8
[root@example i686]#

**備考
マウント先のパーミッションの設定などを要確認。

[/pukiwiki]

-GNU/Linux, network, ssh

執筆者:


comment

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA


関連記事

no image

[自分メモ]Linux/BSD tarで固めたファイルの伸長サイズを確認

たま~に必要になるけど、すぐ忘れちゃうのでメモ。 tar で固めたファイルを展開せずに、実際のサイズを確認したいときは オプションtfに”-v(verpose)”をつければ確認 …

nagios​/plugin​/Recurring schedule

  [pukiwiki] *nagios ダウンタイムの定期スケジューリング nagios標準のダウンタイム機能は一回限りのスケジュール設定のみが可能で、 “毎晩03時~05時は非通知&# …

no image

[Juniper]SRX アカウント設定いろいろ

SRXシリーズでのアカウントの各種設定をメモ書き。 コマンドラインから操作する場合は、原則configureモードで行う。 参考:お世話になっております! SRX Getting Started &# …

[Google Drive] LinuxサーバーにてRcloneインストール&お試し

  LinuxサーバーからGoogle Driveのストレージにファイルの同期をしよう、ということで 数あるGoogle Driveの同期ツールの中から、今回はインストール/環境整備がもっとも手軽で …

no image

USB接続HDDのマウント(Linux)

[pukiwiki] 久しぶりにパーティション切ってフォーマットしようとしたら やり方を忘れてしまっていた… たまにしかやらないので手順を忘れやすい為、メモしとく(自分用にw)。 :OS|CentOS …