Results 1 to 10 of 10

Thread: Need to Grow Root Partition

  1. #1
    Join Date
    May 2018
    Beans
    31

    Need to Grow Root Partition

    I have a dual-booted system running Kubuntu 20.04 and Windows 10. My partitioning scheme is sloppy, to say the least. Anyway, I tried to install application updates through Discover last week, and it said it couldn't due to "no disk space." I looked on my hard drive and saw that my root partition, which I had allocated 20.49 GiB, according to KDE Partition Manager. I had not anticipated that my root partition would be holding my application data, I always thought those files went into the /home directory. Anyway, because of this, I need to make my root partition bigger.

    I have already made room by shrinking my Windows partition, but I still can't make the root partition for Kubuntu bigger because the Windows Recovery partition is standing between the free space I created and my root partition. So I need move the Windows recovery partition up on my partition list, but I can't figure out how to get the recovery partition to move. It won't let me drag and drop, so I'm guessing that it's more complicated than that. Here's a screenshot of my partitions.

    I was asked on another thread I was commenting about this issue in to give the output of a command. This is what I got when I put it into Konsole.
    Code:
    jbh@jbh-HP-Pavilion-Laptop-14-ce2xxx:~$ uname -a; dpkg -l | grep linux-imageLinux jbh-HP-Pavilion-Laptop-14-ce2xxx 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU
    /Linux
    rc  linux-image-5.4.0-26-generic                  5.4.0-26.30                                 amd64        Signed kernel ima
    ge generic
    rc  linux-image-5.4.0-29-generic                  5.4.0-29.33                                 amd64        Signed kernel ima
    ge generic
    ii  linux-image-5.4.0-31-generic                  5.4.0-31.35                                 amd64        Signed kernel ima
    ge generic
    ii  linux-image-5.4.0-33-generic                  5.4.0-33.37                                 amd64        Signed kernel ima
    ge generic
    ii  linux-image-5.4.0-37-generic                  5.4.0-37.41                                 amd64        Signed kernel ima
    ge generic
    ii  linux-image-5.4.0-39-generic                  5.4.0-39.43                                 amd64        Signed kernel ima
    ge generic
    ii  linux-image-5.4.0-40-generic                  5.4.0-40.44                                 amd64        Signed kernel ima
    ge generic
    ii  linux-image-5.4.0-42-generic                  5.4.0-42.46                                 amd64        Signed kernel ima
    ge generic
    ii  linux-image-5.4.0-45-generic                  5.4.0-45.49                                 amd64        Signed kernel ima
    ge generic
    ii  linux-image-5.4.0-47-generic                  5.4.0-47.51                                 amd64        Signed kernel ima
    ge generic
    ii  linux-image-5.4.0-48-generic                  5.4.0-48.52                                 amd64        Signed kernel ima
    ge generic
    ii  linux-image-generic                           5.4.0.48.51                                 amd64        Generic Linux ker
    nel image
    Attached Images Attached Images
    Last edited by ajgreeny; October 13th, 2020 at 08:11 PM. Reason: Picture Problems

  2. #2
    Join Date
    Jun 2017
    Beans
    49

    Re: Need to Grow Root Partition

    You cant resize the partition while the system is on, so you need to start a kubuntu/ubuntu usb distro, then use g parted to resize linuxswap from 14 to 10 (should still be enough) and then grow /dev/sda5.
    Remember to shrink linuxswap moving the left barrier, so you have new space at the left for /dev/sda5.

  3. #3
    Join Date
    May 2018
    Beans
    31

    Re: Need to Grow Root Partition

    That fixed it, thanks! Though if my root partition keeps filling up I suppose I could get rid of the swap entirely, create a new swap in the blank space I have elsewhere, and make the root bigger that way? Would that work?

  4. #4
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Need to Grow Root Partition

    It may be a lot easier to remove some of your installed kernels of which you have a very long list.
    Code:
    ii  linux-image-5.4.0-31-generic 
    ii  linux-image-5.4.0-33-generic 
    ii  linux-image-5.4.0-37-generic
    ii  linux-image-5.4.0-39-generic
    ii  linux-image-5.4.0-40-generic
    ii  linux-image-5.4.0-42-generic
    ii  linux-image-5.4.0-45-generic
    ii  linux-image-5.4.0-47-generic
    ii  linux-image-5.4.0-48-generic
    ii  linux-image-generic
    I don't think the usual way to remove these with sudo apt autoremove will work as there will be insufficient headroom so we may have to get down and dirty with dpkg -P commands which can work with very little space compared with apt.

    First we need to know what kernel you are currently using, which should be 5.4.0-48. Command uname -a will show us.
    Assuming I'm correct let's start with command
    Code:
    sudo dpkg -P linux-image{,-extra}-5.4.0-{33,37,39,40,42,45}-generic
    and see if that gets rid of the ones you don't need any more.
    If you see any errors come back and show us and we can edit that command accordingly.

    EDIT:
    Too slow, but I still believe you should rid yourself of all those unneeded kernels which will be an ongoing problem if you leave them.
    You may now, having made changes to your partitions, have room to run command
    Code:
    sudo apt autoremove -s
    just to show you what the command will remove when run without the -s switch, (simulate).
    If it removes only what needs to be removed run it again without the -s switch.
    Last edited by ajgreeny; October 13th, 2020 at 08:34 PM.

  5. #5
    Join Date
    May 2018
    Beans
    31

    Re: Need to Grow Root Partition

    I got this output when I ran the first command:

    Code:
    jbh@jbh-HP-Pavilion-Laptop-14-ce2xxx:~$ sudo dpkg -P linux-image{,-extra}-5.4.0-{33,37,39,40,42,45}-generic
    [sudo] password for jbh:  
    dpkg: dependency problems prevent removal of linux-image-5.4.0-33-generic:
     linux-modules-extra-5.4.0-33-generic depends on linux-image-5.4.0-33-generic | linux-image-unsigned-5.4.0-33-generic; howev
    er:
      Package linux-image-5.4.0-33-generic is to be removed.
      Package linux-image-unsigned-5.4.0-33-generic is not installed.
    
    dpkg: error processing package linux-image-5.4.0-33-generic (--purge):
     dependency problems - not removing
    dpkg: dependency problems prevent removal of linux-image-5.4.0-37-generic:
     linux-modules-extra-5.4.0-37-generic depends on linux-image-5.4.0-37-generic | linux-image-unsigned-5.4.0-37-generic; howev
    er:
      Package linux-image-5.4.0-37-generic is to be removed.
      Package linux-image-unsigned-5.4.0-37-generic is not installed.
    
    dpkg: error processing package linux-image-5.4.0-37-generic (--purge):
     dependency problems - not removing
    dpkg: dependency problems prevent removal of linux-image-5.4.0-39-generic:
     linux-modules-extra-5.4.0-39-generic depends on linux-image-5.4.0-39-generic | linux-image-unsigned-5.4.0-39-generic; howev
    er:
      Package linux-image-5.4.0-39-generic is to be removed.
      Package linux-image-unsigned-5.4.0-39-generic is not installed.
    
    dpkg: error processing package linux-image-5.4.0-39-generic (--purge):
     dependency problems - not removing
    dpkg: dependency problems prevent removal of linux-image-5.4.0-40-generic:
     linux-modules-extra-5.4.0-40-generic depends on linux-image-5.4.0-40-generic | linux-image-unsigned-5.4.0-40-generic; howev
    er:
      Package linux-image-5.4.0-40-generic is to be removed.
      Package linux-image-unsigned-5.4.0-40-generic is not installed.
    
    dpkg: error processing package linux-image-5.4.0-40-generic (--purge):
     dependency problems - not removing
    dpkg: dependency problems prevent removal of linux-image-5.4.0-42-generic:
     linux-modules-extra-5.4.0-42-generic depends on linux-image-5.4.0-42-generic | linux-image-unsigned-5.4.0-42-generic; howev
    er:
      Package linux-image-5.4.0-42-generic is to be removed.
      Package linux-image-unsigned-5.4.0-42-generic is not installed.
    
    dpkg: error processing package linux-image-5.4.0-42-generic (--purge):
     dependency problems - not removing
    dpkg: dependency problems prevent removal of linux-image-5.4.0-45-generic:
     linux-modules-extra-5.4.0-45-generic depends on linux-image-5.4.0-45-generic | linux-image-unsigned-5.4.0-45-generic; howev
    er:
      Package linux-image-5.4.0-45-generic is to be removed.
      Package linux-image-unsigned-5.4.0-45-generic is not installed.
    
    dpkg: error processing package linux-image-5.4.0-45-generic (--purge):
     dependency problems - not removing
    dpkg:warning: ignoring request to remove linux-image-extra-5.4.0-33-generic which isn't installed
    dpkg:warning: ignoring request to remove linux-image-extra-5.4.0-37-generic which isn't installed
    dpkg:warning: ignoring request to remove linux-image-extra-5.4.0-39-generic which isn't installed
    dpkg:warning: ignoring request to remove linux-image-extra-5.4.0-40-generic which isn't installed
    dpkg:warning: ignoring request to remove linux-image-extra-5.4.0-42-generic which isn't installed
    dpkg:warning: ignoring request to remove linux-image-extra-5.4.0-45-generic which isn't installed
    Errors were encountered while processing:
     linux-image-5.4.0-33-generic
     linux-image-5.4.0-37-generic
     linux-image-5.4.0-39-generic
     linux-image-5.4.0-40-generic
     linux-image-5.4.0-42-generic
     linux-image-5.4.0-45-generic
    
    
    I also got this output when I ran autoremove:

    Code:
    jbh@jbh-HP-Pavilion-Laptop-14-ce2xxx:~$ sudo apt autoremove -s
    Reading package lists... Done
    Building dependency tree        
    Reading state information... Done
    The following packages will be REMOVED:
      libllvm9 qtgstreamer-plugins-qt5
    0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
    Remv libllvm9 [1:9.0.1-12]
    Remv qtgstreamer-plugins-qt5 [1.2.0-5]
    
    

  6. #6
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,240

    Re: Need to Grow Root Partition

    There are other ways to make space:
    You can make a swap file and put it in the /home partition, then reclaim all /swap for /.
    You can move the /usr (or any other) directory to /home to free up space on /. Move the directory then put a link to it in /.

  7. #7
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    5,710
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Need to Grow Root Partition

    Then also remove linux-modules-extra-...:
    Code:
    sudo dpkg -P linux-{image,modules-extra}-5.4.0-{33,37,39,40,42,45}-generic

  8. #8
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Need to Grow Root Partition

    Thanks Impavidus, that's what I would also suggest and why I wanted to see the errors he got. Thanks for answering.

  9. #9
    Join Date
    May 2018
    Beans
    31

    Re: Need to Grow Root Partition

    That seems to have worked. Thanks!

  10. #10
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Need to Grow Root Partition

    Great news!

    Please mark as SOLVED from the Thread Tools menu up-top if this is now solved to your satisfaction. It is a great help to other users searching the forum.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •