How to mount a networked harddrive or share
From OpenFSG
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.
- First make sure you know how to access the FSG-3 using SSH and how to become root. Basically this involves using software such as Putty or Poderosa to connect to the FSG.
- Login to the FSG via SSH and become root.
- Next, make sure that your networked harddrive or the computer that hosts the shared folder is accessable by issuing the following command (remember, as root):
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.
- Now you've established that the host computer or networked harddrive is accessable to the FSG. Its time to make a folder where we will mount the harddrive, a mount point. Normally this would recide in the "/mnt/" folder. At the command prompt type:
mkdir /mnt/newdisk
Of course you can call it something else than "newdisk".
- There is a text-editor shipping with FSG-3, called vi. At the command prompt type (And remember, Linux is CaSe SeNsitive!):
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
- Next its time to check if the cifs module is loaded. At the command prompt type:
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.
- Now its time to try to mount the external networked drive. At the prompt type:
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.
- If your FSG didn't have the cifs-module loaded, you will have to make a script to autoload it at startup - otherwise mounting will not work the next time you start the FSG.
- Read here how to create a script that autoloads at bootup. In your new script you need to add:
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.
