我在C盤根目錄下新建了一個資料夾,名為錄音我已經和大家分享了。我現在想將此資料夾安裝到我的 Dreambox 上,以便我可以錄製它。
但由於這是帶有 Enigma2 的原始 Dream 多媒體盒,我沒有選項網路瀏覽器或者安裝管理器在網路設定選單中,因此我無法透過選單輕鬆執行此操作,除非更改 Dreambox 的圖像。
我讀到可以透過 Telnet 安裝它。那我到底該怎麼做呢?我使用什麼指令?
我在網路上找到了這兩個命令:
範例1:
mount –t cifs –o username=name,password=password //192.168.1.10/dreambox
範例2:
mount -t smbfs -o username=YourUserName //x.x.x.x/YourShareName /your/mountpoint
我可以使用這兩個命令中的任何一個嗎?為什麼說cifs
在一處,又smbfs
在另一處呢?這些開關是什麼意思?另外,我每次重新啟動時都必須執行此操作還是這是永久設定?
我使用 PuTTYtel 連接到 Dreambox,它顯示為 OpenDreambox 1.6.0。
更新:這是 PuTTYtel 中 PS 指令的輸出。
OpenDreambox 1.6.0 dm500hd
dm500hd login: root
root@dm500hd:~# ps
PID USER VSZ STAT COMMAND
1 root 1724 S init [3]
2 root 0 SW [migration/0]
3 root 0 SWN [ksoftirqd/0]
4 root 0 SW [migration/1]
5 root 0 SWN [ksoftirqd/1]
6 root 0 SW< [events/0]
7 root 0 SW< [events/1]
8 root 0 SW< [khelper]
9 root 0 SW< [kthread]
10 root 0 SW< [kblockd/0]
11 root 0 SW< [kblockd/1]
12 root 0 SW< [khubd]
13 root 0 SW [pdflush]
14 root 0 SW [pdflush]
15 root 0 SW< [kswapd0]
16 root 0 SW< [aio/0]
17 root 0 SW< [aio/1]
18 root 0 SW< [ata/0]
19 root 0 SW< [ata/1]
20 root 0 SW< [ata_aux]
21 root 0 SW< [scsi_eh_0]
22 root 0 SW< [scsi_eh_1]
23 root 0 SW [mtdblockd]
24 root 0 SWN [jffs2_gcd_mtd3]
70 root 2180 S < udevd --daemon
310 root 0 SW [b_event]
311 root 0 SW [b_idle]
317 root 0 SW< [fp]
339 root 0 SW< [dmx0]
345 root 0 SW< [dmx1]
354 root 0 SW< [dmx2]
355 root 0 SW< [dmx_hw_sec]
391 messageb 2408 S /usr/bin/dbus-daemon --system
394 root 1928 S /usr/bin/wdog tpmd
395 root 4312 S tpmd
398 root 1928 S /usr/bin/wdog dccamd -
399 root 3136 S dccamd -
408 avahi 3084 S avahi-daemon: running [dm500hd.local]
441 root 4076 S nmbd -D
443 root 6780 S smbd -D
458 root 6780 S smbd -D
465 root 2504 S udhcpc -R -b -T3 -A10 -p /var/run/udhcpc.eth0.pid -i
477 root 1712 S /usr/sbin/zeroconf -i eth0
493 root 2348 S /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_host
496 root 1832 S /usr/sbin/inetd
499 root 2504 S /sbin/syslogd -n -O /var/log/messages -s 32 -b 1 -m 2
501 root 2504 S /sbin/klogd -n
614 root 2256 S /usr/sbin/automount --pid-file=/var/run/autofs/_autof
675 root 2504 S /bin/sh /usr/bin/enigma2.sh
678 root 65104 S /usr/bin/enigma2
687 root 65104 S /usr/bin/enigma2
709 root 65104 S /usr/bin/enigma2
717 root 65104 S N /usr/bin/enigma2
22611 root 2824 S telnetd
22612 root 2820 S -sh
22737 root 2820 R ps
root@dm500hd:~#
更新:我顯然已經有了 /media 資料夾。
root@dm500hd:/# cd /media
root@dm500hd:/media# cd /share
root@dm500hd:/usr/share#
當我嘗試cd
它時/share
,它會重定向到/usr/share
.那我可以使用這個資料夾而不是建立一個新資料夾嗎?
更新:我現在又做了新的嘗試...
root@dm500hd:/# sudo mkdir /newfolder/share
-sh: sudo: not found
root@dm500hd:/# $ sudo mkdir /newfolder/share
-sh: $: not found
root@dm500hd:/# $sudo mkdir /newfolder/share
mkdir: cannot create directory '/newfolder/share': No such file or directory
root@dm500hd:/# $sudo mkdir /media/share
root@dm500hd:/# $sudo chmod a+r /media/share
root@dm500hd:/# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
root@dm500hd:/# edit /etc/fstab
-sh: edit: not found
root@dm500hd:/# edit /etc/fstab
-sh: edit: not found
root@dm500hd:/# open /etc/fstab
-sh: open: not found
root@dm500hd:/#
所以我需要加入美元符號?而且中間沒有空格?看來這次成功了...我首先嘗試創建一個名為新建資料夾。為什麼拒絕呢?然後我創建了 /media/share 資料夾...這對現有的影響分享之前存在的符號連結(或其他什麼)?
是sh
Bourne 外殼還是 Thompson 外殼?或是所有的 Linux shellsh
都縮寫為 Ash shell 嗎?
如何在 shell 中編輯文件?我必須fstab
在 Windows 上下載並編輯它,然後透過 FTP 將其發回。
然後我嘗試了$sudo mount -a
它給了我這個:
root@dm500hd:/# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting //192.168.0.107/recordings on /media/share failed: No such device
root@dm500hd:/#
這是我的 fstab 檔案的內容:
rootfs / auto defaults 1 1
proc /proc proc defaults 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
usbfs /proc/bus/usb usbfs defaults 0 0
/dev/mtdblock2 /boot jffs2 ro 0 0
tmpfs /var tmpfs defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
/dev/sda1 /media/hdd auto defaults 0 0
//192.168.0.107/recordings /media/share smbfs auto,user=classified,password=classfied 0 0
我會嘗試重新啟動盒子,看看它是否有效。
更新:還是沒有運氣...
它仍然給了我mount: mounting //192.168.0.107/recordings on /media/share failed: No such device
。我嘗試用電腦名稱替換 IP,但它給了我相同的訊息。
我甚至嘗試顛倒 fstab 中術語的順序(以防它是語法問題),以便我首先獲得 /media/share 。它給了我mount: mounting /media/share on /computername/recordings failed: No such file or directory
。
更新:我很幸運...
為什麼你堅持要安裝到/media/share
?這是約定俗成的事嗎?我可以掛載到另一個資料夾嗎?我透過在 Windows 中建立一個新資料夾和一個新共用然後使用mount -t cifs
命令解決了該問題。
OpenDreambox 1.6.0 dm500hd
dm500hd login: root
root@dm500hd:~# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting //192.168.0.107/recordings on /media/share failed: No such device
我認為這/dev/sda1 on /media/hdd failed
部分是因為沒有連接磁碟機。此機上盒能夠在 eSATA 連接埠上連接 HDD,但沒有連接。
我認為第二行顯示是因為 IP 錯誤。我認為它應該是 192.168.0.101,而 192.168.0.107 是我嘗試安裝的 STB 盒的名稱。
root@dm500hd:~# ps
PID USER VSZ STAT COMMAND
1 root 1724 S init [3]
2 root 0 SW [migration/0]
3 root 0 SWN [ksoftirqd/0]
4 root 0 SW [migration/1]
5 root 0 SWN [ksoftirqd/1]
6 root 0 SW< [events/0]
7 root 0 SW< [events/1]
8 root 0 SW< [khelper]
9 root 0 SW< [kthread]
10 root 0 SW< [kblockd/0]
11 root 0 SW< [kblockd/1]
12 root 0 SW< [khubd]
13 root 0 SW [pdflush]
14 root 0 SW [pdflush]
15 root 0 SW< [kswapd0]
16 root 0 SW< [aio/0]
17 root 0 SW< [aio/1]
18 root 0 SW< [ata/0]
19 root 0 SW< [ata/1]
20 root 0 SW< [ata_aux]
21 root 0 SW< [scsi_eh_0]
22 root 0 SW< [scsi_eh_1]
23 root 0 SW [mtdblockd]
24 root 0 SWN [jffs2_gcd_mtd3]
70 root 2180 S < udevd --daemon
313 root 0 SW [b_event]
314 root 0 SW [b_idle]
320 root 0 SW< [fp]
344 root 0 SW< [dmx0]
351 root 0 SW< [dmx1]
359 root 0 SW< [dmx2]
360 root 0 SW< [dmx_hw_sec]
396 messageb 2408 S /usr/bin/dbus-daemon --system
399 root 1928 S /usr/bin/wdog tpmd
400 root 4312 S tpmd
403 root 1928 S /usr/bin/wdog dccamd -
404 root 3136 S dccamd -
413 avahi 3084 S avahi-daemon: running [dm500hd.local]
451 root 4076 S nmbd -D
453 root 6780 S smbd -D
473 root 6780 S smbd -D
489 root 2504 S udhcpc -R -b -T3 -A10 -p /var/run/udhcpc.eth0.pid -i
503 root 1712 S /usr/sbin/zeroconf -i eth0
519 root 2348 S /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_host
522 root 1832 S /usr/sbin/inetd
525 root 2504 S /sbin/syslogd -n -O /var/log/messages -s 32 -b 1 -m 2
527 root 2504 S /sbin/klogd -n
640 root 2256 S /usr/sbin/automount --pid-file=/var/run/autofs/_autof
701 root 2504 S /bin/sh /usr/bin/enigma2.sh
704 root 84536 S /usr/bin/enigma2
713 root 84536 S /usr/bin/enigma2
735 root 84536 S /usr/bin/enigma2
748 root 84536 S N /usr/bin/enigma2
739 root 0 SW< [kdvb-ad-0-fe-0]
886 root 7324 S smbd -D
965 root 2824 S telnetd
966 root 2820 S -sh
1063 nobody 2292 S vsftpd
1065 root 2316 S vsftpd
1076 root 2820 R ps
root@dm500hd:~# smbd
root@dm500hd:~# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting /computername/recordings on /media/share failed: No such device
在最後一行中,我嘗試使用電腦的網路名稱而不是 IP 位址系統表文件。但這沒有幫助...也許它必須是IP,而不是網路名稱?
root@dm500hd:~# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting /media/share on /computername/recordings failed: No such file or directory
root@dm500hd:~# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting //media/share on /computername/recordings failed: No such file or directory
root@dm500hd:~# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting //media/share on /computername/recordings failed: No such file or directory
root@dm500hd:~# $sudo mount -a
mount: mounting /dev/sda1 on /media/hdd failed: No such file or directory
mount: mounting //computername/recordings on /media/share failed: No such device
我嘗試以不同的方式編輯和更新 fstab 文件,例如添加額外的空格...我想以防萬一這是格式化的事情...
這是提供我工作解決方案的部分:
我創建了一個名為夢之盒在 Windows 電腦上的 C 盤下並與每個人集團。然後我執行了下面的命令。
root@dm500hd:~# cd /
root@dm500hd:/# mkdir
BusyBox v1.15.3 (2010-10-14 16:48:44 UTC) multi-call binary
Usage: mkdir [OPTIONS] DIRECTORY...
Create DIRECTORY
Options:
-m Set permission mode (as in chmod), not rwxrwxrwx - umask
-p No error if existing, make parent directories as needed
root@dm500hd:/# /hdd/movie
-sh: /hdd/movie: not found
root@dm500hd:/# mkdir /hdd/movie
The /hdd is a syslink (symbolic link) I think so it is really located at `/media/hdd`. Note that this is the same location where `/dev/sda1` is mounted.
root@dm500hd:/# mount -t cifs -o username=user,password=pass //192.168.0.10
7/dreambox /hdd
mount: mounting //192.168.0.107/dreambox on /hdd failed: No such device or address
root@dm500hd:/# mount cifs user=user,password=pass //192.168.0.101/dreambox /hdd
192.168.0.107 是機上盒的 IP,所以這是錯誤的。共用託管 Windows 電腦的正確位址是 192.168.0.101。另外,它是“用戶名”而不是“用戶”。
這是輸出:
BusyBox v1.15.3 (2010-10-14 16:48:44 UTC) multi-call binary
Usage: mount [flags] DEVICE NODE [-o OPT,OPT]
Mount a filesystem. Filesystem autodetection requires /proc be mounted.
Options:
-a Mount all filesystems in fstab
-r Read-only mount
-w Read-write mount (default)
-t FSTYPE Filesystem type
-O OPT Mount only filesystems with option OPT (-a only)
-o OPT:
loop Ignored (loop devices are autodetected)
[a]sync Writes are [a]synchronous
[no]atime Disable/enable updates to inode access times
[no]diratime Disable/enable atime updates to directories
[no]relatime Disable/enable atime updates relative to modification time
[no]dev (Dis)allow use of special device files
[no]exec (Dis)allow use of executable files
[no]suid (Dis)allow set-user-id-root programs
[r]shared Convert [recursively] to a shared subtree
[r]slave Convert [recursively] to a slave subtree
[r]private Convert [recursively] to a private subtree
[un]bindable Make mount point [un]able to be bind mounted
bind Bind a directory to an additional location
move Relocate an existing mount point
remount Remount a mounted filesystem, changing its flags
ro/rw Read-only/read-write mount
There are EVEN MORE flags that are specific to each filesystem
You'll have to see the written documentation for those filesystems
正如您所看到的,這是一個錯誤的語法。必須使用其中一種選項。
root@dm500hd:/# mount -t cifs -o username=user,password=pass //192.168.0.10
1/dreambox /hdd
root@dm500hd:/# mount -a
mount: mounting //computername/recordings on /media/share failed: No such device
最後一行是因為我仍然將該行新增到 fstab 檔案中。編輯 fstab 檔案並刪除我先前新增的這一行後,此mount -t cifs
命令生效。
root@dm500hd:/# mount -a
root@dm500hd:/# $sudo mount -a
root@dm500hd:/#
mount -a
請注意,當我執行或 時,沒有錯誤輸出sudo mount -a
。
答案1
最簡單的方法是使用 SMB 協定。在您的 Linux 電腦上,為共用資料夾建立掛載點:
$ sudo mkdir /media/share
$ sudo chmod a+xr /media/share
第二個指令將 `/media/share/directory 設定為可讀且可執行(表示使用者可以變更到該目錄):全部用戶。
在 *ix 系統上,安裝磁碟機(本機或遠端)的設定在檔案中設定etc/fstab
。文件的一般格式為:
DRIVE LOCAL_MOUNT_DIRECTORY FILESYSTEM OPTIONS
在你的 Linux 機器上編輯/etc/fstab
並新增以下行:
//x.x.x.x/recordings /media/share smbfs auto,user=USER,password=PASS 0 0
變更x.x.x.x./YouShareName
為顯示您的 Windows 伺服器的 IP 並正確設定 USER 和 PASS。如果一切順利,它應該可以工作,並且將在(linux)系統重新啟動時安裝。若要在不重新啟動的情況下進行測試,請執行:
$ sudo mount -a
有關更多資訊和更詳細的操作方法,請參閱這裡。