LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Resize root directory in Fedora 29 Server. (https://www.linuxquestions.org/questions/linux-newbie-8/resize-root-directory-in-fedora-29-server-4175645407/)

rickhrkachjr 01-02-2019 11:23 PM

Resize root directory in Fedora 29 Server.
 
Cannot do updates because of no disk space in the root directory. Deleted the history of Firefox in Root user and deleted history in Chrome and Firefox in user rickhrkachjr. Root Directory Still shows red in Disk Usage Analyzer. The other trouble I am Having is knowing which device houses what files in order to know which device to increase and which to decrease. The following is what I mean:
/dev/sda3 ext4 /Boot 1gig
/dev/sda4 Extended 926.73gig
/dev/sda5 lvm2pv 926.73gig 22.85gig used
gparted is not helping me to shrink where I think I need to shrink.

Brains 01-02-2019 11:47 PM

I'm using KDE desktop in Fedora 29, KDE partition manager says I have 18.80GB of 18.80GB used up in lvm2pv, but everything works. Yours is showing only 22.85GB used out of 926.73GB in lvm2pv, which means you have lots of free space.
What does df command show, below is what mine shows, only 41% used:
Code:

[jo@localhost ~]$ df
Filesystem              1K-blocks      Used Available Use% Mounted on
devtmpfs                  1991768        0  1991768  0% /dev
tmpfs                    2006376        0  2006376  0% /dev/shm
tmpfs                    2006376      1536  2004840  1% /run
tmpfs                    2006376        0  2006376  0% /sys/fs/cgroup
/dev/mapper/fedora-root  17209168  6600568  9711372  41% /
tmpfs                    2006376        12  2006364  1% /tmp
/dev/sda2                  999320    159240    771268  18% /boot
/dev/sda1                  204580    18360    186220  9% /boot/efi
tmpfs                      401272        12    401260  1% /run/user/1000

You may need to clean out downloaded package cache, possibly over the limit, if you don't think you'll need packages that are already installed, run command: dnf clean packages

rickhrkachjr 01-03-2019 07:02 PM

Hers what I have
 
[root@HomeEG1 ~]# dnf clean packages
0 files removed
[root@HomeEG1 ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 4033112 0 4033112 0% /dev
tmpfs 4048620 0 4048620 0% /dev/shm
tmpfs 4048620 1716 4046904 1% /run
tmpfs 4048620 0 4048620 0% /sys/fs/cgroup
/dev/mapper/fedora_homeeg1-root 15718400 14398828 1319572 92% /
tmpfs 4048620 48 4048572 1% /tmp
/dev/sda3 999320 203620 726888 22% /boot
tmpfs 809724 28 809696 1% /run/user/0
/dev/sdf1 3906983932 74522296 3832461636 2% /run/media/root/My Book

One question comes to mind, how do I see hidden files?

rickhrkachjr 01-03-2019 07:06 PM

Let me try this again.
 
Code:

[root@HomeEG1 ~]# dnf clean packages
0 files removed
[root@HomeEG1 ~]# df
Filesystem                      1K-blocks    Used  Available Use% Mounted on
devtmpfs                          4033112        0    4033112  0% /dev
tmpfs                              4048620        0    4048620  0% /dev/shm
tmpfs                              4048620    1716    4046904  1% /run
tmpfs                              4048620        0    4048620  0% /sys/fs/cgroup
/dev/mapper/fedora_homeeg1-root  15718400 14398828    1319572  92% /
tmpfs                              4048620      48    4048572  1% /tmp
/dev/sda3                          999320  203620    726888  22% /boot
tmpfs                              809724      28    809696  1% /run/user/0
/dev/sdf1                      3906983932 74522296 3832461636  2% /run/media/root/My Book


rickhrkachjr 01-03-2019 07:08 PM

Learning something new every day.
 
Learning something new every day.

syg00 01-03-2019 08:12 PM

Run this to see the worst space consumers - be patient, it will take a while. I find PackageKit to be a problem child.
Code:

sudo du / -xh | sort -hr | head

rickhrkachjr 01-03-2019 08:48 PM

This is what I got
 
Code:

[root@HomeEG1 ~]# du / -xh | sort -hr | head
14G    /
9.0G    /usr
4.1G    /var
3.7G    /usr/share
3.0G    /usr/lib64
2.4G    /var/cache
2.2G    /var/cache/PackageKit/29
2.2G    /var/cache/PackageKit
2.1G    /var/cache/PackageKit/29/metadata
1.9G    /var/cache/PackageKit/29/metadata/updates-29-x86_64/packages


ehartman 01-04-2019 04:22 AM

Quote:

Originally Posted by rickhrkachjr (Post 5944386)
2.4G /var/cache
2.2G /var/cache/PackageKit/29
2.2G /var/cache/PackageKit
2.1G /var/cache/PackageKit/29/metadata
1.9G /var/cache/PackageKit/29/metadata/updates-29-x86_64/packages

That /var/cache/PackageKit sure seems rather large. I don't have that directory on my system/distribution, but my whole /var/cache is less then 1 MB
I would look into /var/cache/PackageKit to see what can be cleaned up there. The 29 directory seems to be most of it (2.2G out of the 2.4G in total) and the metadata again is most of 29.

On the other hand, your root seems to be in a LVM logical volume.
Does the vg (Volume Group) have any free allocation units left?
Read up about LVM and lv management if you don't understand this.

But IF the vg has free space, it is easy to extend the root with lvextend.
Note that afterwards the file system has to be extended too and that cannot be done while you're running from it, so you'll need a LIVE fs with LVM support to do so.

rknichols 01-04-2019 08:57 AM

Quote:

Originally Posted by ehartman (Post 5944455)
Note that afterwards the file system has to be extended too and that cannot be done while you're running from it, so you'll need a LIVE fs with LVM support to do so.

Many Linux-native filesystems can be expanded (but not shrunk) while mounted. lvextend can do this automatically if you include the "--resizefs" option. This works for any filesystem supported by the fsadm utility (ext2, ext3, ext4, ReiserFS, and XFS).

sgrlscz 01-04-2019 09:44 AM

Since you're using LVM, what do the commands pvs, vgs, and lvs show?

ehartman 01-04-2019 09:49 AM

Quote:

Originally Posted by rknichols (Post 5944537)
Many Linux-native filesystems can be expanded (but not shrunk) while mounted. lvextend can do this automatically if you include the "--resizefs" option. This works for any filesystem supported by the fsadm utility (ext2, ext3, ext4, ReiserFS, and XFS).

Ah, learned something new again, thanks!

rickhrkachjr 01-04-2019 02:06 PM

Don't close this ticket
 
This might take a little bit but I would like to post the fix.

rickhrkachjr 01-04-2019 02:31 PM

Is this what you are looking for in those commands
 
Should I have used the format in the previous command?

Code:

[root@HomeEG1 ~]# pvs
  /dev/sdb: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  /dev/sdb: open failed: No medium found
  /dev/sdc: open failed: No medium found
  /dev/sdd: open failed: No medium found
  /dev/sde: open failed: No medium found
  PV        VG            Fmt  Attr PSize  PFree 
  /dev/sda5  fedora_homeeg1 lvm2 a--  926.73g <903.88g
[root@HomeEG1 ~]# vgs
  VG            #PV #LV #SN Attr  VSize  VFree 
  fedora_homeeg1  1  2  0 wz--n- 926.73g <903.88g
[root@HomeEG1 ~]# lvs
  LV  VG            Attr      LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root fedora_homeeg1 -wi-ao---- 15.00g                                                   
  swap fedora_homeeg1 -wi-ao----  7.85g                                                   
[root@HomeEG1 ~]#


rickhrkachjr 01-04-2019 02:43 PM

I am using Gnome as a GUI
 
Does using Gnome create more packages for the GUI environment or any of the alternate sites for packages?

sgrlscz 01-04-2019 04:35 PM

So, you have more than 900GB available for extending /. You can use lvextend to add space to /.

The pvs command gives a summary of your physical volumes (that is the disks/partitions used by LVM). The vgs command gives a summary of the volume groups (that's the storage pool that is made up of the physical volumes). The lvs gives a summary of the logical volumes (that's how the storage is divided up). The vgs shows that the volume group is 926.73g, and there is still nearly 903.88g available for logical volumes.

With lvextend you can give it the exact size you want the lv to be or you can add space. For example, the following command will extend / to 20G:

Code:

# lvextend -L20G -r /dev/fedora_homeeg1/root
The '-L20G' tells it the size and '-r' tells it to resize the file system (if you don't include that, you have to resize the file system after the lvextend).

This will add 5GB:

Code:

# lvextend -L+5G -r /dev/fedora_homeeg1/root
With all of that space, you can create more logical volumes or add it all to /. Personally, I split things up to keep my data separate from the OS. That way, I can install a new OS from scratch on the OS logical volume(s) while leaving the data untouched.

You should really read up on LVM to really get an idea of the different things you can do with it. It gives you a lot of flexibility, especially with servers, but I use on everything, including laptops.


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