Let us learn how to automatically mount hard disk partitions/dives at system startup. By default, if you have dual-boot PC (Linux Ubuntu and Windows installed on same PC), your hard drive partitions are not automatically mounted when you start your system.
This also creates a problem in Ubuntu, if you are using dual-boot PC. Like windows, Ubuntu doesn’t assign disk drive letters (c:/, d:/ and so on) to each drives and Ubuntu assigns “Disk”, “Disk1”, “Disk2”. This name is assigned by the order of the first-mounted-device. Which means, if names are assigned in order at which they are mounted, the drive which gets mounted first – Disk and second – Disk1 and so on.
This is a problem. For example, if hard drive partition (say 100GB – Files and Folders) is mounted first it is assigned “Disk” during one session and “Disk1” in another session (in another session 100GB partition is mounted second). This change causes problem, you cannot access your files and folders normally.
The only way to fix this issue is to mount drive partitions at system startup. Here is how to do this:
Step 1: List Drive Partitions
Type the following command in the Terminal to list all drive partitions on your system:
sudo fdisk -l
you may be asked the password of the system to continue.

Now you can see your system’s hard disk partitions. Linux uses /dev/sda1, /dev/sda2, /dev/sda3 and so on to name each disk partitions. Locate the disk partition which you want to mount automatically on system startup.
- In my case, i have automatically mounted /dev/sda2 and /dev/sda3 diske partitions and assigned the name disk1 and disk2 respectively.
Step 2: Create Mounting Folders
Now you have to create mounting folders for each of the disk partitions separately.
Type the following command in Terminal to create mount folders:
sudo mkdir /media/disk1
sudo mkdir /media/disk2
I have created two different mounting folders – /media/disk1 and /media/disk2 for disk partition /dev/sda2 and /dev/sda3. The name of the disk will vary as per your disk partitions. Please select the appropriate disk name.

Step 3: Edit Mount Folders
This is the most important step and should be done cautiously. This step tells Ubuntu what hard drives partitions have to be mounted automatically at system startup.
To edit mount table, type the following command:
gksudo gedit /etc/fstab
Fstab is a configuration file that contains all the necessary details for each drive partitions and files which need to be mounted. In other words we can say that /etc/fstab configuration file contains the automate-mounting information.
Type the following line-command at the end of the /etc/fstab configuration file and save the file:
/dev/sda2 /media/disk1 ntfs defaults 0 0
/dev/sda2 /media/disk2 ntfs defaults 0 0
Please remember to save the /etc/fstab file and close it. /etc/fstab configuration file contains the following information:
- Name of the drive: /dev/sda2
- Location of mount: /media/disk1
- Format file: ntfs
- Options: defaults
- Dump: 0
- Pass: 0
Step 4
Mount drive without system restart
sudo mount -a
Now you can see the names of the disk partitions/drives. Please see the screenshot to have a better understanding.
Before:
After:
Cover Image: DesktopWallpaper 4

