coLinux(0.6.x)のインストール その7: ホストPCとのデータ交換(smbfs)

試したことをとりあえずメモに!
スポンサーリンク

このページでは、 smbfsを使ってホストPCのファイルをcoLinuxから読めるようにします。

スポンサーリンク

smbfsのインストール

まずは、coLinuxにsmbfsをインストールします。 smbfsはWindowsの共有フォルダをマウントするためのツールが入った パッケージです。

# aptitude install smbfs

インストールが始まるといくつか質問されるので答えていきます (実は質問はSambaサーバに関してなのですが、まあ設定しておきましょう)。

最初はワークグループ名を指定します (マイコンピュータのプロパティのネットワークIDタブで 調べることができます)。

┌---------------------------┤ Samba Server ├---------------------------┐
│ Please specify the workgroup you want this server to appear to be in   │
│ when queried by clients. Note that this parameter also controls the    │
│ domain name used with the security==domain setting.                    │
│                                                                        │
│ Workgroup/Domain Name?                                                 │
│                                                                        │
│ HOME__________________________________________________________________ │
│                                                                        │
│                                 <ok>                                   │
│                                                                        │
└------------------------------------------------------------------------┘

次はDHCPサーバと連携させるか(?)ですが、ここはNOでいいでしょう。

┌---------------------------┤ Samba Server ├-----------------------------┐
│ If your computer gets IP address information from a DHCP server on the   │
│ network, the DHCP server may also provide information about WINS         │
│ server ("NetBIOS name servers") present on the network. This requires    │
│ a change to your smb.conf file so that DHCP-provided WINDS settings will │
│ automatically be read from /etc/samba/dhcp.conf.                         │
│                                                                          │
│ The dhcp3-client package must be installed to take advantage of this     │
│ feature.                                                                 │
│                                                                          │
│ Modify smb.conf to use WINS settings from DHCP                           │
│                                                                          │
│                                                                          │
│                   <yes>                       <no>                       │
│                                                                          │
└--------------------------------------------------------------------------┘

以上を応えるとファイルのコピーが完了してインストール完了です。

スポンサーリンク

共有フォルダの作成

これはホストPC上での作業です。

適当なフォルダを右クリックして共有フォルダとするわけですが、 お勧めとしてはあまり深いところにあるフォルダは避けた方がよいと思います。 私は「c:\data」を共有フォルダとしました。

ホストPCのフォルダのマウント

では、Host PCのフォルダをマウントしましょう。 マウントポイントを/mntとした場合は次のコマンドを実行します (win2kはHost PCのホスト名です。もちろんIPアドレスでもかまいません)。

# smbmount //win2k/data /mnt -o codepage=cp932,iocharset=euc-jp,username=Windowsでのユーザ名
Password: Windowsでのパスワード

実行結果はmountコマンドで確認しましょう。

# mount
/dev/cobd0 on / type ext3 (rw,noatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
//win2k/data on /mnt type smbfs (rw)

日本語のファイル名

上記で「-o codepage=cp932,iocharset=euc-jp」というオプションを 指定しましたが、実はcoLinuxでは日本語のファイル名は読めません。 これはcoLinuxのカーネルにnls_cp932モジュールが含まれていないので、 このオプションが有効に機能していないからです。

これを解決するにはカーネルを再コンパイルするしかないようです。

ただし、ファイル名を見るだけなら以下のコマンドで何とかなります。

# ls | nkf -e

コメント

タイトルとURLをコピーしました