Ask Your Question

Can I delete /var/log ? Root full

asked 2017-03-01 02:15:57 -0500

Orriginal gravatar image

While doing a " Dnf update" on Fedrora 25, it failed with reported errors of not enough disk space on "root" My/root is 10gb in size and so i was a little surprised. After looking through this wonderful website, it turns out that my /var/log file is nearly 800mb in size and would solve the problem if I can delete it So..Can I delete /var/log file ?

ALSO, I have 10Gb free on the Hard Disk as unused space ( non formatted) Can I add that to "root" to try and avoid this problem again ?

Many thanks in advance

edit retag flag offensive close merge delete


Also take a look at the cache of PackageKit (/var/cache/PackageKit). That can easily go > 1GB.

florian gravatar imageflorian ( 2017-03-01 07:43:59 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2017-03-01 06:30:19 -0500

fcomida gravatar image

Use vgdisplay for getting Volume Group name, i.e. fedora. lvdisplay will tell you wich Logical Volume your root is in. You need to add a partition for your free space, use fdisk -l to find your hd device name, usually /dev/sda, then fdisk /dev/sda for adding a partition. Now you create a Physical Volume with pvcreate /dev/sda3 (replace /dev/sda3 with the partition you already made). After that add the new Physical Volume to your Volume Group with vgextend /dev/<VGNAME> /dev/sda3 (again replace the names with the actual names for your system). Not done yet, you have to extend the Logical Volume where your root filesystem resides: lvextend -L +10G /dev/<VGNAME/<LVNAME>. You can now extend the EXT4 root filesystem with resize2fs /dev/<VGNAME/<LVNAME> (it can be done even if the filesystem is mounted). Backing up your important data is advised when fiddling with partitions/filesystems, check yourself if you can achieve the same result using a GUI tool like gparted, kde-partitionmanager or similar software if you prefer doing it that way.

edit flag offensive delete link more


I did this via terminal and using the commands suggested and it worked like a dream..THANK YOU And I would just like to say, Brilliant reply..perfect Answer to a problem i expect a few will have at some point or another ;-)

Orriginal gravatar imageOrriginal ( 2017-03-01 11:17:41 -0500 )edit

answered 2017-03-01 02:56:50 -0500

IcyBox gravatar image

It is generally safe to delete .log files (Just do not delete the /var/log directory itself and its subdirectories), the only disadvantage of doing so is that if a problem arises later you will not be able to examine the log.

edit flag offensive delete link more


Thanks for thta..Maybe if I just VI the log ( name not extension ) file and just delete all the entries...that should reduce the file size yes ?

Orriginal gravatar imageOrriginal ( 2017-03-01 05:30:12 -0500 )edit

I think so, you should try with one file.

IcyBox gravatar imageIcyBox ( 2017-03-01 05:43:47 -0500 )edit

answered 2017-03-01 02:55:21 -0500

fcomida gravatar image

I'd try sudo dnf clean all first. If you chose LVM on installation it's very easy to add free space to your root file system, another option would be creating a file system on the free space and mounting /var there.

edit flag offensive delete link more


It did try dnf clean all and it made no difference sadly

As for the LVM - Any hints on how to add that free space there please ?

Orriginal gravatar imageOrriginal ( 2017-03-01 05:32:04 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-03-01 02:15:57 -0500

Seen: 1,257 times

Last updated: Mar 01 '17