Solve the problem of insufficient hard disk space in Linux

Source: Internet
Author: User
First, the df-k command finds that the Use % in the physical volume Group No. 0 (there is only one physical volume group in the system) has reached 100%, and its Mount point is the root directory. So

First, the df-k command finds that the Use % in the physical volume Group No. 0 (there is only one physical volume group in the system) has reached 100%, and its Mount point is the root directory. Then we need to check the space allocation in the root directory. we already know which file has eaten the space.

7.9 M/bin
7.1 M/boot
96 K/dev
115 M/etc
6.2 GB/home
138 M/lib
29 M/lib64
389 M/linux-yum
16 K/lost + found
8.0 K/media
0/misc
8.0 K/mnt
0/net
1.2 M/opt
4.7 GB/oracle
0/proc
115 M/root
40 M/sbin
8.0 K/selinux
8.0 K/srv
0/sys
100 K/tftpboot
306 M/tmp
12 K/u01
3.0 Gb/usr
109 M/var

We found that the home directory, usr directory, and oracle directory occupied a large amount of space. It is found that there is an oracle directory under the home directory, because another Oracle 10g was installed a few days ago. Currently, oracle 11g and oracle 10g are the same in the system. Insufficient space is inevitable. Only the resizing method can be used.

First, add a 16 GB disk file to the VM and use the dynamic allocation method. Then start the operation.

1. change the permission to root.

2. the fdisk-l Command found that an unpartitioned disk was added.

3. run the pvscan command to view the current physical volume information of the system.

4. View logical volumes using the vgscan command and lvscan command

5. run the fdisk/dev/sdb command to format the new disk.

Use one partition to separate/dev/sdb1 partitions.

6. run the pvcreate/dev/sdb1 command to convert the partition into a physical volume.

7. the vgextend VolGroup00/dev/sdb1 command extends the physical volume group VolGroup00, which is equivalent to adding the partition sdb1 to the physical volume Group 0.

8. the lvextend-L + 15.8G/dev/VolGroup00/LogVol00 command expands the logical volume LogVol00 and the capacity is increased by 15.8G,

9. the resize2fs/dev/VolGroup00/LogVol00 command takes effect immediately.

10. after the df-l command observes the disk space, it is found that there is 50% available space to solve the disk space problem!

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.