Jul
02
2009

Mount a partition in Ubuntu automatically at startup

Everytime I boot Ubuntu, I have to mount all the partitions I need to get them up and running. But seriously, I find it annoying. Here’s a workaround that worked for me.

Identify the partition you want to automount. Mount that specific partition and open its content using File Browser. Keep in mind it’s mount point, the ones found on the location bar.

Advanced knowledge in using Linux IS NOT A prerequisite. :D

Mount point

Open System Monitor (System -> Administration -> System Monitor). Go to the File Systems tab and find the corresponding Device of the mount point. The format would be something like /dev/sd[a-z][1-9].

Unmount the device by going to Places -> Computer. Right click the partition and click Unmount Volume.

Now, open terminal (Applications -> Accessories -> Terminal). Navigate to /dev/disk/by-id by typing this command:
cd /dev/disk/by-id.

Get the list of files and directories on the path by typing ls. Find your appropriate device. If it's /dev/sda3, it should end with something like -part3. Copy the file name and paste it somewhere else such as a text-editor.

Now, edit /etc/fstab by typing the command sudo gedit /etc/fstab. At the end of the file, paste this:
/dev/disk/by-id/[replace_01] /media/disk [replace_02] defaults 0 0

Replace replace_01 with the filename you pasted somewhere else a while ago and replace_02 with the file system of the partition (ntfs, ext3, etc).

It should look like this:
/dev/disk/by-id/scsi-SATA_ST9160821AS_5MA20LDN-part1 /media/disk ntfs defaults 0 0

Now, create the /media/disk folder by typing the command:
sudo mkdir /media/disk

Finally, mount the volume by typing:
sudo mount /media/disk

The partition should automount automatically the next time you reboot it. Have fun!

Done reading? You are free to share your comments or insights regarding my post. You may also want to get updates thru RSS feed or thru email. You may also share this article to your Facebook friends or Twitter followers for free.

3 Responses to “Mount a partition in Ubuntu automatically at startup” (join them?)

 
Ed Salisbury
July 3, 2009 at 12:56 am

Good post – I’m more command-line oriented, so I wrote this to do the same thing from the command line: http://bit.ly/CO2Wl


 
Alonso
August 11, 2009 at 11:03 am

good guide thanks , I hope it works.


 
Gintarman
October 1, 2009 at 6:07 pm

That works fine. Nice :)


Leave a reply!