Ubuntu Networking :: Automatically Mount A Folder Over Ssh?

Sep 23, 2010

I'm following:To automatically mount a folder over ssh..

everything seems ok[I think?!]
It dosent mount on reboot...
if i take 1 line from the file /etc/init.d/sshfs

[code]....

View 1 Replies


ADVERTISEMENT

Ubuntu Networking :: Automatically Mount NFS Shares Without Autofs?

Jan 24, 2010

Setup clients on a LAN to automatically mount NFS shares whenever the fileserver is up, without using autofs. Instead a simple bash script which checks if the server is up, and if the shares need to be mounted or unmounted is called by a custom upstart job. For a small office or home network populated with Unix-like computers (e.g., a few Ubuntu desktops or laptops and a fileserver), NFS (Network File System) is a good way to share storage space and centralise the backup of important documents. However, having a fileserver running 24/7 is often overkill for such a setup.

One way to have clients mount NFS shares automatically when the fileserver is turned on, is to use a package called autofs. Unfortunately, there are a few unresolved issues with using autofs in combination with NFS. In my case, when autofs tries to mount NFS shares when the fileserver is turned off, the Gnome desktop, and Nautilus in particular, becomes extremely unresponsive, regardless of the options used. Attempting to mount the share manually from the command line when the server is down however, does return a message of failure quite promptly, without hanging the desktop.

To solve this issue, I wrote a simple bash script that is run through the upstart system. The script simply checks if the fileserver is up, if the shares need mounting or unmounting, and then sleeps for a while before checking again. This works out quite well, so I decided to share this information in case someone else runs into these issues. PrerequisitesThis howto assumes that you have an NFS server set up with shares exported, and one or more clients capable of mounting those shares. For more information on setting up NFS shares and mounting them on a client from the command line, see: SettingUpNFSHowTo.

Clients should be able to ping the server to determine if it is running. Naturally, you need administrator access on the clients to install the script and upstart job outlined below. This script assumes that the directory paths of the shares match the location where they are mounted. In my case, the fileserver has two shares: /media/Storage and /media/Backup. On the clients these shares are mounted on the same paths. If your setup deviates from this, the script needs some modification. The script From the desktop of one the clients, paste the following bash script as a new file in your favourite text editor:

Code:

#!/bin/bash
# The hostname or IP-address of the fileserver:
FILESERVER="myfileserver.local"
# Check every X seconds (60 is a good default):

[code]...

Now adjust the FILESERVER variable. In this example, my fileserver is called myfileserver. By default, Ubuntu sets up your networking environment in such a way, that computername.local can be used to reach that computer over the local network, so the network name for myfileserver is myfileserver.local. Of course, you can also use the IP-address of the server. Next, change the MOUNTS variable to match the NFS shares exported by your NFS server. MOUNTS is an array; multiple entries are separated by spaces. So if you have one share exported as /media/MyShare, that line would look like this:

Code:

MOUNTS=( "/media/MyShare" )

An advantage of mounting shares in /media, is that they automatically show up as mounted drives on the user's desktop. Note that this howto assumes that you use the same paths for the share on the server and client side! Save the script to your desktop with an obvious name. In this example we call it mount_my_nfs_shares. Open a terminal and cd to the desktop. Make the script executable by calling:

Code:

chmod +x mount_my_nfs_shares

Next, move it to a place where it can be called by our upstart job, but also from the console to test. A good place to put such custom executables is /usr/local/bin.

Code:

sudo mv mount_my_nfs_shares /usr/local/bin

This script uses the logger command to tell the system's log what it is doing. To test this script, open up two terminals; in one, execute the following so we can monitor the log messages:

Code:

tail -f /var/log/syslog

In the other, simply execute mount_my_nfs_shares. If the script works, your shares should show up on the desktop and the computer:// location in Nautilus. If the fileserver goes down or becomes unreachable, the shares should disappear, and reappear when the fileserver comes back on-line. If this works, move on to the next step. Installing a custom upstart job The next step is to have the clients automatically run the above script when they are booted. We can use upstart for this. Create a new text file, and enter the following:

Code:

# mount_my_nfs_shares - mount NFS shares on fileserver, if present
description"Mount NFS-shares"
start on (filesystem)
respawn

[code]....

How the script works The script enters an eternal loop and keeps checking if it can reach the fileserver once every minute (unless you adjust the INTERVAL variable). If it can reach (ping) the fileserver, it checks if the mounts are already mounted by searching for them (grepping) in the output of mount. If they are not mounted, it tries to mount them. Else, if the server is down, it looks in the output of mount to see if these mounts exist. If they do, it tries to unmount them with the -f flag (useful for unmounting unreachable NFS shares).

View 9 Replies View Related

Ubuntu Networking :: Mount Network Drive Automatically ONLY When Present?

Jun 10, 2011

I have a network drive connect to my lan with iomega's iconnect device. I am getting tired of mounting the drive manually each time I want to use it. I would like therefore to have it mounted automatically on boot by placing a line in fstab, but since the computer (a laptop) won't always be connected to my home lan, this might cause problems. Is there a way to list the drive in fstab so if the drive is not present it will just move on?

View 8 Replies View Related

Ubuntu Networking :: Get Lucid Connected To An SME Server 7.4 To Automatically Mount Windows Shares?

May 4, 2010

I have beating my brains out trying to get Lucid Lynx connected to an SME Server 7.4 to automatically mount windows shares. The winbind stuff seems to work okay after I installed a restart script in /etc/network/if-up.d (kudos to OsGnuru & bobpaul for that) There is a short wait on network up before winbind can validate but that is not a show stopper. I have looked at (what I think) is the correct log for pam_mount and it seems to be running through to the end process okay. It looks like it is either not reading the pam_mount.conf.xml file or I have not configured it correctly as it just reports "No Volumes to Mount". I have appended the log file, pam_mount auth, password, session & common conf files as well as the pam_mount.conf.xml file for review.

View 1 Replies View Related

CentOS 5 Networking :: Mount A Win Shared Folder?

Oct 1, 2009

I'm running CentOS 5.3 fully upgraded on a test server. I'd like to create a virtual machine, and host the VM files in a shared folder located in another windows server.

I can access this folder usign the graphic browser, but I'm inable to mount it in a local folder.

I tried with mount -t smb //server/folder /localfolder/

View 2 Replies View Related

Ubuntu Networking :: Mount Windows User Share Folder At Login?

Sep 29, 2010

i need to always mount the user share of my Windows server at Ubuntu login.

This is my server struture:

Server
|-Group1
| |-user1
|
|-Group2
|-user2

ive found that i need to configure pam mount and i have this example:

<volume user="user" fstype="smbfs" server="krueger" path="public"
mountpoint="/home/user/krueger" >

but i dont know what to change relative to my server folder struture.

View 9 Replies View Related

General :: Setup Fstab To Automatically Mount NTFS Partitions - GUI To Set The Mount Permissions?

Feb 10, 2010

I am trying to setup fstab to automatically mount my NTFS partitions. I have used various Mount managers to create the entries in fstab. The fstab seems fine, but when mounting at boot or even via Nautilus I get the error message that I do not have permission to mount the disk.

1) Can this permission be set in the fstab file? If so what is the syntax of the fstab entry?

2) If not, is there a tool i.e. GUI to set the mount permissions?

View 14 Replies View Related

Hardware :: Stop USB Stick To Mount Automatically And Mount It Manually?

Jan 26, 2011

I need a guicance related to mounting USB stick of 2GB capacity. Normally when I insert my USB stick it mount automatically and show me.I want that instead the usb mount automatically I manually mount it. Now there are two steps to do it. First How to stop USB to mount automatically ? Second How to mount it manually ?

View 1 Replies View Related

Fedora Networking :: Unable To Mount Windows Server Folder

Apr 29, 2009

I use F10 at home and while away from work on my laptop. Recently I could get the VPN sorted out ( I can now connect to the vpn (ppp0) server at work from home or anywhere else). I am trying to mount a windows folder that is on the work server on my F10 box at home through the VPN connection that is first established.What I know about the windws server

servername
sharename
username
password

When I try this

sudo mount -t cifs //pxxxx/home/abcd /mnt/dir/ -o username=abcd,password=xxxx

I get this error

mount error: could not resolve address for pxxxx: Name or service not known
No ip address specified and hostname not found

I think the VPN connection is established successfully. I have a ppp0 connection under ifconfig with an IP address after vpn connection is established.In windows I just map the network drive (\pxxxxhome) username=abcd, password=xxxx and mount the folder as "abcd on pxxxxhome"

View 3 Replies View Related

Ubuntu Networking :: Shared Folder Not Visible / Error: Failed To Mount Windows Share?

Jan 2, 2010

I have two computers running Ubuntu 9.10, both have one shared folder. These were set up via Nautilus.

On computer 1 I can see and use the shared folder of computer 2 just fine.

On computer 2 I can NOT see the shared folder of computer 1 anymore since recently. I has worked in the past.

Some more information: the name of computer 1 is "daniel", the share name is "gedeeld". So the address of the shared folder of computer 1 would be smb://daniel/gedeeld/
Opening this address in Nautilus works fine on computer 1 (that shares the folder), but results in an error on computer 2.

Error: failed to mount Windows share. Please select another viewer and try again.

View 1 Replies View Related

General :: Mount A Folder Names Sever Under Apps Folder?

Feb 4, 2010

In the linux machine we need to mount a folder names sever under apps folder with the user as steve. Also the steve user should have the permission to create the files in the folder. As of now, its mounted as root user.steve is in list of sudo users.

View 4 Replies View Related

Server :: Increasing Size Of /var Folder Or Mount To Another Folder?

Nov 16, 2010

I'm installing things in a new Red Hat server and saw that the /var folder is full (100%). I need this folder to have more space or another kind of solution because this server is going to be used as a print server.

View 7 Replies View Related

Ubuntu :: Print From Folder Automatically?

Apr 11, 2011

I need to setup a network scanner which will scan to a folder via the network onto an Ubuntu pc. When the file is scanned I need the Ubuntu pc to automatically print the file to the default printer and then deletes the scanned file.

I haven't been using Ubuntu very long and was not sure how to achieve this. I was wondering if perhaps I should write a script, after learning how to, that checks the folder for any files and then prints them. Once printed it then deletes the files. Would I need to have this script running via a scheduler that runs the script every second? Or is there another way to achieve this?

View 2 Replies View Related

Ubuntu Servers :: How PID Folder Deleted Automatically

May 25, 2010

I'm new to Ubuntu (at least on server distributions). I used debian versions for a long time and thought, to try ubuntu LTS 10.0.4, because of the long time support cycle. I had problems, to install this distribution on a x86 platform (used with ASUS P4B533-v), because of kernel panic after installation. So I used a trick to get it running. I installed Ubuntu LTS 8.04 and compiled a kernel 2.6.34 and made a distupgrade. All went o.k. and is now running as a productive system.

My question now belongs to the used pid folder /var/run. I'm using some self compiled programs and had to create a separatly folder (e.g. /var/run/stunnel). My problem is, after rebooting the system, the folder is deleted automatically! Never saw this issue on other distributions. Is there any reason why? Of course, I can write a section in my init script, searching for existing folder and if not, creating it ...

View 2 Replies View Related

Ubuntu Installation :: How To Automatically Mount Second HD

Jan 7, 2010

I have installed the second drive, I have partition it and now it is OK. How could I make it to mount automatically at boot so it could be accessed easily, please?I understand that I have to use some commands (forgot where I read that) but have no idea how to do it.Is there an application with GUI to do that, so I will not make mistakes in terminal?

View 2 Replies View Related

Ubuntu Servers :: Folder Permissions Automatically Set When Creating File

Apr 27, 2010

I have a little problem: I have a share folder on Ubuntu server: - Dump That folder is share with SAMBA and everyone can put files on it
My problem is the following: When someone create a folder, the folder permissions are automatically set with:
(let's take my username: Yann)

Owner: Yann
Group: Yann

Clearly that's wrong.. I want the Group to be auto set has "users" so everyone can access the folders on that share. Anyone know how to change this ? chmod and chown is getting a bit boring

View 2 Replies View Related

Ubuntu :: Mount FAT32 Drive Automatically?

Jan 12, 2010

I am setting up a home server and have two hard drives. One is the main HD for system files and the other will be for personal files.

The personal HD is /dev/sdb.

I know I have to edit fstab in order to get it to mount automatically at boot, but I am having trouble with the commands.

I would like for it to mount at boot and have full read-write access from any user.

View 3 Replies View Related

Ubuntu :: Mount Partition Automatically At Start?

Mar 28, 2010

recently i was trying to mount my partition automatically at start up ...so i gone through some tutorials on the net nd made some changes in /etc/fstab file (i made a back up before making any changes). when i was changing permissions of folder in which i tried to mount my all partitions i got my system screwed up.then it was showing following error at start up and GUI was not turning up. "could not update ICEauthority file " also my sudo was not working so first i restored original fstab file through recovery console then i googled out about above errors. I found some solution now my system is working but showing strange behaviour like:

> ubuntu is not detecting any of my hdd partition

> disk utility is not working (showing no error)

>fdisk -l shows nothing

> no new software is getting installed via ubuntu software center (shows no error when clicking on install but nothing turns up)

>i cannot restart or shutdown my system from GNOME it only logs off my session (although through terminal its working)

>no media player showing sound controls enabled

>gnome not showing ethernet or sound volume icon in upper panel (although net is working)

>users and groups from system->administration menu is not working (error:cannot load configuration)

i think most of the administrative tasks are not working.........i googled out but found nothing satisfactory..i dont want to reinstall it, coz i m not very experienced with linux n it took about a whole month to customize my ubuntu 9.10 on my college internet...

View 6 Replies View Related

Ubuntu :: Automatically Mount Sshfs Upon Startup?

Jun 17, 2010

I use this command to mount sshfs:sshfs -o idmap=user user@ip:/home/user/public_html ~/FolderThen I enter my password. I do this every time I start my computer

View 3 Replies View Related

Ubuntu :: Automatically Mount A Drive On Boot-up?

Sep 15, 2010

I have just installed 10.04 and am enjoying the quick clean boot. I have a dual-boot option as I have come over from XP. Most of my data is still on the old 'c:/' drive and I have to manually mount it every boot-up. Is there any way to automate this process?

View 4 Replies View Related

Ubuntu Servers :: Automatically Delete Files Older Than 6 Months In Folder

Mar 27, 2010

I have server running ubuntu. There is folder /var/netflow and I have there files, which creates every 5minutes new ones(monitoring traffic on network). And I need to delete files older than 6 months manually. Can you help?

View 2 Replies View Related

General :: How To Mount Automatically

Jan 5, 2010

I want to mount a partition automatically when ubuntu starts.I have read some articles about but i think i make some mistake.I have read about etc/fstab and I wrote a statement below./dev/sda5/home/xyz/Desktop/ABC udf,iso9660 user,auto,exec,utf8.

View 4 Replies View Related

Fedora :: Automatically Opens Folder Locations In Amarok

Nov 9, 2010

Fedora :: automatically opens folder locations in amarok

View 1 Replies View Related

Fedora :: Automatically Copy An Flashdrive To A Predetermined Folder?

Feb 13, 2011

Just wanting to know if there is a program or script or something I can use that will automatically copy all my files from a flashdrive, to a predetermined share, whenever that flashdrive is plugged into the server.

View 1 Replies View Related

OpenSUSE :: Automatically Keep Htdocs Folder In Sync With SVN Repository?

Apr 27, 2010

I've setup both a http server and svn server and have a SVN project residing in the "/srv/svn/kdrepos/THOR/" directory. I would like this project to automatically do a checkout into the /srv/www/htdocs/ on update/commit. Is this in any way possiblely? Some sites (xp-dev) for example offer an option to have a repository automatically 'added' to a webserver. Does anyone know how is done? I'd xp-dev if it wasn't for the fact that I also need full access rights on the machine

View 1 Replies View Related

General :: Automatically Copy An Flashdrive To A Predetermined Folder?

Feb 13, 2011

The reason I ask is, we have a home server running Fedora 12. I would like to be able to let anyone just plug in a flashdrive, and have Fedora automatically grab and copy all the files on that flashdrive to a specific share.

View 1 Replies View Related

Software :: Way To Automatically Copy Files Off Of A Cd To A Specific Folder?

Jun 24, 2011

What would be the best way to automatically copy all of the data off of a library of cds to a specific folder on the computer? I was thinking of running a bash script but I've run into a few snags figuring out the correct way to do it. Mainly due to the fact that the cd drive is mounted in a different folder in /media each time I insert a new diskAlso, the mounting and unmounting process causes it's own problems, but I think that could be covered by a for loop that checks /mtab every few seconds or so.

View 2 Replies View Related

CentOS 5 :: Settings To Delete TMP Folder Automatically At Shutdown?

Jan 27, 2010

It seems to me that the /tmp folder is currently crowded with old stuff. How can I tell CentOS to always automatically delete all /tmp folder content just before shutdown?

View 4 Replies View Related

Ubuntu :: USB Hard Drive Doesn't Mount Automatically?

May 28, 2010

The other day a power outage affected an SSH server I have running 9.04 (32-bit desktop ed.). I have two external USB hard drives used for cron-scheduled backups (one for rsync, one for an incremental) that are connected at all times. When I reboot, they no longer mount automatically until I login to the gnome desktop. As far as I can remember, they always mounted automatically before as disk-1 and disk-2, but now I have to login to the gnome desktop and then log back out.

I never had them listed in the fstab before since they just worked, & hope to avoid doing it this way since the drives sometimes get their paths (sdd and sde) interchanged. However, is the best way to fix this to use UUIDs in fstab vs. using sde or sdd? (such as in this post: 4highlight=external+hard+drives+don't+mount+boot Or maybeust remembering incorrectly & ubuntu doesn't mount them automatically until login? Sometimes I have to reboot remotely, & this problem would cause the rsync to fill up my system drive.

View 2 Replies View Related

Ubuntu :: Windows Partition Won't Mount Automatically At Startup?

Jun 2, 2010

I had to re-install Windows XP because the install was running slow.So, I created another partition using GParted for my personal data and moved my files there and re-installed Windows XP.Now, the Windows partition won't mount automatically.NTFS Configuration Tool shows 0.0GB. So, I have to open up a Terminal window, and issue sudo mount /dev/sda1 /media/Windows and everything is fine.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved