Linux Virtual machine Disk partitioning

Source: Internet
Author: User

    • How to add a piece of hard disk
    1. Virtual machine plug-in drive
    2. Partition
    3. Formatting
    4. Mount

One, upstairs, violent. command to view device mounts, with SDA partitioned, and SDB unpartitioned 2 disks

Lsblk–f Viewing device Mounts

Virtual machine add hard drive steps

In the Virtual Machine menu, select Settings, then add the hard disk in the device list, and then go all the way "next", in the middle only select the size of the disk where you need to modify, until finished. Then reboot the system.

2. Partition Command Fdisk/dev/sdb

Play m to see the Help document

I accidentally knocked out of the coma.

Re-enter the partition,

After starting the partition, enter n, add the partition, and then select P, the partition type is primary partition. Two times enter the default all remaining space. The last input W writes the partition and exits without saving exit input Q.

Hand cheap 4, wood has relations, after the configuration is right

3. Format the disk

Mkfs-t EXT4/DEV/SDB4

EXT4 is a partition type

This is the disk, which is the ID uuid.

4. Mount: Associate a partition with a directory,

Mount Device name Mount directory

Example: Mount/dev/sdb1/newdisk

Umount device name or mount directory

For example: UMOUNT/DEV/SDB1 or Umount/newdisk

It will expire after the load is mounted on the command line.

    • Permanent Mount
      • Implementing mounts by modifying/etc/fstab
      • after adding is complete Executive Mount–a Immediate effect

Enter file Vim/etc/fstab , add a line of disk area information, the white line content in the picture

Execute Mount–a, you can see that the TMP file is already mounted,

Df–h Query system Overall disk usage, distinguish –h command h humen

Disk partition complete O (∩_∩) o~

Linux Virtual machine Disk partitioning

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.