Centos automatically mounts unused Disks

Source: Internet
Author: User

Tag: 1.2 command dir NID make Xid Type Space ext

[[Email protected] # fdisk-l view disk partition information

Disk/dev/SDA: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 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: 0x59e26b89

Device boot start end blocks ID system
/Dev/sda1*1 13055 104856576 83 Linux

Disk/dev/SDB: 850.4 GB, 850403524608 bytes
255 heads, 63 sectors/track, 103389 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/SDC: 12001.2 GB, 12001212366848 bytes
255 heads, 63 sectors/track, 1459064 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: 0xc346511d

Device boot start end blocks ID system
/Dev/sdc1*1 13 102400 7 HPFs/NTFS
Partition 1 does not end on cylinder boundary.
/Dev/sdc2 13 13055 104755200 7 HPFs/NTFS
Check that/dev/SDC is not mounted. Next, create a mount point (create a mount directory). I am a temporary mount and temporarily name it linshi. I first mount the available space of sdc1. then run The mkfs command-(short for make filesystem; used to create a Linux File System in a specific partition) to create a Linux File System, and then run the mount command to mount the data disk.

[[Email protected] # mkdir/linshi

[[Email protected] # mkfs. ext4/dev/sdc1

[[Email protected] ~] # Mount/dev/sdc1/linshi mounting completed
Run the DF-H command to check the usage. An additional sdc1 is found.
[[Email protected] ~] # DF-H
Filesystem size used avail use % mounted on
/Dev/sda1 99G 68g 26G 73%/
Tmpfs 63G 5.8 m 63G 1%/dev/SHM
/Dev/SDB 780G 75g 666g 11%/date
/Dev/sdc1 93 m 1.6 m 87 m 2%/linshi

2. Start the system and automatically mount the data disk

View disk UUID Information

[[Email protected] ~] # Blkid
/Dev/sda1: UUID = "e52fb0a2-a2f4-4956-8b7f-7752dcd5e037" type = "ext4"
/Dev/SDB: UUID = "e28226c1-e2ea-4ccb-b8b4-b9d437c31a21" type = "ext4"
/Dev/sdc1: UUID = "2fced1fa-1a72-40e9-b49f-89026e367160" type = "ext4"
/Dev/sdc2: UUID = "0839b341-03a5-4757-9ac7-23deb135d767" type = "ext4"
Edit a system partition table

[[Email protected] # vi/etc/fstab

Add the following information: (copy the uuid of sdc1)
UUID = 2fced1fa-1a72-40e9-b49f-89026e367160/linshi ext4 defaults 1 2

The edited information is as follows:
#

/Etc/fstabcreated by Anaconda on Mon Oct 22 18:15:59 2018

#

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

#
UUID = e52fb0a2-a2f4-4956-8b7f-7752dcd5e037/ext4 ults 1 1
UUID = 2fced1fa-1a72-40e9-b49f-89026e367160/linshi ext4 defaults 1 1
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.

Centos automatically mounts unused Disks

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.