This will be nice that all your local Hard drives are mounted automatically during the boot. This can be achieved by modifying "fstab" (File System TABle) file. This file is located on /etc/ which would need superuser permissions(root user password) to modify.
How we can alter fstab and set system to mount partitions by itself is explained below..
- First Open a terminal and type blkid and press
this will show your local Hard disks with their UUIDs( Universal Unique IDentification). This may look like this
here 1st column with /dev entries are the links of partitions(in the format /device/
2nd column : LABEL describes the Name or Label of partitions. Not all partitions necessarily needs a Label.
3rd column starting with UUID is the entry shows the UUIDs of the Partition
4th column shows the File system used in the partitions
- So Now we know some important informations about our partitions like their File system type and UUIDs. In linux to use a filesystem, we need to mount it in somewhere in the root directory. This is because of the Hierarchy nature of Linux .
Usual location of mounted file systems are on /mount/ or /mnt/. I take /mount/ as my default Mount location. Create a new folder with a name(Without any space between words, ex: New_Partition) simillar to Partiton Label or No
To create folders in /mount/ , we need root permissions.
Open a terminal and type su and press . It will ask for root password. type in root password and press enter.
Then type mkdir -v /media/
ex.: If you want to create New_Drive in /media/ then type mkdir -v /media/New_Drive
You can also create multiple folders in one step
ex. You want to create Drive1, Drive2 , Drive3 then you need to type as
mkdir -v /media/Drive1 /media/Drive2 /media/Drive3
You may get as this
Now we created mount points needed to mount the filesystems
- Now we need to modify fstab file .
Default location of fstab is /etc/fstab
On terminal ( where we typed commands to create folders in /media)
Before we start editing fstab file, lets make a backup copy of it
Type on terminal cp -v /etc/fstab /etc/fstab.backup and press . You should see as below.
type sudo gedit & and press
This will open text editor. Click on Open and point it to /etc/fstab
It will Open fstab file. This may look like this
Any entry starting with #, will not taken into account. So you can use # for commenting
Basic structure of fstab file is
File System Address --> Its is the Identifier for the file system. You can use either Links (ex.: /dev/sda2) or Labels (ex.: LABEL="DRIVE1") or UUIDs (ex.: UUID="74c9c3d9-a374-406d-ba41-e030c7d35f5d")
Mount Point --> This is folder on which the file system mounts. (Refer Step 2) (ex.: /media/Drive2)
File System Type --> specify the file system (ex ext3, ntfs, fat)
Options --> Contains more complicated options
For normal user, its good to set Defaults as Options
Dump --> set whether to Backup or not. (ex. 0, 1)
Pass --> set whether to check filesystem before mounting
example of a edited fstab file is
After finishing with fstab save it. You may get errors if you don't have permissions to alter fstab. In that case, Open a terminal and type su and press and provide Password for root account. and
Then type gedit &.
- After saving the file , restart the system, if everything go just good as expected the computer boots up with local partitions mounted on specified locations
If you got any doubts , please contact me