Ubuntu automatically mounts other hard disk partitions manually

Source: Internet
Author: User

After the installation of Ubuntu, if the computer has other partitions, you need to use the mouse to mount each time, a bit inconvenient. This article describes in detail how to mount automatically.

Overview

There are two ways to mount the Ubuntu system:
One is Pre-user mode, but it is a bit late to mount the partition and must be logged in. If you install the database to that partition, you will get an error.
Another way is the way the system is mounted, which is convenient to mount the system early in the boot phase, that is, the legendary fstab file configuration mode.
This article focuses on the second approach. The second way is the essence of editing fstab files, before this need to prepare the device name, type, uuid three east. Here are the detailed methods:

View the name and type of the system's partition.

sudo fdisk-l
This command is mainly to remember the results of/DEV/SDB1 such a device and the last column type:ntfs such things, the following will be used.

Get the type of hook that corresponds to the following relationship:
W95 FAT32, W95 FAT16, VFAT
NTFS-ntfs-3g
APPLE-HFS-Hfsplus

Querying the device's UUID

sudo ls-l/dev/disk/by-uuid/

lrwxrwxrwx 1 root root 10 March 08:12 08de9dd3de9dba00. /.. /sdc1
lrwxrwxrwx 1 root root 10 March 08:53 2cf4ed0ef4ecdb5a. /.. /sdb1
lrwxrwxrwx 1 root root 10 March 08:12 5042112042110c7a. /.. /sdb5

Edit Fstab File

sudo vi/etc/fstab

Let's talk about the meaning of several fields in this file.

    • File system
      This usually writes/DEV/SDB7 and so on, but if the system device plug-in sequence is not the same, the device name will change, uncomfortable. So with the way the device is uniquely identified, UUID, step 2 above is the way to get a unique identity.
    • Mount point
      Is the directory you mounted, usually/media/jason/disk1 ....

    • Type
      Is the first step above to get the type, I here is ntfs-3g, if you use this option you have to install the NTFS-3G package first. sudo apt-get install ntfs-3g

    • Options
      Specify options for the file system, separated by commas.

After editing, you'll look like this:
Program
Uuid=5042112042110c7a/media/jason/program ntfs-3g Nls=utf8 0 1

Personal
Uuid=6aaa07c9aa0790ad/media/jason/personal ntfs-3g Nls=utf8 0 1

Work
Uuid=be96285c96281803/media/jason/work ntfs-39 Nls=utf8 0 1

Ubuntu manually mount other hard disk partitions automatically

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.