知乎專欄 | 多維度架構 | | | 微信號 netkiller-ebook | | | QQ群:128659835 請註明“讀者” |
掛載前提是必須安裝 fusermount
[root@netkiller test]# yum install fuse
如果沒有安裝 fusermount 會出如下提示
17:35:29.129 ERROR node: error mounting: fusermount: exec: "fusermount": executable file not found in $PATH mount_unix.go:89
將 ipfs 掛在到本地檔案系統,預設目錄 /ipfs 和 /ipns。
> mkdir /ipfs /ipns > sudo chown `whoami` /ipfs /ipns > ipfs daemon & > ipfs mount
掛載到指定目錄
[root@netkiller ~]# mkdir test [root@netkiller test]# cd test [root@netkiller test]# mkdir ipfs ipns [root@netkiller test]# ipfs mount -f ipfs -n ipns IPFS mounted at: ipfs IPNS mounted at: ipns
檢查掛載情況
[root@netkiller test]# mount | grep fuse fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime) /dev/fuse on /root/test/ipfs type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0) /dev/fuse on /root/test/ipns type fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
卸載
umount /ipfs umount /ipns