Disk partitioning, formatting and mounting under Linux

Source: Internet
Author: User
Tags oracle vm virtualbox vm virtualbox

One, add disk

First we add a disk I'm running on an Oracle VM VirtualBox virtual machine and choose to add a new disk when the system shuts down


After adding the disk boot system, we first switch to the root user and the next operation requires root permission to operate.

Input fdisk-l found a new disk with a/dev/sdb of 8G, which I just added.



Second, disk partitioning

Next we partition it, first enter FDISK/DEV/SDB this is equivalent to a boot command in this interface, the user can create partitions,

Operations such as activating partitions, deleting partitions, and viewing partition information. Enter N to create a new partition.



then you can select the partition type, I select P, which is the primary partition. Then the partition number is entered as one of the first primary partitions after the

Select the starting sector of the disk default to 1, directly enter. Then the W write can be partitioned for completion. You need to repeat the above steps more

Re-enter Fdisk-l view


Third, the format of

After partitioning the disk can not be used directly, but also need to format the input mkfs.ext4/dev/sdb1 that is SDB1

Format it and format it as a EXT4 format.



Third, Mount

Next we mount the disk, where I create a new directory mkdir zijian1, mount the disk on that directory

After Mount/dev/sdb1/zijian1, you can enter df-h to view the mount. Use the Umount command to uninstall.



We can use VIM to edit the configuration file so that it can be mounted automatically on each boot.

Vim/etc/fstab Create a new disk with the relevant configuration.








Disk partitioning, formatting and mounting under Linux

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.