I have a linux server with a small /dev/root or rootfs partition.

It is getting full every time.

I have to remove log files from /var/log to avoid problems.

df -h:
Filesystem              Size  Used Avail Use% Mounted on
rootfs                   20G   18G  416M  98% /
/dev/root                20G   18G  416M  98% /
devtmpfs                 16G     0   16G   0% /dev
tmpfs                   3.2G  340K  3.2G   1% /run
tmpfs                   5.0M     0  5.0M   0% /run/lock
tmpfs                   6.5G     0  6.5G   0% /dev/shm
/dev/mapper/home  886G  224G  626G  27% /home
/dev/mapper/mail  197G   18G  170G  10% /srv/mail
/dev/mapper/web   197G  118M  187G   1% /srv/web

Rootfs have 18 GB used but something is strange: when I count the content of the folders together i come to 5.5 gb.

du -hsx * | sort -rh:
224G    home
1.6G    usr
1.2G    var
1.1G    opt
638M    lib
361M    etc
351M    root
221M    tmp
and some smaller folders.

I found out that I easly can increase the folder size of /dev/mapper with the code lvresize --size +100M /dev/mapper/home but when I try this on mij rootfs folder it says:

Path required for Logical Volume "root" Please provide a volume group name

How can I safely increase the root folder without server crash and without reinstalling?

Here my vgdisplay result:

--- Volume group ---
VG Name               julia
System ID
Format                lvm2
Metadata Areas        1
Metadata Sequence No  33
VG Access             read/write
VG Status             resizable
MAX LV                0
Cur LV                3
Open LV               3
Max PV                0
Cur PV                1
Act PV                1
VG Size               1.80 TiB
PE Size               4.00 MiB
Total PE              471802
Alloc PE / Size       332800 / 1.27 TiB
Free  PE / Size       139002 / 542.98 GiB
VG UUID               N1WUXu-foN3-j4kE-SzRf-mdea-cAlj-NmsZ5P
  • You probably have open log files. They won't be deleted from disk until the daemon closes them. – ali1234 Oct 16 '16 at 20:30

Free space not appearing after removing files

This is most likely because the log files remain opened, even when deleted. If you restart the services writing to the log files after removing them, the correct free space should show.

This also explains why it shows the correct space after a reboot.

To increase your root partition size

This is a two-step process, and I'd outline it here but many guides have already been written such as this one or this one.

You also need to be sure that you actually have free space directly after the root partition, so you don't overwrite other partitions!

As always, make sure you create a backup of your data before doing this!

  • rootfs is a type of ramdisk. disk partition resizing is completely irrelevant to the question. – ali1234 Oct 16 '16 at 20:27

Yesterday the server was getting full again and i had to remove files to make space. The problem was, there were no files left to delete.

I recalculated the space used for every folder in the root and together it is 5gb.

df -h said that 99% 19gb was used.

I restarted the server and tried df -h again. Problem solved: it now echo's that only 5gb is used.

However, I would be interested to find out how this happend.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.