LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Root drive is out of space, how to allot more room? (https://www.linuxquestions.org/questions/linux-newbie-8/root-drive-is-out-of-space-how-to-allot-more-room-4175640418/)

Erdward 10-15-2018 10:39 AM

Root drive is out of space, how to allot more room?
 
I am running Fedora, and have recently run out of space on my root drive. I can't even seem to remove packages because of this.

When my system was initially setup, I believe it was done in such a way that I can allot more space to the root drive when needed, but I'm not sure how to do this. Can someone please help?

rtmistler 10-15-2018 10:45 AM

Hi and welcome,

You can usually boot using a live media like a CD/DVD/USB and then adjust the partition sizes, or remove files to free up space.

One way to handle this is to copy off data and then remove it from there using a live boot situation, and then boot into your system and remove packages once you've freed up enough space to be able to take those actions when the system is running.

Is some portion of this just data that you can copy off to somewhere else?

You absolutely can adjust the size of the partition(s) using a live boot and then a tool like gparted. But every case and everyone's preferences are different. Plus it also depends if you have any free disk space to use to map into your root partition.

Erdward 10-15-2018 12:30 PM

Quote:

Is some portion of this just data that you can copy off to somewhere else?
I'm not really sure. How exactly can I view the contents of the root drive? My hunch is that I have only used it for installing packages, but like I mentioned, I can't seem to remove any packages without some sort of crash occurring.

fatmac 10-15-2018 01:38 PM

It may help to know what distro, & the sizes of your partitions. :)

##########
You can gain 5% of space back by using tune2fs -m 0, but it may not work on a full partition, I use it to have all available space for my /home directory/partition, & give just 1% to the / partition, just in case I need room to play.
##########

Timothy Miller 10-15-2018 02:13 PM

By default Fedora wants to do LVM, so it is possible it's set up to be able to expand if needed.

Post the output of the following commands:

Code:

lsblk -o +FSTYPE
fdisk -l

This will at least tell us how your partitions are set up.

Erdward 10-15-2018 06:28 PM

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT FSTYPE
sda 8:0 0 477G 0 disk
├─sda4 8:4 0 1M 0 part
├─sda2 8:2 0 128M 0 part
├─sda7 8:7 0 500M 0 part /boot ext4
├─sda5 8:5 0 500M 0 part ext4
├─sda3 8:3 0 250.3G 0 part ntfs
├─sda1 8:1 0 100M 0 part /boot/efi vfat
├─sda8 8:8 0 212.8G 0 part LVM2_member
│ ├─fedora-swap 253:1 0 7.8G 0 lvm [SWAP] swap
│ ├─fedora-home 253:2 0 155G 0 lvm /home ext4
│ └─fedora-root 253:0 0 50G 0 lvm / ext4
└─sda6 8:6 0 12.6G 0 part ntfs




Disk /dev/sda: 477 GiB, 512110190592 bytes, 1000215216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 9BD5D967-249F-424B-B691-F5CC71F615D3

Device Start End Sectors Size Type
/dev/sda1 2048 206847 204800 100M EFI System
/dev/sda2 206848 468991 262144 128M Microsoft reserved
/dev/sda3 468992 525381631 524912640 250.3G Microsoft basic data
/dev/sda4 525381632 525383679 2048 1M BIOS boot
/dev/sda5 525383680 526407679 1024000 500M Linux filesystem
/dev/sda6 973740032 1000214527 26474496 12.6G Microsoft basic data
/dev/sda7 526407680 527431679 1024000 500M Linux filesystem
/dev/sda8 527431680 973740031 446308352 212.8G Linux LVM

Partition table entries are not in disk order.


Disk /dev/mapper/fedora-root: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/fedora-swap: 7.8 GiB, 8388608000 bytes, 16384000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/fedora-home: 155 GiB, 166425788416 bytes, 325050368 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

syg00 10-15-2018 06:51 PM

As suggested above, LVM gives you the flexibility to move space around, but there are caveats - lets see " df -hT" as well before we start. You might also want to browse the lvresize manpage for background info.

Erdward 10-15-2018 07:09 PM

> df -hT

Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs tmpfs 7.8G 4.0K 7.8G 1% /dev/shm
tmpfs tmpfs 7.8G 42M 7.8G 1% /run
tmpfs tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/fedora-root ext4 50G 50G 0 100% /
tmpfs tmpfs 7.8G 1.7M 7.8G 1% /tmp
/dev/sda7 ext4 477M 154M 294M 35% /boot
/dev/mapper/fedora-home ext4 153G 119G 27G 82% /home
/dev/sda1 vfat 96M 31M 66M 32% /boot/efi
tmpfs tmpfs 1.6G 16K 1.6G 1% /run/user/42
tmpfs tmpfs 1.6G 64K 1.6G 1% /run/user/1000

Erdward 10-15-2018 07:10 PM

> df -hT

Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs tmpfs 7.8G 4.0K 7.8G 1% /dev/shm
tmpfs tmpfs 7.8G 42M 7.8G 1% /run
tmpfs tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/fedora-root ext4 50G 50G 0 100% /
tmpfs tmpfs 7.8G 1.7M 7.8G 1% /tmp
/dev/sda7 ext4 477M 154M 294M 35% /boot
/dev/mapper/fedora-home ext4 153G 119G 27G 82% /home
/dev/sda1 vfat 96M 31M 66M 32% /boot/efi
tmpfs tmpfs 1.6G 16K 1.6G 1% /run/user/42
tmpfs tmpfs 1.6G 64K 1.6G 1% /run/user/1000

syg00 10-15-2018 07:17 PM

Code:

Filesystem              Type      Size  Used Avail Use% Mounted on
devtmpfs                devtmpfs  7.8G    0  7.8G  0% /dev
tmpfs                  tmpfs    7.8G  4.0K  7.8G  1% /dev/shm
tmpfs                  tmpfs    7.8G  42M  7.8G  1% /run
tmpfs                  tmpfs    7.8G    0  7.8G  0% /sys/fs/cgroup
/dev/mapper/fedora-root ext4      50G  50G    0 100% /
tmpfs                  tmpfs    7.8G  1.7M  7.8G  1% /tmp
/dev/sda7              ext4      477M  154M  294M  35% /boot
/dev/mapper/fedora-home ext4      153G  119G  27G  82% /home
/dev/sda1              vfat      96M  31M  66M  32% /boot/efi
tmpfs                  tmpfs    1.6G  16K  1.6G  1% /run/user/42
tmpfs                  tmpfs    1.6G  64K  1.6G  1% /run/user/1000

See how much easier you can make it for everybody if you use [code] tags ?.

scasey 10-15-2018 07:45 PM

My guess: Log files are not being rotated. Let's see
Code:

ls -l /var/log

Erdward 10-15-2018 07:56 PM

Code:

> ls -l /var/log
total 14608
drwxrwxr-x. 2 root  root              4096 Apr 15  2016 anaconda
drwx------. 2 root  root              4096 Aug 13 08:25 audit
-rw-r--r--. 1 root  root              14126 Oct 13 10:11 boot.log
-rw-------. 1 root  utmp              1536 Oct  9 13:35 btmp
-rw-------. 1 root  utmp                  0 Sep  4 10:24 btmp-20181001
drwxr-xr-x. 2 chrony chrony            4096 Nov 21  2016 chrony
drwxr-xr-x. 2 root  root              4096 Nov  7  2016 cluster
drwxr-xr-x. 2 lp    sys                4096 Jan 11  2017 cups
-rw-------. 1 root  root              53248 Oct 13 10:08 dnf.librepo.log
-rw-------. 1 root  root            1964637 Sep 17 09:15 dnf.librepo.log-20180917
-rw-------. 1 root  root            2830979 Sep 24 20:15 dnf.librepo.log-20180924
-rw-------. 1 root  root            1155486 Oct  2 09:31 dnf.librepo.log-20181002
-rw-------. 1 root  root            1327104 Oct  5 17:04 dnf.librepo.log-20181007
-rw-------. 1 root  root              4096 Oct 13 10:08 dnf.log
-rw-------. 1 root  root              74468 Sep 17 09:15 dnf.log-20180917
-rw-------. 1 root  root            110941 Sep 24 20:15 dnf.log-20180924
-rw-------. 1 root  root              39044 Oct  2 09:31 dnf.log-20181002
-rw-------. 1 root  root              49152 Oct  5 17:04 dnf.log-20181007
-rw-------. 1 root  root                686 Oct 13 10:08 dnf.rpm.log
-rw-------. 1 root  root              1715 Sep 17 09:15 dnf.rpm.log-20180917
-rw-------. 1 root  root              2555 Sep 24 20:15 dnf.rpm.log-20180924
-rw-------. 1 root  root                980 Oct  2 09:30 dnf.rpm.log-20181002
-rw-------. 1 root  root              1372 Oct  5 17:04 dnf.rpm.log-20181007
-rw-r--r--. 1 root  root              56776 Oct 13 10:11 firewalld
drwx--x--x. 2 root  gdm                4096 Mar  6  2017 gdm
drwxr-xr-x. 2 root  root              4096 Mar 10  2017 glusterfs
-rw-------. 1 root  root              5260 Mar 30  2017 grubby
-rw-------. 1 root  root                528 Oct 13 08:06 hawkey.log
-rw-------. 1 root  root              77623 Sep 17 09:15 hawkey.log-20180917
-rw-------. 1 root  root              95226 Sep 24 20:15 hawkey.log-20180924
-rw-------. 1 root  root              40138 Oct  2 09:31 hawkey.log-20181002
-rw-------. 1 root  root              49752 Oct  5 16:04 hawkey.log-20181007
drwx------. 2 root  root              4096 Dec 22  2016 httpd
drwxr-sr-x+ 3 root  systemd-journal    4096 Oct  1  2016 journal
-rw-r--r--. 1 root  root            292292 Oct 13 10:12 lastlog
drwx------. 3 root  root              4096 Nov 14  2016 libvirt
drwx------. 2 root  root              4096 Feb  4  2016 ppp
-rw-r--r--. 1 root  root              1040 Feb 22  2017 README
drwx------. 3 root  root              4096 Mar  9  2017 samba
drwx------. 2 root  root              4096 Dec  7  2016 speech-dispatcher
drwxr-x---. 2 root  root              4096 Mar 16  2017 sssd
-rw-------. 1 root  root                  0 Apr  8  2016 tallylog
-rw-------. 1 root  root              4397 Mar 30  2017 wpa_supplicant.log
-rw-------. 1 root  root            1595152 Sep 17  2016 wpa_supplicant.log-20160907
-rw-------. 1 root  root              32136 Oct  4  2016 wpa_supplicant.log-20161004
-rw-------. 1 root  root            1667082 Dec 10  2016 wpa_supplicant.log-20161022
-rw-------. 1 root  root            2944923 Mar 29  2017 wpa_supplicant.log-20161227
-rw-rw-r--. 1 root  utmp            251520 Oct 13 10:12 wtmp
-rw-------. 1 root  root                  0 Jan  1  2018 yum.log
-rw-------. 1 root  root              7845 Jun 22  2017 yum.log-20180101


rknichols 10-15-2018 09:29 PM

A 50G root filesystem should be more than enough with a separate /home. Those log file don't seem to be using much -- 14MB is barely a blip on a 50G filesystem. Let's see the output from "du -h -x --max-depth=1 /". Don't leave out the "-x" option. You don't want du to descend into pseudo-filesystems like /proc and /sys.

scasey 10-15-2018 09:33 PM

...beat me to it. Just wanted to say my guess was wrong. Definitely need to see the du as rknichols recommended.

syg00 10-16-2018 02:57 AM

My Fedora has 20G for root - recently upped from 15G. This system has been in continuous use since late May 2015 according to journalctl, so something is definitely amiss. I occasionally have to clean out PackageKit, but only in the region of 4-5 Gig. I use a slight variation of the above - "sudo du / -xh | sort -hr | head".

As for the initial request, there isn't a lot of spare even in /home, but if push comes to shove you can reduce the size of that by say 10G (using lvresize with -r; very important that), then do likewise to add the space to the root. We needed to be sure you weren't using XFS on /home - ext4 is good.

Erdward 10-16-2018 07:25 AM

Code:

> du -h -x --max-depth=1 /

4.0K        /media
32G        /var
4.0K        /srv
16K        /Documents
4.0K        /opt
18G        /usr
341M        /root
8.0K        /mnt
33M        /etc
16K        /lost+found
50G        /


bradvan 10-16-2018 08:27 AM

/usr and /var look quite large. Can you give the output of:
Code:

cd /usr
du -h -s *
cd /var
du -h -s *

?

Erdward 10-16-2018 08:29 AM

Code:

> cd /usr
> du -h -s *
4.0K        AUTHORS
457M        bin
4.0K        games
117M        include
1.6G        lib
3.3G        lib64
190M        libexec
4.0K        LICENSE.txt
7.4G        local
4.0K        README.rst
66M        sbin
4.7G        share
192K        src
0        tmp
4.0K        tox.ini


Code:

> cd /var
> du -h -s *
4.0K        account
4.0K        adm
24G        cache
4.0K        crash
12K        db
8.0K        empty
4.0K        ftp
4.0K        games
4.0K        gopher
12K        kerberos
4.6G        lib
4.0K        local
0        lock
2.5G        log
0        mail
4.0K        nis
4.0K        opt
4.0K        preserve
0        run
524K        spool
72K        tmp
12K        www
4.0K        yp


bradvan 10-16-2018 08:33 AM

Try running
Code:

yum clean all

Erdward 10-16-2018 09:36 AM

Quote:

Originally Posted by bradvan (Post 5915393)
Try running
Code:

yum clean all

My terminal just freezes up when I do this, probably because it doesn't have enough space to do it?

fatmac 10-16-2018 09:49 AM

Quote:

32G /var
This is unusually high for a normal use.
Quote:

2.5G log
Likely you can remove this without causing harm to the system, & that should give you room to play with.

Quote:

4.6G lib
Quote:

24G cache
Not sure why you have these in /var either(?).


My /var usage.
306M /var

jsbjsb001 10-16-2018 09:53 AM

Quote:

Originally Posted by Erdward (Post 5915418)
My terminal just freezes up when I do this, probably because it doesn't have enough space to do it?

While you could try the command below, you might be better off to start a live system, then manually delete the contents of your 'cache' folder as root.

Code:

dnf clean all

Erdward 10-16-2018 09:59 AM

Quote:

Originally Posted by fatmac (Post 5915424)
This is unusually high for a normal use.

Likely you can remove this without causing harm to the system, & that should give you room to play with.

I see a lot of .journal files in /var/log/journal/. I have no idea what these are. Can I just remove them?

Quote:

Not sure why you have these in /var either(?).


My /var usage.
306M /var
I'm not sure what this is...

Erdward 10-16-2018 10:29 AM

After removing some files from /var/log/journal/, I seem to have created enough wiggle room to run
Code:

dnf clean all
Now I have 5G out of 50G available, but I'm still not sure what is taking up so much space (45G), or how I got into this situation.

bradvan 10-16-2018 10:36 AM

I suspect you have a lot more rpms installed than you really need. Your /usr usage is very high and so is /var. I would run
Code:

rpm -qa | sort > /var/tmp/rpms
and then start evaluating what you have installed. You can start removing packages you know you don't need. For example, if you aren't connected to windows active directory, you could start removing samba packages (although yum won't let you remove them all). Look through your list and see what jumps out to you.

syg00 10-16-2018 04:33 PM

Gotta be PackageKit in /var/cache. Run the du command I gave earlier.

Erdward 10-16-2018 06:59 PM

Code:

>sudo du / -xh | sort -hr | head

38G        /
23G        /usr
15G        /var
13G        /usr/local
9.8G        /var/cache
9.7G        /usr/local/Wolfram/Mathematica/11.3
9.7G        /usr/local/Wolfram/Mathematica
9.7G        /usr/local/Wolfram
9.3G        /var/cache/PackageKit
8.4G        /var/cache/PackageKit/metadata


jsbjsb001 10-16-2018 09:38 PM

I told you in post #22 to delete the contents of /var/cache Just like I told you to run the "dnf clean all" command, which you say you have done and this has freed some space. Please re-read previous posts and act on the advice already given.


All times are GMT -5. The time now is 11:22 PM.