CentOS 6.5 automatically mounts the hard disk upon startup

Source: Internet
Author: User

CentOS 6.5 automatically mounts the hard disk upon startup

The construction of enterprise-level application systems usually stores systems and data separately, and creates raid. The newly installed CentOS 6.5 requires mounting a data disk, and the system can start to automatically mount the data disk.

1. Manually mount the disk

View the disk partition information and run the fdisk command.

[Root@www.bkjia.com] # fdisk-l

Disk/dev/sdb: 1476.5 GB, 1476529225728 bytes
255 heads, 63 sectors/track, 179511 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x0008a3a1

Device Boot Start End Blocks Id System
/Dev/sdb1 1 179512 1441922048 83 Linux

Disk/dev/sda: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x6a5b51c5

Device Boot Start End Blocks Id System
/Dev/sda1*1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/Dev/sda2 64 39163 314059776 8e Linux LVM

Disk/dev/mapper/vg_tsprlswebserv-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000


Disk/dev/mapper/vg_tsprlswebserv-lv_swap: 16.8 GB, 16814964736 bytes
255 heads, 63 sectors/track, 2044 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000


Disk/dev/mapper/vg_tsprlswebserv-lv_home: 251.1 GB, 251092008960 bytes
255 heads, 63 sectors/track, 30526 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000

Check that/dev/sdb1 is not mounted. Next, create a mount point (create a mount directory) and run the mount command to mount the data disk.

A [root@www.bkjia.com] # mkdir/tsp

[Root @ tsp-rls-webservice tsp] # mount/dev/sdb1/tsp

2. Start the system and automatically mount the data disk

View disk UUID Information

A [root@www.bkjia.com] # blkid
/Dev/mapper/vg_tsprlswebserv-lv_root: UUID = "3dedb8a7-69c5-44d7-b590-e70a0b1b3c9a" TYPE = "ext4"
/Dev/sdb1: UUID = "e85dd659-bb20-4d12-a8bc-16130efc04ea" TYPE = "ext4"
/Dev/sda1: UUID = "97f12da1-c972-4408-9028-9b98cde34a34" TYPE = "ext4"
/Dev/sda2: UUID = "cKJ1xc-8mci-0d89-DNaR-5IAG-2JOv-V1G1q9" TYPE = "LVM2_member"
/Dev/mapper/vg_tsprlswebserv-lv_swap: UUID = "aa4589df-1d47-4060-a419-9c4432c3bb9a" TYPE = "swap"
/Dev/mapper/vg_tsprlswebserv-lv_home: UUID = "17a62039-4676-45ce-8eb9-1914e2d4820c" TYPE = "ext4"

Edit a system partition table

Root@www.bkjia.com # vi/etc/fstab

Add the following information:

UUID = e85dd659-bb20-4d12-a8bc-16130efc04ea/tsp ext4 ults 1 2

The edited information is as follows:

#
#/Etc/fstab
# Created by anaconda on Thu Aug 21 17:17:19 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab (5), findfs (8), mount (8) and/or blkid (8) for more info
#
/Dev/mapper/vg_tsprlswebserv-lv_root/ext4 ults 1 1
UUID = 97f12da1-c972-4268-9028-9b98cde34a34/boot ext4 ults 1 2
UUID = e85dd659-bb20-4d12-a8bc-16130efc04ea/tsp ext4 ults 1 2
/Dev/mapper/vg_tsprlswebserv-lv_home/home ext4 defaults 1 2
/Dev/mapper/vg_tsprlswebserv-lv_swap swap defaults 0 0
Tmpfs/dev/shm tmpfs defaults 0 0
Devpts/dev/pts devpts gid = 5, mode = 620 0 0
Sysfs/sys sysfs defaults 0 0
Proc/proc defaults 0 0

Save and exit. restart the system and confirm that the automatic mounting is successful.

Install CentOS7.0 on a vmwarevm

64-bit CentOS 6.5 Installation Method

64-bit CentOS 6.4 dual-system installation in Win7

Precautions for installing CentOS and Windows systems

Install Windows 8 and CentOS on UEFI + GPT

Windows 8.1 and CentOS6.5 dual-system installation

Basic Optimization after CentOS 5.6 Linux is installed

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.