How to automount partitions at boot using the fstab file in Linux.

It can be annoying manually mounting partitions, so the easiest solution is to edit as root the /etc/fstab file. Getting started open a terminal and type blkid you will see output like this,

/dev/sda1: LABEL=”COMPAQ” UUID=”90CED570CED54EDA” TYPE=”ntfs”
/dev/sda5: UUID=”5dc14104-63d7-45ff-a430-ffa422c7a551″ TYPE=”swap”
/dev/sda6: UUID=”ffab264a-31eb-4ae4-8512-6daaf016ca06″ TYPE=”ext4″
/dev/sda2: UUID=”90875efb-2435-400b-b0ad-4d99618798e9″ TYPE=”ext4″
/dev/sda7: UUID=”4312ab7b-8fa0-4b15-9310-70bc53a75acd” TYPE=”ext4″
/dev/sdb1: LABEL=”Elements” UUID=”607AAD5D7AAD30A8″ TYPE=”ntfs”

In the example we will mount the external drive automatically (/dev/sdb1). Edit /etc/fstab as root and using the output above add a line like this

UUID=607AAD5D7AAD30A8 /mnt/Elements ntfs defaults 0 0

Save and exit. Befiore we can say job done we have to create the directory /mnt/Elements , which can be done in terminal with mkdir /mnt/Elements. Once that’s done run mount -a , if you get no error than everything is correct , however if you get any errors , you will have to correct them before it will work. Also you will to run those command as root or with sudo.

Advertisements
Tagged with:
Posted in 01Ben, Linux

Please feel free to leave a reply.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 68 other followers

%d bloggers like this: