Automatically mounting internal hard drives in Ubuntu

As I am sure anyone with their music on a different internal drive has noticed, not all of your internal hard disks are mounted automatically at boot. However, getting an internal hard drive to automatically mount is fairly easy.

First, reboot your computer to make sure that no other drives are mounted. Then, mount the internal drive you wish to have mount automatically. You can do this by selected the drive from the “Places” menu and entering your password.

Now, open a new terminal and enter this:

df

Look for the drive mounted at /media/disk. For me, this was /dev/sdb1.

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdc1            152333348  24986968 119608276  18% /
tmpfs                  1036224         0   1036224   0% /lib/init/rw
varrun                 1036224       104   1036120   1% /var/run
varlock                1036224         0   1036224   0% /var/lock
udev                   1036224      2856   1033368   1% /dev
tmpfs                  1036224       384   1035840   1% /dev/shm
lrm                    1036224      2000   1034224   1% /lib/modules/2.6.27-7-generic/volatile
/dev/sdb1 240362656 219662284   8490572  97% /media/disk

Quit any applications that may be using that disk (Music players, file browsers, etc.) and enter this:

sudo umount /media/disk

Once the drive is unmounted (which is should be after you enter your password) enter this:

sudo mkdir /media/disk

Then, open your fstab file:

sudo gedit /etc/fstab

In the new gedit window (which will appear after you enter your password), enter this at the bottom of the file:

/device/path /media/disk    fs_type rw    0    0

Make sure to replace /device/path with the device mounted in /media/disk when you ran df. fs_type should be the file system type of the drive, probably ext3. Those are TABS, not spaces, between each item.

Save the file, and restart to make sure your drive auto-mounts.

Leave a Comment