UbuntuLinux system configuration/etc/fstab enables automatic mounting of hard disk partitions upon startup

Source: Internet
Author: User
Basically, all Linux distributions Mount partitions when starting the system according to the/etc/fstab file configuration. In/etc/fstab, the Mount parameters are also different for partitions in different formats, and the results are different for different parameters, including the user's read and write permissions. 1. for fat32 format partitions, add the following content to/etc/fstab:/d

Basically, all Linux distributions Mount partitions when starting the system according to the/etc/fstab file configuration. In/etc/fstab, the Mount parameters are also different for partitions in different formats, and the results are different for different parameters, including the user's read and write permissions.

1. for fat32 format partitions, add the following content to/etc/fstab:

/Dev/sdaX/media/Y vfat user, rw, utf8, umask = 000 0 0

Note: the/dev/sdaX command fdisk-l can be used as an administrator to find the partition you want to mount. /Media/Y This is a folder and should be created in advance ." User, rw "indicates that users can perform read and write operations. Utf8 is necessary because some windows folders are often named in Chinese, while GBK encoding is used in windows. garbled characters are displayed when the folders are mounted in linux, the utf8 parameter is used to automatically convert Chinese characters to UTF8 display, which can effectively avoid garbled characters. Umask = 000 indicates that all users are granted read/write operations, that is, after mounting, common users can also perform operations. At last, two zeros are separated by spaces. the latter of the two zeros determines whether to check the power-on. If yes, change it to 1.

2. for Linux partition formats such as EXT3 and EXT4, you can add the following content to/etc/fstab:

/Dev/sdaX/media/Y ext3 defaults 0 1

/Dev/sdaX/media/Y ext4 defaults 0 1

/Dev/sdaX/media/Y jfs defaults 0 1

The above lines correspond to the mounting statements of ext3, ext4, and jfs respectively. modify the statements based on your own partition conditions. In these statements, the meaning of X and Y is the same as that of Y. The default parameter is mounted in the default format, and the following 0 and 1 indicate that the system should be checked upon startup.

3, NTFS format partition, more trouble, first install NTFS-3G this software, if you do not install this software will not be able to read and write NTFS format partition. After installation, add the following content to/etc/fstab:

/Dev/sdaX/media/Y NTFS-3G defaults 0 0

Here the meaning of X and Y is the same as above, it is worth noting that the parameters after the NTFS-3G are as follows:

Users? If SUIDroot is set in the NTFS-3G executable file(Command:NTFS-3G/chmod u + s/bin/)Allows anyone to mount/detach an NTFS partition. Note:UsersInsteadUser

Uid? Specifies the owner of files and directories in the NTFS partition (expressed in decimal number)

Gid? User group that specifies the files and directories in the NTFS partition (expressed in decimal number)

Fmask? File permission (octal mask)

Dmask? Directory permission (octal mask)

Locale? Used to make files using international character sets visible. It is no longer needed in ntfs-3g2009.1.1 and update versions.

Noauto? Do not automatically mount partitions at startup

Related Article

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.