Friday, April 10, 2009

How to make Ubuntu Mount a Drive at Startup

  1. First thing you got to do is Mount the drives you wish to be mounted at startup
  2. Then run the following commands
    • sudo fdisk -l
    • cat /etc/fstab
    • df -h

    This commands will show you the following information.

    Click to enlarge


    Whit this information you would be able to figure out what you should have instead of the following sample lines.
  3. Now you need to run this command "sudo gedit /etc/fstab" which will open a text editor with the file where you need to enter the sample lines.
  4. /dev/sda5 /media/Documents ntfs-3g defaults 0 0
    /dev/sda1 /media/MorenoISC ntfs-3g defaults 0 0

    This line are the commands that tell ubuntu at start up to mount this drives:

    Drive is /dev/sda5 and directory is /media/Documents. The rest of the command is to tell the format of the drive and to allow read and write to files in it.



    Note: You need to install ntfs-3g to make sure your system supports NTFS

    sudo apt-get update
    sudo apt-get install ntfs-3g

    The previous lines will install NTFS-3g to support NTFS drives.

    The following line is to create the directory where you want to mount your Drives.

    sudo mkdir /media/Documents /media/MorenoISC
    sudo mount -a
    df -h


    And that is All... From now on those drives will be mounted at start up and will appear at the directory /media.....

    Good Luck!!!

No comments:

Post a Comment