Auto mount windows drives at startup (Ubuntu 8.10)
Posted by stringofthoughts on April 16, 2009
I have been trying to do auto mount of drives at start up but in ubuntu there is a lot of problems in mounting drives from command line. It works by all means but there is so many problems like mounting drives in /mnt directory. When your mount point is in /mnt ( or any other directory in / like /windows) mounted drives disappears from the side bar.
The other thing that i wanted was to retain the nice right click unmount facility available in ubuntu. But when the drives are mounted from command line then right click -> unmount doesn’t work.
This really helps if the mount point is same as the label of the drive. It helps in understanding where are the files are like if you have a drive labeled “Movies” you would like a mount point like /mnt/Movies or /media/Movies but if there are many drives then making all these mount points is really tiresome.
The script I ‘ve written does everything for you and it also retain the nice right click facility provided by ubuntu.
Download the script from here mount_win_drives . ( This script is only tested on Ubuntu 8.10. Download link for new version is at the end of the post )
It’s a doc file so make a file “mount_win_drives.sh” and copy paste the content of doc file in it and save it. Now your script file is ready. Do the following steps.
1) copy mount_win_drives.sh to /etc/init.d
$ sudo chmod +x mount_win_drives.sh
Before updating the runlevel just run the script to check it’s working alright. You might see error msgs if the drives are already mounted.
$ sudo ./mount_win_drives.sh
If it’s working, update the runlevel to make it work at startup.
$ sudo update-rc.d -f mount_win_drives.sh start 99 2 3 4 5 .
That’s all. The next time you’ll boot your drives will be already mounted and ready to use and the right click utility of gnome-mount / gnome-unmout t is also working perfectly .
Have fun 🙂
I’ve modified the existing script to work with any debian based linux distro. The older version was only tested in Ubuntu 8.10.
Download the new script from here mount_win_drives_new .