7.19.2011

Automount « Life, the Universe, and Everything

Linux Automount « Life, the Universe, and Everything


Are you using Ubuntu and sick of mounting the Hard-DIsk partitions when installing windows ? Then yes, this post might seem to be worth reading :)

I am going to post about how you can automount all of the partitions available on system boot up.

Now, just open the terminal and follow the instructions as below:

  • In case you are afraid, that I’m going to ruin you configuration be sure, to make a copy of the file /etc/fstab by typing this in terminal:
    1sudo cp /etc/fstab /etc/fstab.orig

    At any point of time, if you think of reverting back to the old configuration, them simply type this in terminal:

    1sudo mv /etc/fstab/orig /etc/fstab
  • Now, to find out the locations for drives which are to be auto-mounted type this in terminal:
    1sudo fdisk -l | grep NTFS

    (Because, NTFS is the default format for Windows drives. SO, we are searching for them only!)

    The output of the above command will be something like this:

    The name of the partitions will be similar to: /dev/hdxn or /dev/hdsn, where x is an alphabet (a – z) and n is a number. Eg. : /dev/sda1

  • Now, type this in your terminal:
    1sudo gedit /etc/fstab

    And, find the lines which match the device location you found in previous step and change it to the following. In case, there is no entry corresponding to the devices, just add one line for each device in the format:

    1 /media/ ntfs-3g defaults,user,locale=en_US.utf8 0 0

    Where, refers to device location and is the location you want your drives to mount upon. (See the picture)

    Almost done, save the file and close it.

  • You will need to create mount point for each NTFS partition before you can actually mount them.Type the following line for each mount point:
    1sudo mkdir /media/

    Now, mount all partitions with command:

    1sudo mount -a

    Chow! Next time you boot up your Ubuntu, you won’t need to manually mount each of the partitions :)

No comments: