Solve the problem of insufficient linux disk space
Source: Internet
Author: User
Solve the problem of insufficient disk space in linux 1. First, let linux be powered off; 2. right-click your virtual machine name and select settings; 3. select add on the displayed page. the following box is displayed. 4. select HadrHisk (add hard disk). 5. choose next, solve the problem of insufficient linux disk space
1. First, let linux be powered off. 2. right-click your virtual machine name and select Settings;
3. select "add" on the displayed page. the following box appears.
4. select Hadr Hisk (add hard disk)
5. continue to select the next step. the following page appears.
Select the size of the disk you want to add and add it as needed;
6. finally start linux
The procedure is as follows:
Fdisk/dev/sdb Enter fdisk mode
Command (m for help): p // view the partition of the new hard disk
Command (m for help): n // Create a new partition
Description of related parameters:
Run the m command to check the internal command of the fdisk command. run the n command to create a new partition. run the d command to delete an existing partition. run the p command to display the partition list. run the t command to modify the partition id; l command to display the list of partition ID numbers; command a to specify to start the partition; command w will take effect for the modification of the partition table (that is, save)
Enter e to create an extended partition.
Input p to create a primary partition. a maximum of four primary partitions are allowed.
Here we choose to create the primary partition: all input "p", and the following content is displayed on the page:
Partionnumber (1-4): 1 // The first extended partition
First cylinder (1-1014, default 1): 1 // Number of starting disks in the first primary partition
Last cylindet or + sizeM or + sizek: + 1024 MB // it can be the number of disk blocks in MB. Here we select the input + 1024 MB to indicate that the partition size is 1 GB.
Finally, enter "w" to save the operation and exit the fdisk mode.
In this way, a partition is created.
If you need to create a partition, repeat the preceding steps.
After the partition is created, we need to format the partition.
Mkfs-t ext3-c/dev/sdb1 // If multiple partitions exist, replace sdb1 with sdb2, and so on.
After formatting the partition, we need to mount it.
Mkdir/www // Create a Mount Directory (which can be modified as needed)
Mount/dev/sdb1/www // Mount the partition to the directory just created
Df-h // view the mounted partition
This type of mounting will expire after restart. all the files we modify will be automatically mounted upon startup.
Vi/etc/fstab
Add the following content at the end of the file:
/Dev/sdb1/www ext3 defaults 1 2
If multiple partitions exist, you can modify sdb1 and/www, save the changes (wq), and restart the server (reboot)
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.