Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Server running on desktop, since my aunt that lives with me is taking classes for MS office it is currently booting XP, so i have setup sharing of all my drives so i can access my files

but how can i auto mount those drives at boot and also with help of script? i need the script cause I'm often messing around on laptop and tend to loose connectivity so the scripts need to unmount and den remount, sort of like a referesh.

I have no user id or pass setup on Windows and the drives NTFS permission is set to allow everyone.

how do i achieve what i need?

PS: i managed to create a script but it asks for password every time it mounts a share!!!

share|improve this question
up vote 1 down vote accepted

The best way to do this is to create an entry in your /etc/fstab. This is the file that handles automatically mounting drives. If you have no credentials set and don't care about security, you would need to add a line like this:

//fileservername/path  /media/fileshare  cifs  username=guest,iocharset=utf8,file_mode=0777,dir_mode=0777,nobootwait   0   0

Replace fileservername/path with the hostname (or IP address) of the PC that is sharing the files, and the share name. /media/fileshare is where you want to mount the share locally. This directory must already exist. When you need to re-mount this drive, say after a connection loss, etc. use the following:

sudo mount -a

That will attempt to remount any filesystems mentioned in fstab.

share|improve this answer
thanks! but i ended up using gigolo and running that app on startup but m always glad to know other alternatives – sarveshlad Sep 21 '12 at 23:37
hey this method is not working, I have asked my question here: – edward torvalds Nov 10 '15 at 17:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.