How to mount a networked harddrive or share

From OpenFSG
Jump to: navigation, search

This page explains how to mount an external networked drive or share to access it the same way as the built in harddrive.


Mounting a networked harddrive or share

These instructions assume that you are using the 4.3.8 firmware.

ping 192.168.0.5 (change the ip number to reflect the ip of the networked harddrive or host computer)

the result should look something like this:

/ # ping 192.168.0.5
PING 192.168.0.5 (192.168.0.5) 56(84) bytes of data.
64 bytes from 192.168.0.5: icmp_seq=1 ttl=128 time=0.467 ms
64 bytes from 192.168.0.5: icmp_seq=2 ttl=128 time=0.426 ms
64 bytes from 192.168.0.5: icmp_seq=3 ttl=128 time=0.310 ms
64 bytes from 192.168.0.5: icmp_seq=4 ttl=128 time=0.400 ms
64 bytes from 192.168.0.5: icmp_seq=5 ttl=128 time=0.520 ms
64 bytes from 192.168.0.5: icmp_seq=6 ttl=128 time=0.317 ms
64 bytes from 192.168.0.5: icmp_seq=7 ttl=128 time=0.384 ms
[3] + Stopped                    ping 192.168.0.5

Halt the pinging by pressing ctrl+z simultaneously.

mkdir /mnt/newdisk

Of course you can call it something else than "newdisk".

vi /etc/fstab 

This will load the file fstab in the vi text editor. Type i to get vi into insert mode. It helps checking basic vi commands, especially if you are a Windows user. And no, when you type i to get into insert mode, it won't show. You will just notice that you suddenly can enter text. Add the following line, but DO NOT change anything else!

//192.168.0.5/share /mnt/newdisk      cifs    noauto,rw,sync,noatime,nodiratime,username=XX,password=XX

Change the ip, and path to whatever you have. Replace "xx" with the login and password used to access the networked drive or shared folder. If you want to be able to automount at startup, remove "noauto".

When you are done, hit "esc" to leave insert mode and then type:


:w (yes, you need to type the colon ":" as well) and ENTER to save the file

:q (again, yes type colon as well) and ENTER to quit vi


lsmod

If you have cifs loaded it should read something like this:

[root@FSG:/home]# lsmod
Module                  Size  Used by
cifs 219636 1 - Live 0xbf0df000
mwl 119704 1 - Live 0xbf0c0000
wlan_acl 2144 1 - Live 0xbf0be000
wlan_wep 3616 1 - Live 0xbf0bc000
wlan 100764 4 mwl,wlan_acl,wlan_wep, Live 0xbf0a2000
ixp400_eth 15356 2 - Live 0xbf09d000
ixp400 638592 1 ixp400_eth, Live 0xbf000000 

If not, you need to load the cifs module, again at the command prompt:

insmod /lib/modules/2.6.18/kernel/fs/cifs/cifs.ko

then run "lsmod" again to check if now it's loaded in memory.

mount -t cifs -o //192.168.0.6/share /mnt/newdisk

Then check if the new disk has been mounted:

ls /mnt/newdisk

If everything worked you should now see the content of your networked drive in the /newdisk folder.

insmod /lib/modules/2.6.18/kernel/fs/cifs/cifs.ko 

If you didn't remove the "noauto" part in fstab, you also need to add:

mount -t cifs -o //192.168.0.6/share /mnt/newdisk

Lastly, if you get stuck, follow this thread.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox