Source Digit

Latest Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Android
  • Blogging
  • Windows
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology

Customize Ubuntu 14.04: How to Mount Hard Disk Partitions/Drives Automatically at System Startup

By Sourabh / April 20, 2014 Category: How To, Ubuntu

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.

 

Disk-Mounting-01

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.

 

Disk-Mounting

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:

Screenshot 001-Name Disk Number

After:

Disk1 Screenshot

 

Cover Image: DesktopWallpaper 4

 

Tags: Customize Ubuntu, Linux, Ubuntu 14.04, Ubuntu Tricks

Source Digit

Latest Posts

Install Android File Transfer MTP client for Linux Ubuntu

Wine 2.0.4 Released – How To Install Wine On Ubuntu

Darktable 2.4.0 Released – How To Install Darktable In Ubuntu

Sayonara Music Player 1.0 – Install Sayonara Audio Player for Linux Ubuntu

LibreOffice 5.4.4 Available For Download – Install LibreOffice On Linux

Tilix 1.7.3 Terminal Emulator – Install Terminix On Ubuntu

Install Avidemux Video Editor 2.7 on Ubuntu Linux

Kdenlive 17.12.0 Released – Install Kdenlive Video Editor On Linux Ubuntu

GIMP 2.9.8 Released – Install GIMP Image Editor on Linux Ubuntu

MPV Player 0.28 Released – Install MPV Video Player on Linux Ubuntu

© 2018 Source Digit • Latest Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap