How to append disk space under Linux

Source: Internet
Author: User

Scenario 1: If the current disk has capacity to expand

Under Root, the "fdisk-l" Maximum partition is/dev/sda3, and the newly created latest partition is/DEV/SDA4

Enter "FDISK/DEV/SDA"

"N" adds a new partition

"P" creates a primary partition

"Enter" selects the default size (also full size) so that no space is wasted

"Enter", select the default start cylinder.

"W" remains modified

"Reboot" Restart Linux, you must restart Linux, otherwise/dev/sda4 will not be able to format the/dev/directory, you can see the new partition SDA4

The MKFS.EXT4/DEV/SDA4 is formatted

"Mount/dev/sda4/opt" mount the partition to/opt

"Vi/etc/fstab" last line joins/dev/sda4/opt ext4 defaults 0 0

Save, realize boot automatically mount. At this point, the new increase in disk space capacity, can be reflected on the/opt, and reboot automatically mount the partition, additional disk space to work.

Scenario 2: If the current disk is not wide, you can use the method of increasing the disk, in the VMware main interface, select the "VMware" drop-down menu, select "Settings", with "add" method to add a disk.

In the virtual machine settings, a new disk, my virtual machine's disk is the IDE type, so the new disk is also the IDE, the capacity of 5G. (Open VMware, select the edit Virtual mache settings,utilities drop-down box to locate expand.) )

Under the root user, the "fdisk-l" Maximum partition is/dev/sda3, and the newly created latest partition is/DEV/SDB1.

Enter "Fdisk/dev/sdb"

"N" adds a new partition

"P" creates a primary partition

"Enter" selects the default size (also full size) so that no space is wasted

"Enter", select the default start cylinder.

"W" remains modified

"Reboot" Restart Linux, you must restart Linux, otherwise/DEV/SDB1 will not be able to format the/dev/directory, you can see the new partition SDB1

"MKFS.EXT4/DEV/SDB1" to format "mount/dev/sdb1/opt" to mount the partition to/opt

The last line of "Vi/etc/fstab" is added/dev/sdb1/opt ext4 defaults 0 0 save, realize boot auto mount.

At this point, the new increase in disk space capacity, can be reflected on the/opt, and reboot automatically mount the partition, additional disk space to work.

How to append disk space under Linux

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.