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? |
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. |
Quote:
|
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. ########## |
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 |
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 |
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.
|
> 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 |
> 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 |
Code:
Filesystem Type Size Used Avail Use% Mounted on |
My guess: Log files are not being rotated. Let's see
Code:
ls -l /var/log |
Code:
> ls -l /var/log |
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.
|
...beat me to it. Just wanted to say my guess was wrong. Definitely need to see the du as rknichols recommended.
|
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. |
Code:
> du -h -x --max-depth=1 / |
/usr and /var look quite large. Can you give the output of:
Code:
cd /usr |
Code:
> cd /usr Code:
> cd /var |
Try running
Code:
yum clean all |
Quote:
|
Quote:
Quote:
Quote:
Quote:
My /var usage. 306M /var |
Quote:
Code:
dnf clean all |
Quote:
Quote:
|
After removing some files from /var/log/journal/, I seem to have created enough wiggle room to run
Code:
dnf clean all |
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 |
Gotta be PackageKit in /var/cache. Run the du command I gave earlier.
|
Code:
>sudo du / -xh | sort -hr | head |
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. |