1

This question is relate to this, but more general.

Currently I mount remote root by sshfs

sshfs -o sshfs_sync,sync_readdir,reconnect,follow_symlinks,direct_io,sync_read root@pi:/ pi

/proc is ok, but /dev/mem is not works

head pi/dev/mem
head: error reading 'pi/dev/mem': Operation not permitted

So,how can I mount remote /dev/mem to local

EDIT

I want to control raspberry pi from my dev laptop, it will be way easier if I can just run program from my laptop by mount remote /dev/mem.

Currently I mount raspberry by sshfs, the dev loop like

# Compile from my laptop is way faster
env GOOS=linux GOARCH=arm GOBIN=`pwd`/bin go install main.go
cp bin/main /path/to/mounted/pi
# Then run from pi

If I can mount /dev/mem, the dev loop will become

go run main.go # dev
go run main.go # dev
go run main.go # dev
# Good to go
env GOOS=linux GOARCH=arm GOBIN=`pwd`/bin go install main.go
cp bin/main /path/to/mounted/pi

this will save a lot time, and I can do debug from my local.

Also I think mount /dev/mem only cost a few of network, and I found Network device can mount remote device, but I can not compile due to docbook2man.

  • 1
    sshfs is implemented via sftp which can only transfer files, whereas /dev/mem is a device. The files under /proc are still files, not devices, even though they are implemented by the kernel. – meuh Apr 9 '16 at 11:45
  • How can I mount remote device ? – wener Apr 9 '16 at 12:09
  • 2
    You're attempting to read from the memory of the machine where the process is running: a device file is just a number that tells the kernel what to run. To do what you want to do, a remote filesystem isn't enough, you'd need a process that relays memory accesses. I can't think of an existing program offhand. Are you sure that's what you want? It would be very slow. Why not run the program on the remote machine? What problem are you trying to solve? – Gilles Apr 9 '16 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.