Linux system--Disk Management commands (i)

Source: Internet
Author: User
Tags disk usage

Basic Command 1.1 View disk partition usage: DF

Parameters:

      • L: Show only local disks (default)
      • A: Displays disk usage for all file systems, including, for example,/proc/
      • H: The most appropriate unit to display the disk capacity in 1024 binary
      • H: The most suitable unit to display the disk capacity in 1000 binary, generally used for industrial computing
      • T: Shows the type of disk partition
      • T: Displays the disk partitions for the specified type of file system, for example: Df-t EXT4
      • x: Do not make a disk partition of the type file system, for example: Df-t EXT4

  

  

  

1.2 Statistics on disk File size: Du

Parameters:

      • B: Statistical files in byte units
      • K: Statistics files in kilobytes
      • M: Statistics files in megabytes
      • H: According to the 1024 binary in the most appropriate unit statistics file
      • H: According to the 1000 binary in the most appropriate unit statistics file
      • S: Specify the statistic target

  

The size of the statistics is rounded after the result, if you want to statistics detailed, you need to use H and H parameters:

  

1.3 fdisk command

Parameters:

      • L: List of partition lists
      • L
      • S
      • S
      • B: Partition size
      • B
      • C
      • C
      • H
      • H
      • U: Match with L, show number of partitions
      • O
      • T
      • V

  

The yellow part is our first partition hard drive. The following is the list of partitions for the first block.

Second, partition 2.1 rules of disk partition
    1. The total number of primary and extended partitions cannot exceed 4
    2. An extended partition can have at most one
    3. Extended partition cannot access data directly
2.2 Adding a hard disk to a VM virtual machine

Before you add a hard disk, turn off the virtual machine, except hot plug.

Click = = To edit the virtual machine settings

  

Click "=" to add a button

  

  

Select the hard drive, then click Next

  

Default, select Next

  

Select Create a new Vdisk and click Next:

  

Change the disk size, and then next:

  

Click Finish to create the success.

  

You can now open the virtual machine.

2.3Kernel Panic–not syncing:VFS:Unable to mount Root fs on Unknown-block (0,0)

Cause: There was a problem with the kernel boot entry.

Select the second item: Advanced options for Ubuntu

   

Select the third-lowest kernel to enter the system to start the system.

  

2.4 MBR partitioning in Linux

Run the fdisk-l command to view your own partition:

  

The yellow section is the partition we added.

Enter partition mode, input command: FDISK/DEV/SDB

  

Enter M to view the Help information for the command:

  

Enter N to add a new partition to the hard drive

  

P: Represents the primary partition, where the contents of the parentheses represent the partition status of the primary and extended partitions and the number of partitions that can be divided in total

E: Indicates an extended partition

Enter p to make the primary partition

Then enter the partition number, Linux 1-4 is left for the primary partition and extended partition for use, nothing is entered, the default is 1, direct return, select the default

  

Now is the beginning and ending position of the specified sector, nothing is entered, the default is the argument from the parentheses, the direct carriage return, the terminating position is the same:

  

Now specify the end location for the partition, 50GB is input, 50*1000m, so enter as follows:

  

Enter as follows:

  

Enter P to view the partitions that have been added:

  

Continue adding the partition, adding the extended partition as follows:

  

Return all, select default

  

Enter P to view:

  

  

Think partition is unreasonable, can delete partition, enter D option

  

Select the number of the partition you want to delete, select 2, and delete the extended partition:

  

To add a primary partition:

  

Write the partition scheme to disk, enter W, and enter Fdisk-l to view the disk partition

  

  

  

  

  

Linux system--Disk Management commands (i)

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.