March 13, 2008
Mounting a network drive on boot under Kubuntu Gutsy 7.10 running on an Acer 5100-3357 laptop.
You
may as well forget about using the Kubuntu way to mount a network
drive, since it has never worked for me and seems as if no one cares
that it doesn't work. The process you would try would be
Kmenu>System Settings>Advanced>Disk&File Systems, and then
add a network device. This method I have never gotten to work, but the
following method works reliably.
I need to edit the /etc/fstab
file and create several others files. Our network requires a login name
and password to access it, so I created a hidden login file to pass the
variables into the mounting command.
To do this edit, I prefer
to use a very primitive but good text editor called vim. This must
first be installed using the Adept package manager. It is called
vim-full. Four packages will be installed.
Open a console under Kmenu>System>Konsole and change to the /etc directory using: cd /etc
Open the file using: sudo vim ./fstab which will open the fstab file for editing, after you supply the root password.
Go
to the end of the file using the arrow keys and then press the insert
button to put the editor into the insert mode. Add a line by typing
"return". Add the following:
//192.168.X.Y/nwdrive /media/nwdrive smbfs credentials=/root/.smbcredentials,dmask=777,fmask=777 0 0
Stop
edits by typing the escape key and then save the file using :w
<enter>. You can quit the editor by typing :q <enter> The
file is finished, but there is more to do.
You can use other editors, but you must be super user.
The
X and Y refer to you network server IP address, and the nwdrive refer
to your mount point. On my drive, I have created a mount point called
/media/nwdrive using the command sudo mkdir /media/nwdrive
<enter> and after created, changed permission of the directory
using sudo chmod 777 /etc/nwdrive <enter>.
The only
remaining detail is to create a login name and password file called
.smbcredentials. You do this by changing to the root directory using cd
/root command in the console.
You will create a hidden file using:
sudo vim ./.smbcredentials <enter>
This will create a new file. Press INS to insert text. I need 2 lines: The first for the login name and the second for the password.
username=<your login name> password=<your password>
Type ESC to quit insert mode and :w <enter> to save the file. Type :q <enter> to quit.
We
are now finished with the network logon changes and only need to test
it. The way to remount all devices, which will automatically mount your
new mount point, is to issue: sudo mount -a. This will
force the system to reread the fstab file and to mount all devices. If
an error occurs, it will be shown. Otherwise, no message will occur.
The screen will go back to a command prompt.
But before we try, we will have to get a couple programs from the repository using Adept. They are samba, and smbfs.
Once
installed, issuing the mount command should result in no return
message. You should now be able to browse the network file server.
| |
|
|
|
|
 |
|