43

/boot has become 100% full somehow.

df -k
Filesystem              1K-blocks     Used Available Use% Mounted on
/dev/mapper/ubuntu-root 191078052 31758960 149612804  18% /
udev                      3997520        8   3997512   1% /dev
tmpfs                     1602244      856   1601388   1% /run
none                         5120        0      5120   0% /run/lock
none                      4005600     1792   4003808   1% /run/shm
none                       102400       28    102372   1% /run/user
/dev/sda1                  233191   218740      2010 100% /boot


mount
/dev/mapper/ubuntu-root on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
/dev/sda1 on /boot type ext2 (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
vmware-vmblock on /run/vmblock-fuse type fuse.vmware-vmblock (rw,nosuid,nodev,default_permissions,allow_other)
gvfsd-fuse on /run/user/foo/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=foo)

How can I make the space allocated to /boot bigger?

There is a related question How do I free up more space in /boot? but that is not what I want to do.

Added.

Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders, total 390721968 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 identifier: 0x0007f9dc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   390721535   195109889    5  Extended
/dev/sda5          501760   390721535   195109888   8e  Linux LVM

Disk /dev/mapper/ubuntu-root: 198.8 GB, 198784843776 bytes
255 heads, 63 sectors/track, 24167 cylinders, total 388251648 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 identifier: 0x00000000

Disk /dev/mapper/ubuntu-root doesn't contain a valid partition table

Disk /dev/mapper/ubuntu-swap_1: 1006 MB, 1006632960 bytes
255 heads, 63 sectors/track, 122 cylinders, total 1966080 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 identifier: 0x00000000

Disk /dev/mapper/ubuntu-swap_1 doesn't contain a valid partition table
  • 2
    @Takkat I am asking how to make \boot bigger not how to free up space in it. – Anush Apr 11 '13 at 8:55
  • 2
    The boot is normally big enough. I suppose you installed some other linux kernels. Try to do sudo apt-get autoremove. When this not work your can do dpkg -l linux to see what you have installed. – Thomas15v Apr 11 '13 at 9:43
  • If you have 2 partitions in sda(boot and LVM) either you have adjacent free space and you resize the /boot partition or you will need to shrink the LVM partition. Update your answer with your partition layout. – Salem Apr 11 '13 at 10:21
49

There are 2 parts to this:

  1. Open a terminal and run ls /boot If boot is full of old kernels you can go remove happy on them, I recommend keeping the original, the latest and the one before latest. the lowest number is normally the shipping kernel, the highest number will be the latest.

  2. To grow boot you first need to shrink another partition so you have free space. I would suggest using the gparted tool on the live cd to do this. First decrease the size of/ or /home depending on your setup. Then increase the size of boot.

  • 21
    You can also trying running apt-get autoremove to clean out old kernel files in /boot to clear up space. – Justin Jenkins Feb 6 '14 at 3:59
  • 1
    @JustinJenkins, I've seen this recommended elsewhere, too, but apt-get autoremove does not remove my old kernels automatically. As a workaround I periodically remove them manually, but I'd really like to know why apt-get autoremove doesn't work for this for me. Any pointers? – BlueBomber Dec 19 '14 at 15:51
  • 15
    @BlueBomber, try "apt-get --purge autoremove" - the --purge option may be what you're looking for. – Mister_Tom May 12 '15 at 17:08
  • @JustinJenkins That helped me much , mister_tom --Purge gave that extra more space, together I cleaned up nearly 450 mb – Clain Dsilva Jun 2 '15 at 7:38
  • This is the perfect solution for people who have /boot as a separate partition and have run out of space. – OverlordvI Mar 26 '17 at 22:08
7

I assume this Linux machine is a VM.

Expand the SCSI device by 1GB on VM sphere centre or AWS, etc, so /dev/sda gets an additional 1GB of space.

Reboot the server to single user mode. Use fdisk -l /dev/sda to confirm the new size with additional 1GB.

Use fdisk /dev/sda to create an sda3 partition with 1GB. Save the partition table. Ubuntu will require partprobe to update the partition table. Now run:

mkfs.ext4 /dev/sda3
umount /boot
dd if=/dev/sda1 of=/dev/sda3
e2fsck -y /dev/sda3
resize2fs /dev/sda3
e2fsck -y /dev/sda3

Now update /etc/fstab (be sure to make a backup copy, just in case need to boot from CDROM/DVD to recover), update the line to mount /dev/sda3 on /boot (and comment the line for /dev/sda1)

Mount /boot

df -k should see /boot is 1GB now, but you need to make it the default boot device.

Use fdisk /dev/sda, and press p to print the partition table. You will see /dev/sda1 is the default boot device.

Use the a command in fdisk to disable /dev/sda1 as default boot device and again to enable /dev/sda3 as default boot device. p to show partition table.

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048      411647      204800   83  Linux
/dev/sda2          411648    20971519    10279936    5  Extended
/dev/sda3   *    20971520    23068671     1048576   83  Linux
/dev/sda5          413696    20971519    10278912   8e  Linux LVM

Reboot

After you've been online for sometime, if you feel you want to utilize the 200MB of /dev/sda1, just recreate /dev/sda1 and put into any VG you want.

  • Worked flawlessly on Ubuntu 16.04. Thank you so much! :) – Dominik Hadl Mar 31 at 10:29

protected by Community Jun 2 '17 at 6:47

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.