9fans / plan9port

Plan 9 from User Space
https://9fans.github.io/plan9port/
Other
1.63k stars 322 forks source link

can't mount plan9 filesystem under linux #96

Open roscp opened 7 years ago

roscp commented 7 years ago

hello; I am running archlinux with budgie (a gnome 3 fork) desktop. I installed plan9ports from official packages for archlinux (https://www.archlinux.org/packages/community/x86_64/plan9port/). then I was told to have full acces to what plan9 would opffer I have to mount plan9 filesystem. down below I pasted what I tried and could found here and there all from 11 years a go or less. could any one help?

uname -a Linux roscp 4.11.9-1-rt7-archlinux #1 SMP PREEMPT RT Tue Jul 11 23:23:30 UTC 2017 x86_64 GNU/Linux

[roscp ~]# /usr/lib/plan9/bin/9pfuse
usage: 9pfuse [-D] [-A attrtimeout] [-a aname] address mtpt
[roscp ~]# man 9pfuse
[roscp ~]# mount -t 9p 127.0.0.1 /mnt/9 -o port=5670
mount: /mnt/9: mount point does not exist.
[roscp ~]# mkdir /mnt/9
[roscp ~]# mount -t 9p 127.0.0.1 /mnt/9 -o port=5670
mount: /mnt/9: unknown filesystem type '9p'.
[roscp ~]# 9pfuse /tmp/ns.$USER.$DISPLAY/acme /mnt/9
9pfuse: dial /tmp/ns.root./acme: unknown host /tmp/ns.root./acme
[roscp ~]# namespace
namespace: $NAMESPACE not set, $DISPLAY not set
[roscp ~]# mount -t 9p `namespace`/acme /mnt/9 -o trans=unix,uname=$USER
namespace: $NAMESPACE not set, $DISPLAY not set
mount: /mnt/9: unknown filesystem type '9p'.
[roscp ~]# /usr/lib/plan9/bin/mount -t 9p `namespace`/acme /mnt/9 -o trans=unix,uname=$USER
namespace: $NAMESPACE not set, $DISPLAY not set
usage: mount addr mtpt
[roscp ~]# /usr/lib/plan9/bin/mount -t 9p 127.0.0.1 /mnt/9 -o port=5670
usage: mount addr mtpt
[roscp ~]# /usr/lib/plan9/bin/mount 127.0.0.1 /mnt/9 -o port=5670
usage: mount addr mtpt
[roscp ~]# /usr/lib/plan9/bin/mount 127.0.0.1 /mnt/9
9pfuse: dial 127.0.0.1: Connection refused
[roscp ~]# /usr/lib/plan9/bin/mount  'tcp!127.0.0.1!564' /mnt/9
9pfuse: dial tcp!127.0.0.1!564: Connection refused
[roscp ~]# /usr/lib/plan9/bin/mount
usage: mount addr mtpt
[roscp ~]# /usr/lib/plan9/bin/mount -h
usage: mount addr mtpt
[roscp ~]# /usr/lib/plan9/bin/mount 127.0.0.1 /mnt/9 -o trans=unix,uname=$USER
usage: mount addr mtpt
[roscp ~]# /usr/lib/plan9/bin/mount 127.0.0.1 /mnt/9
9pfuse: dial 127.0.0.1: Connection refused
[roscp ~]# /usr/lib/plan9/bin/mount  /mnt/9
usage: mount addr mtpt
[roscp ~]# /usr/lib/plan9/bin/9p 127.0.0.1 /mnt/9
9p       9pfuse   9pserve  
[roscp ~]# /usr/lib/plan9/bin/9p 127.0.0.1 /mnt/9
9p       9pfuse   9pserve  
[roscp ~]# /usr/lib/plan9/bin/9pfuse 127.0.0.1 /mnt/9
/usr/lib/plan9/bin/9pfuse: dial 127.0.0.1: Connection refused
[roscp ~]# /usr/lib/plan9/bin/9pfuse 127.0.0.1:564 /mnt/9
/usr/lib/plan9/bin/9pfuse: dial 127.0.0.1:564: Connection refused
[roscp ~]# /usr/lib/plan9/bin/9pfuse  'tcp!127.0.0.1!564' /mnt/9
/usr/lib/plan9/bin/9pfuse: dial tcp!127.0.0.1!564: Connection refused
[roscp ~]# listen -N tcp!*!564
-bash: !564: event not found
[roscp ~]# 9p
usage: 9p [-n] [-a address] [-A aname] cmd args...
possible cmds:
    read name
    readfd name
    write [-l] name
    writefd name
    stat name
    rdwr name
    ls [-ldn] name
without -a, name elem/path means /path on server unix!$ns/elem
[roscp ~]# man 9p
[roscp ~]# 9pserve
usage: 9pserve [-lnv] [-A aname afid] [-c addr] [-M msize] address
    reads/writes 9P messages on stdin/stdout
[roscp ~]# man 9pserve
[roscp ~]# 9term
9term: initdraw: muxrpc: unexpected eof
[roscp ~]# adict
9p: mount: no name space
rc (/usr/lib/plan9/bin/rc): null list in concatenation
[roscp ~]# /usr/lib/plan9/bin/rc

% 9 mount `namespace`/acme /mnt/9   
rc: /dev/stdin: token namespace: syntax error
% mount -t 9p 127.0.0.1 /mnt/9 -o port=5670
rc: /dev/stdin: token '=': syntax error
% 9pfuse  'tcp!127.0.0.1!564' /mnt/9
9pfuse: dial tcp!127.0.0.1!564: Connection refused
%  factotum
factotum: post9pservice factotum: $NAMESPACE not set, $DISPLAY not set
% 
0intro commented 7 years ago

For example, if you want to mount sources.cs.bell-labs.com (135.104.24.18) from Linux, using v9fs, you can do:

Without authentication (no need for plan9port in this case):

$ mount -t 9p -o tcp,trans=tcp,uname=djc 135.104.24.18 /n/sources

The uname option is only needed if you want to mount as a particular user.

You'll need to resolve the IP address on your side since neither mount nor the Linux kernel do DNS resolution. You can also use 9mount which is a wrapper on mount -t 9p (http://sqweek.net/code/9mount/).

With authentication (using factotum and srv provided in plan9port):

$ factotum -n
$ srv -a -k user=djc sources.cs.bell-labs.com
$ mount -t 9p -o unix,trans=unix,uname=djc $(namespace)/sources.cs.bell-labs.com /n/sources

Instead of using v9fs, which is a 9p implementation in the Linux kernel, you can also use 9pfuse, which can run on any operating system supporting FUSE.

To obtain more details about the options supported by v9fs, you can read the documentation.

roscp commented 7 years ago

@0intro (hello and thank you); What started all this was using acme at its full potential and I was told I had to mount an instance of plan9 file system on my own machione (like the plan9 server and its mount point both on my local machine). I wanted shell inside acme. well here is an explanation is called for (at least for myself): (I would create another issue for it though) thanks