Hard Disk approximate full How can I do now

General support questions
Post Reply
xuancong6000
Posts: 4
Joined: 2012/11/25 19:29:46
Contact:

Hard Disk approximate full How can I do now

Post by xuancong6000 » 2014/04/17 08:29:36

I have a problem with disk space:

[root@servervn ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_server-lv_root 5.0G 4.1G 626M 87% /
tmpfs 1.5G 0 1.5G 0% /dev/shm
/dev/sda1 485M 95M 366M 21% /boot
/dev/mapper/vg_server-lv_home 140G 301M 132G 1% /home

Image

one disk is used 4.1G it only 5GB, now it have 626MB of free I had contact with my provider but they ask me upgrade HDD :( while I have 132GB Free Space in another disk I'm bad on this I don't know how to resolve on this situation can you for me solutions to resolve that thanks you so much

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Hard Disk approximate full How can I do now

Post by TrevorH » 2014/04/17 11:12:19

You certainly do not need a bigger disk, you just need to rebalance what you have now. To do this you will need to login as root and make sure that no-one is using the /home mount point by running `fuser -m /home`. That command prints out the process IDs of anything using /home and you will need to stop those or kill them to be able to continue. Once no-one is using /home and you can `umount /home` then run the following example:

Code: Select all

fsck -f /dev/mapper/vg_server-lv_home
lvresize -L64G --resizefs /dev/mapper/vg_server-lv_home 
mount /home
lvextend -L+11G /dev/mapper/vg_server-lv_root
resize2fs /dev/mapper/vg_server-lv_root
That lot does the following: checks the filesystem on /home, resizes the logical volume containing the /home filesystem to 64GB and shrinks the filesystem prior to that. That will make your /home 64GB in size and put the remaining 66GB back into the volume group as free space. Then it adds 11GB to the logical volume containing the / filesystem and resizes that too.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

xuancong6000
Posts: 4
Joined: 2012/11/25 19:29:46
Contact:

Re: Hard Disk approximate full How can I do now

Post by xuancong6000 » 2014/04/17 14:00:20

I had done: "umount /home" when I do this command again: "fuser -m /home" alot id appear
Image
so I can't do this: "fsck -f /dev/mapper/vg_server-lv_home"

[root@servervn ~]# fsck -f /dev/mapper/vg_server-lv_home
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
/dev/mapper/vg_server-lv_home is in use.
e2fsck: Cannot continue, aborting.
[root@servervn ~]#

Please tell me how can I close all process IDs on /home to fsck I use centos 6 64bit i I had installed Directadmin Control

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Hard Disk approximate full How can I do now

Post by TrevorH » 2014/04/17 19:50:23

Start by stopping everything you can except sshd if you are connecting via ssh. You will need to connect as root and not as your own userid.

If you have a local console then you can reboot and come up in single user mode by hitting Esc when you see the "Booting CentOS 2.6.32-x in X seconds" prompt, hit 'e' to edit the current selection then use the arrow key to highlight the kernel line and hit 'e' to edit that, scroll to the end and append the word 'single' to it (no quotes) then hit enter and then hit 'b' to boot.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply