3

This is the first time I'm using Ubuntu 19.10. Earlier I was a macOS user and Windows is something that everyone operates. I installed Ubuntu along side Win10 today through a USB stick and although there were some problems regarding the dpkg utility during installation, I seem to have solved it by re-configuring the package manager post install. So far the OS is running smoothly but there seem to be issues regarding the /boot directory. At every boot, I get these warnings:

# Warning 1
Could not scan some of the folders contained in "/boot"
Error opening directory '/boot/lost+found': Permission denied
# Warning 2
The volume "boot" has only 9.2 mb disk space remaining.

So I have three questions:

  • What is the significance of lost+found directory?
  • How do I allow access to this directory?
  • Can I resize the /boot directory through the Disks utility?

Regarding the third question, I followed some of the advice provided at the official documentation and set the size for /boot to ~250 mb but that seems to be a bit smaller than expected. I have tried this:

sudo apt autoremove --purge

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.

And currently I have these kernels running:

sudo dpkg --list 'linux-image*'

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                  Version       Architecture Description
+++-=====================================-=============-============-===========
un  linux-image                           <none>        <none>       (no descrip
ii  linux-image-5.3.0-18-generic          5.3.0-18.19+1 amd64        Signed kern
ii  linux-image-5.3.0-19-generic          5.3.0-19.20   amd64        Signed kern
ii  linux-image-generic                   5.3.0.19.22   amd64        Generic Lin
un  linux-image-unsigned-5.3.0-18-generic <none>        <none>       (no descrip
un  linux-image-unsigned-5.3.0-19-generic <none>        <none>       (no descrip

Which actually refer to some recovery kernels as well so I would prefer not to mess with them. Is there a way I could resize or fix the the /boot directory?

EDIT: This is the output while running df -h

Filesystem      Size  Used Avail Use% Mounted on
udev            3.8G     0  3.8G   0% /dev
tmpfs           785M  1.8M  783M   1% /run
/dev/sda9        24G  5.4G   17G  25% /
tmpfs           3.9G   58M  3.8G   2% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/loop0       45M   45M     0 100% /snap/gtk-common-themes/1353
/dev/loop1      4.3M  4.3M     0 100% /snap/gnome-calculator/501
/dev/loop2      1.0M  1.0M     0 100% /snap/gnome-logs/81
/dev/loop4      150M  150M     0 100% /snap/gnome-3-28-1804/71
/dev/loop5       55M   55M     0 100% /snap/core18/1223
/dev/loop6       15M   15M     0 100% /snap/gnome-characters/317
/dev/loop3       90M   90M     0 100% /snap/core/7917
/dev/sda8       215M  190M  8.8M  96% /boot
/dev/sda1       256M   33M  224M  13% /boot/efi
/dev/loop7       15M   15M     0 100% /snap/gnome-characters/359
/dev/loop8      4.3M  4.3M     0 100% /snap/gnome-calculator/544
tmpfs           785M   32K  784M   1% /run/user/1000
/dev/loop9      157M  157M     0 100% /snap/gnome-3-28-1804/91
3
  • 1
    run df -h and post it Oct 28, 2019 at 18:44
  • Why did you elect to use a boot partition? Maybe you don't even need one. Raid or encrypted root might be reasons for a boot partition, but a partition to ensure the kernels are at the beginning of the disk is not needed these days.
    – ubfan1
    Oct 28, 2019 at 19:41
  • Thanks for the inputs gentlemen. I've added the requested output. @ubfan1 Is there a way Ubuntu can automatically reallocate boot partition from my current installation. There could be some way to fix this other than a fresh reinstall?
    – Shiv_90
    Oct 29, 2019 at 4:01

1 Answer 1

1

You have plenty of room in your root. If root is just an ext4 filesystem, not raid and not encrypted, you just need to copy the existing files from the partition mounted at /boot there, unmount /boot, and run update grub. You could simply copy everything in /boot to /tmp/tmpboot, unmount /boot, and copy everything from /tmp/tmpboot back to /boot (now on root), the run update-grub. Edit the /etc/fstab file to comment out (put a # at the beginning of the line) the /boot mount, and try a reboot. A more elegant way would be to use a mount --bind / /tmpboot and copy files directly from /boot to /tmpboot/boot.

Probably for a beginner, it would be just as easy to to the reinstall, rather than learning how to edit files as root (and not mess up your own directory's files).


The /boot/efi is a mount from the EFI partition, so in the new /boot directory, just make a directory efi. The lost+found directory is for dumping files recovered from a filesystem check, which may have lost their directory or even their name. Since the root has a lost+found, another one is not needed in the /boot directory. I can't think of any other files which would not be needed. /boot/grub is a directory, so a recursive copy would be needed and preservation of owner and permissions, so cp -R -a /boot/* /tmp/tmpboot etc.
I thought you could just unmount /boot (as long as your current directory was not set to /boot), but maybe not -- its not something I ever had to do. The edit of fstab, and a reboot might work, but you should be prepared with an install media to reinstall grub to the hard disk (or understand which parts of grub.cfg like changed UUIDs) need to be edited (thats more work than just a reinstall).

2
  • I was able to copy some of the files from /boot to /root except //boot/efi and 2-3 more. Also I have gparted installed, so while dismounting /boot I get the error # umount -v '/boot' umount: /boot: target is busy.
    – Shiv_90
    Oct 29, 2019 at 8:36
  • For those with similar issues: I clean erased & reinstalled without touching the /boot partition. Let the OS allocate it by self.
    – Shiv_90
    Oct 31, 2019 at 7:57

Not the answer you're looking for? Browse other questions tagged .