Automatically mount partitions when Ubuntu is started.

Source: Internet
Author: User

Automatically mount partitions when Ubuntu is started.

First, check the system disk code:

Fdisk-lDisk/dev/sda: 120.0 GB, 120034123776 bytes255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectorsUnits = sector of 1*512 = 512 bytesSector size (logical/physical): 512 bytes/512 bytesI/O size (minimum/optimal): 512 bytes/512 bytesDisk identifier: 0x000214d1 device start end block number Id system/dev/sda1 * 2048 217925631 108961792 83 Linux/dev/sda2 217927678 234440703 8256513 5 extensions/dev/sda5 2 17927680 234440703 8256512 82 Linux swap/SolarisDisk/dev/sdb: 500.1 GB, 500107862016 bytes255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectorsUnits = sector of 1*512 = 512 bytesSector size (logical/physical): 512 bytes/4096 bytesI/O size (minimum/optimal): 4096 bytes/4096 bytesDisk identifier: 0xec689ddc device start end block number Id system/dev/sdb1 2052 471040703 235519326 7 HPFS/NTFS/exFAT Partition 1 does not start with the physical sector boundary. /Dev/sdb2 471040704 976770467 252864882 7 HPFS/NTFS/exFATDisk/dev/sdc: 8178 MB, 8178892800 bytes92 heads, 57 sectors/track, 3046 cylinders, total 15974400 sectorsUnits = sector of 1*512 = 512 bytesSector size (logical/physical): 512 bytes/512 bytesI/O size (minimum/optimal): 512 bytes/512 bytesDisk identifier: 0x16c0ca45 device start end block number Id system/dev/sdc1 * 1552 15974399 7986424 B W95 FAT32
Note: the root directory/must be mounted before other directories.

Other mount points must be created directories.

Run the following command to view the UUID of another disk:

sudo  blkid
The result is as follows:

/dev/sda1: UUID="70fb376c-17c2-4ce1-a263-727f647949cf" TYPE="ext4" /dev/sda5: UUID="0c5f073a-ad3f-414f-85c2-4af83f6a437f" TYPE="swap" /dev/sdb1: UUID="11263962-9715-473f-9421-0b604e895aaa" TYPE="ext4" /dev/sdb2: UUID="88928fea-5dd3-47b1-9931-bb107d74371e" TYPE="ext4"
Next, modify the automatically mounted configuration file:

sudo vim /etc/fstab
Modify as follows:

UUID=70fb376c-17c2-4ce1-a263-727f647949cf /               ext4    errors=remount-ro 0       1# swap was on /dev/sda5 during installationUUID=0c5f073a-ad3f-414f-85c2-4af83f6a437f none            swap    sw              0       0UUID=11263962-9715-473f-9421-0b604e895aaa /data               ext4    defaults 0       1UUID=88928fea-5dd3-47b1-9931-bb107d74371e /export               ext4    defaults 0       1
The last two actions are newly added mount points.
Note: Do not set the Mount directory to/. If it overwrites the original root directory, the system will crash.




Automatic partitioning in ubuntu

Drapper and Edgy are old ubuntu version codes.
Have you written the source list incorrectly?

What is the relationship between automatic mounting of ntfs and sources. list? Mount the configuration file/etc/fstab.

How does one automatically mount hard disk partitions on ubuntu?

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.