Category Archives: Ubuntu

Ubuntu how to tips

Auto mount drive (or partition) at startup in Ubuntu

Intro

Do you have a hard drive that you want to be mounted at startup?
I did too, and I got it working, thanks to these steps


What happened

I have two hard drive’s in my computer, one is an older 40GB hd (my system disk) and another is a newer 160GB hd. The older one is slow so I decided to format my computer and reinstall Ubuntu. When I was installing Ubuntu I made the entire 40GB hard drive swap space (its an old drive, and I don’t know how long it has to live) but when I finally booted into Ubuntu, it wasn’t mounted, I had to do it manually, and I don’t want to have to do that every time I turn on my computer


Steps
“Device” value highlighted
  1. Open Terminal (CTRL + ALT + T).
  2. Type sudo mkdir /media/disk and press enter.
  3. If you have more than one disks that you want to have mounted at startup run this again except with a different name
    IE.
    sudo mkdir /media/disk1 thensudo mkdir /media/disk2 etc.
  4. Open “Disks” and select the drive you want to auto mount.
  5. Click on the partition (if any) you want to auto mount.
  6. Find the value “Device” (my one was /dev/sdb2).
  7. Go back to terminal.
  8. Type  gksudo gedit /etc/fstab and wait for a text editor to come up.
  9. In the text editor press CTRL + END to go to the end of the document.
  10. Press enter 4 or 5 times.
  11. Type the “Device” value you got before from the “Disks” window (my one was /dev/sdb2).
  12. Press tab, and type the folder path we made for the device before (/media/disk).
  13. Press tab and type “defaults”.
  14. Press tab and type “0″, then press tab again and type (again) “0″.
  15. Save the file and close the text editor.
  16. Restart your computer.
  17. Open “Disks” and click your hard drive, then click the partition we are auto mounting.
  18. Click on the button with the cogs (the one below the partition part, not the one at the top of the window) and click “Edit Mount Options”.
  19. Give the device a display name (I called my one “Swap Space”).
  20. Press OK.
  21. Restart your computer then open “Disks” again, click your hard drive and partition, there should be a stop button below the partition part. You are now done and the partition will be mounted every time you start your computer. (if you see a play icon, something went wrong).

Now I can enjoy a faster computer!