Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Having problems freeing space in /boot

  1. #11
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Having problems freeing space in /boot

    Quote Originally Posted by ajgreeny View Post
    I am fairly sure that it is essential to remove an older, non-working nvidia driver before attempting to install another so follow TheFu's idea and you may get things going again.
    I haven't been removing older nvidia driver versions, but I did remove 3 older versions today. I'm on a GT 1030, so high-end GPUs might be completely different. My other physical machine with a GPU has an AMD and it "just works", once the kernel with support for that iGPU version was installed (which wasn't the normal kernel for my hardware and OS release).

  2. #12
    Join Date
    Jan 2008
    Beans
    43

    Re: Having problems freeing space in /boot

    I managed to get the machine to boot with nvidia-driver-470

    Code:
    NVIDIA-SMI 470.129.06   Driver Version: 470.129.06   CUDA Version: 11.4
    Code:
    paul@clio:~$ ubuntu-drivers devices
    == /sys/devices/pci0000:00/0000:00:1c.7/0000:09:00.0/0000:0a:07.0/0000:0e:00.0 ==
    modalias : pci:v000014E4d000043A0sv00001043sd00008659bc02sc80i00
    vendor   : Broadcom Inc. and subsidiaries
    model    : BCM4360 802.11ac Wireless Network Adapter
    driver   : bcmwl-kernel-source - distro non-free
    
    == /sys/devices/pci0000:00/0000:00:03.0/0000:01:00.0 ==
    modalias : pci:v000010DEd00001B06sv00003842sd00006696bc03sc00i00
    vendor   : NVIDIA Corporation
    model    : GP102 [GeForce GTX 1080 Ti]
    manual_install: True
    driver   : nvidia-driver-515 - distro non-free recommended
    driver   : nvidia-driver-510 - distro non-free
    driver   : nvidia-driver-510-server - distro non-free                                                                                                                   
    driver   : nvidia-driver-515-server - distro non-free                                                                                                                   
    driver   : xserver-xorg-video-nouveau - distro free builtin                                                                                                             
    
    == /sys/devices/pci0000:00/0000:00:02.0/0000:02:00.0 ==
    modalias : pci:v000010DEd0000128Bsv00001462sd00008C93bc03sc00i00
    vendor   : NVIDIA Corporation
    model    : GK208B [GeForce GT 710]
    driver   : nvidia-driver-418-server - distro non-free
    driver   : nvidia-driver-470 - distro non-free
    driver   : nvidia-driver-450-server - distro non-free
    driver   : nvidia-driver-390 - distro non-free
    driver   : nvidia-driver-470-server - distro non-free
    driver   : xserver-xorg-video-nouveau - distro free builtin
    It is showing as manually installed, which I imagine means that it won't be automatically updated. That is not a problem for now.

    I really want to make sure /boot is now cleaned and consistent. The following commands show the situation:

    Code:
    paul@clio:~$ uname -r
    5.4.0-121-generic
    Code:
    paul@clio:~$ dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+'
    rc  linux-image-5.4.0-107-generic                 5.4.0-107.121                        amd64        Signed kernel image generic
    ii  linux-image-5.4.0-110-generic                 5.4.0-110.124                        amd64        Signed kernel image generic
    ii  linux-image-5.4.0-121-generic                 5.4.0-121.137                        amd64        Signed kernel image generic
    Code:
    paul@clio:~$ ls -lh /boot
    total 368M
    -rw-r--r-- 1 root root 233K Apr 14 13:19 config-5.4.0-110-generic
    -rw-r--r-- 1 root root 233K Jun 15 14:13 config-5.4.0-121-generic
    drwx------ 3 root root 4.0K Jan  1  1970 efi
    drwxr-xr-x 4 root root 4.0K Jul  9 03:51 grub
    lrwxrwxrwx 1 root root   28 Jul  9 03:51 initrd.img -> initrd.img-5.4.0-121-generic
    -rw------- 1 root root  55M Jul  9 01:02 initrd.img-5.4.0-110-generic
    -rw------- 1 root root  56M Jul 10 02:54 initrd.img-5.4.0-121-generic
    -rw------- 1 root root 111M Aug 25  2021 initrd.img-5.4.0-77-generic
    -rw------- 1 root root 111M Sep  8  2021 initrd.img-5.4.0-81-generic
    lrwxrwxrwx 1 root root   28 Jul  9 01:05 initrd.img.old -> initrd.img-5.4.0-110-generic
    drwx------ 2 root root  16K Jan 22  2021 lost+found
    -rw-r--r-- 1 root root 179K Aug 18  2020 memtest86+.bin
    -rw-r--r-- 1 root root 181K Aug 18  2020 memtest86+.elf
    -rw-r--r-- 1 root root 181K Aug 18  2020 memtest86+_multiboot.bin
    -rw------- 1 root root 4.6M Apr 14 13:19 System.map-5.4.0-110-generic
    -rw------- 1 root root 4.6M Jun 15 14:13 System.map-5.4.0-121-generic
    lrwxrwxrwx 1 root root   25 Jul  9 01:01 vmlinuz -> vmlinuz-5.4.0-121-generic
    -rw------- 1 root root  14M Apr 14 13:56 vmlinuz-5.4.0-110-generic
    -rw------- 1 root root  14M Jun 15 14:18 vmlinuz-5.4.0-121-generic
    lrwxrwxrwx 1 root root   25 Jul  9 01:05 vmlinuz.old -> vmlinuz-5.4.0-110-generic
    There seem to be some left over images taking a lot of space:
    initrd.img-5.4.0-77-generic
    initrd.img-5.4.0-81-generic

    Can I just delete these files ? Are there any other places where bits of these old kernels might be lieing around ? I don't know how the system got into such a state, but it has persisted for a long time as all attempts to fix it failed. Finally, thanks to help on this forum, things seem to be getting better.

  3. #13
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: Having problems freeing space in /boot

    You may want to also check /lib/modules & /usr/src.

    Sometimes best way to fix it to reinstall, so all the bits are there. Then the uninstall works. When you have some files, but not others, you have to manually house clean everything.

    I also like synaptic but sometimes use command line.

    ls /var/cache/apt/archives/linux-image*
    ls -al /usr/src/
    ls -al /lib/modules/
    ls -al /boot/
    dpkg -l | grep linux-
    ls -al /boot/vmlinuz* /boot/initrd.img*


    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  4. #14
    Join Date
    May 2010
    Beans
    3,419

    Re: Having problems freeing space in /boot

    If the kernel is removed, then you can clean up with:
    Code:
    sudo dpkg -P linux-image-5.4.0-107-generic

  5. #15
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Having problems freeing space in /boot

    There is an overriding rule about packages and files.

    Never manually delete a file from the system areas that was installed with a package and expected to be part of the package removal, except through the package manager. This is because when it is time for the package management system to remove a package, it is going to try to remove all the files it installed and expect to still be there. If 1 of those file doesn't exist, the removal will fail. That's a hassle.

    So, those specific files that you believe are extra in /boot/ ... which package are they part? There are apt and dpkg commands that accept the absolute path to a file and will return the package to which they belong. Some examples:
    Code:
    dpkg -l {part-of-package-name}*
    
    #  list package names based on specific file location
    dpkg -S /usr/bin/passwd
    dpkg-query --search '/path/to/file'
    apt-file search vim
    
    #  list of files in a known package:
    dpkg-query -L {pkg-name}
    If those files you believe are extra aren't part of any installed package on the system, then you can delete them manually. If it turns out you made a mistake, you can create a zero-length (empty) file with the exact name, and use the normal APT methods to remove the package and it will remove those empty files. I suppose there's a -f (force) option, but sometimes it is just easier and safer to avoid that during removals.

    BTW,
    Code:
    $ df -Th /boot
    is a more helpful command to see about space in /boot.

  6. #16
    Join Date
    Jan 2008
    Beans
    43

    Re: Having problems freeing space in /boot

    I checked /usr/src and it looks good. However /lib/modules looks wrong. There are a lot of folders for kernels that are no longer installed.

    Code:
    paul@clio:~$ dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+'
    rc  linux-image-5.4.0-107-generic                 5.4.0-107.121                        amd64        Signed kernel image generic
    ii  linux-image-5.4.0-110-generic                 5.4.0-110.124                        amd64        Signed kernel image generic
    ii  linux-image-5.4.0-121-generic                 5.4.0-121.137                        amd64        Signed kernel image generic
    Code:
    paul@clio:~$ ls -l /lib/modules
    total 60
    drwxr-xr-x 3 root root 4096 Jul  9 03:51 5.4.0-100-generic
    drwxr-xr-x 3 root root 4096 Jul  9 03:51 5.4.0-107-generic
    drwxr-xr-x 6 root root 4096 Jul  9 01:21 5.4.0-110-generic
    drwxr-xr-x 6 root root 4096 Jul 10 02:54 5.4.0-121-generic
    drwxr-xr-x 3 root root 4096 Jun  3  2021 5.4.0-65-generic
    drwxr-xr-x 3 root root 4096 Jun  3  2021 5.4.0-66-generic
    drwxr-xr-x 3 root root 4096 Jun  3  2021 5.4.0-67-generic
    drwxr-xr-x 3 root root 4096 Jun  3  2021 5.4.0-70-generic
    drwxr-xr-x 3 root root 4096 Jun  3  2021 5.4.0-71-generic
    drwxr-xr-x 3 root root 4096 Jun  3  2021 5.4.0-72-generic
    drwxr-xr-x 3 root root 4096 Jan 23 15:19 5.4.0-73-generic
    drwxr-xr-x 3 root root 4096 Jan 23 15:20 5.4.0-74-generic
    drwxr-xr-x 3 root root 4096 Jan 23 15:20 5.4.0-77-generic
    drwxr-xr-x 3 root root 4096 Jan 23 15:32 5.4.0-81-generic
    drwxr-xr-x 3 root root 4096 Jan 23 15:34 5.4.0-88-generic
    These old kernels are not found by the package manager, and I believe are the result of many failed attempts to clean up the kernels. Is it safe to just delete everything except modules for packages 107, 110 and 121 ?

  7. #17
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Having problems freeing space in /boot

    /lib/modules is for kernel module packages. You should remove those that aren't matched to one of the kernels still installed. Remove the PACKAGES, not the files. Let the package manager deal with the files.

    Here's mine:
    Code:
    $ ls -F /lib/modules
    5.4.0-120-generic/  5.4.0-121-generic/  5.4.0-89-generic/
    I haven't manually removed any module packages, so on a properly working system, apt should be addressing those as needed. Just run autoremove and autoclean every few weeks.

  8. #18
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,853
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Having problems freeing space in /boot

    Look for the packages providing these modules directories. For example (on my system):
    Code:
    dpkg --search /lib/modules/5.15.0-40-generic/
    linux-headers-5.15.0-40-generic, linux-modules-extra-5.15.0-40-generic, linux-modules-5.15.0-40-generic: /lib/modules/5.15.0-40-generic
    This tells me that this directory in modules is provided by the linux-headers-..., the linux-modules-extra-... and the linux-modules-... packages, not by the linux-image-... package. Then remove those packages.

  9. #19
    Join Date
    Jan 2008
    Beans
    43

    Re: Having problems freeing space in /boot

    The packages appear to have already been removed. Somehow the system got itself into a horribly inconsistent state. However things seem to be better now - I have freed space on /boot and my graphics driver is working.

    Code:
    dpkg --search /lib/modules/5.4.0-{65,66,67,70,71,72,73,74,77,81,88}-generic/
    dpkg-query: no path found matching pattern /lib/modules/5.4.0-65-generic/
    dpkg-query: no path found matching pattern /lib/modules/5.4.0-66-generic/
    dpkg-query: no path found matching pattern /lib/modules/5.4.0-67-generic/
    dpkg-query: no path found matching pattern /lib/modules/5.4.0-70-generic/
    dpkg-query: no path found matching pattern /lib/modules/5.4.0-71-generic/
    dpkg-query: no path found matching pattern /lib/modules/5.4.0-72-generic/
    dpkg-query: no path found matching pattern /lib/modules/5.4.0-73-generic/
    dpkg-query: no path found matching pattern /lib/modules/5.4.0-74-generic/
    dpkg-query: no path found matching pattern /lib/modules/5.4.0-77-generic/
    dpkg-query: no path found matching pattern /lib/modules/5.4.0-81-generic/
    dpkg-query: no path found matching pattern /lib/modules/5.4.0-88-generic/
    I am going to remove the superfluous files manually.

Page 2 of 2 FirstFirst 12

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
  •