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.


All times are GMT -5. The time now is 11:03 AM.