Linux system Add new hard disk, and partition settings start auto mount, graphics Tutorial!

Source: Internet
Author: User

The steps to add a hard drive to a virtual machine are a little more nonsense, mainly listing a few detailed steps to set up after adding a hard drive:

1. View disk information : Fdisk-ls

Before adding as shown:

After adding as:

can also be used: ls/dev/sd* view, such as:

2. Disk partitioning :

After disk recognition is successful, partition with the Gdisk command: GDISK/DEV/SDB

After executing, enter the interactive command line of Gdisk, enter p, and then you can see the hard disk details, as shown in:

If you create multiple partitions, use the Create PARTITION command n, enter a carriage return, select the partition number (default starting from 1), enter 1, return

I only set a default partition 100G here, if you need to set two partitions, in "Last Sector (2048-419430366, default = 419430366) or {+-}SIZE{KMGTP}:" After you want to enter the size of the first partition, such as: +50g, and then divide the remaining partitions.

3. Format the disk partition : Mkfs.xfs/dev/sdb or mkfs-t xfs/dev/sdb, such as:

If multiple partitions are formatted using the command above

4. Mount the disk partition :

Create a folder in the root directory data, such as:

Mount to the Data directory: Mount/dev/sdb/data, view mount information: Df-h, such as:

5. Set power on auto Mount , open auto mount file: Vi/etc/fstab, add line as shown:

Save exit, reboot the host to see if it is automatically mounted: DF-LH

Linux system Add new hard disk, and partition settings start auto mount, graphics Tutorial!

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.