Upgrading to new kernel without space

New to Debian (Or Linux in general)? Ask your questions here!

Upgrading to new kernel without space

Postby dbip » 2020-06-16 15:19

Hi there,

I'm trying to upgrade to Stretch and the new kernel that comes with it but I found myself without space to install the package :-(

This is how directories and partitions are organised:

Code: Select all
root@XXXX:/home/xxxxx# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            999M     0  999M   0% /dev
tmpfs           202M   12M  190M   6% /run
/dev/sda1       315M  263M   35M  89% /
/dev/sda5       8.2G  5.0G  2.8G  65% /usr
tmpfs          1007M     0 1007M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs          1007M     0 1007M   0% /sys/fs/cgroup
/dev/sda8       360M  2.2M  339M   1% /tmp
/dev/sda6       2.7G  1.9G  686M  74% /var
/dev/sda9       446G  284G  140G  68% /home
/dev/sdb2       2.8T  1.5T  1.3T  53% /media/Toshiba3TB
tmpfs           202M   32K  202M   1% /run/user/125
tmpfs           202M     0  202M   0% /run/user/1000


When I try to apt-get install linux-image-4.9.0-12-686 I got stuck due to the HD lacking space :-(

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
irqbalance
Suggested packages:
linux-doc-4.9 debian-kernel-handbook
The following NEW packages will be installed:
irqbalance linux-image-4.9.0-12-686
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/37.8 MB of archives.
After this operation, 141 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Preconfiguring packages ...
(Reading database ... 195933 files and directories currently installed.)
Preparing to unpack .../linux-image-4.9.0-12-686_4.9.210-1+deb9u1_i386.deb ...
Unpacking linux-image-4.9.0-12-686 (4.9.210-1+deb9u1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.9.0-12-686_4.9.210-1+deb9u1_i386.deb (--unpack):
cannot copy extracted data for './lib/modules/4.9.0-12-686/kernel/drivers/net/ethernet/broadcom/bnx2x/bnx2x.ko' to '/lib/modules/4.9.0-12-686/kernel/drivers/net/ethernet/broadcom/bnx2x/bnx2x.ko.dpkg-new': failed to write (No space left on device)
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Selecting previously unselected package irqbalance.
Preparing to unpack .../irqbalance_1.1.0-2.3_i386.deb ...
Unpacking irqbalance (1.1.0-2.3) ...
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-4.9.0-12-686_4.9.210-1+deb9u1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)


Is there any way I could take advantatge of all the free space I have on other partitions so to install this new kernel?

I already autocleaned, purged and autoremoved everything, even the 486 kernel I still had in there...

Thanks in advance!


d.
dbip
 
Posts: 13
Joined: 2017-02-05 12:42

Re: Upgrading to new kernel without space

Postby CwF » 2020-06-16 15:44

/dev/sda1 315M 263M 35M 89% /

263M is more than one kernel, so remove what you don't need, you need just one, after you know that one works...
CwF
 
Posts: 696
Joined: 2018-06-20 15:16

Re: Upgrading to new kernel without space

Postby Head_on_a_Stick » 2020-06-16 15:45

I would rsync the entire system on /dev/sda to a backup drive, make some new partitions (using sensible sizes this time) then rsync it all back, reinstall the bootloader and correct /etc/fstab.

315MiB for the entire root partition (excepting /usr, /var & /home) is just silly, why did you do that?

dbip wrote:Is there any way I could take advantatge of all the free space I have on other partitions so to install this new kernel?

I suppose you could clear some space for a new partition and mount it under /lib but that seems like a bit of a sticking plaster tbh.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12194
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Upgrading to new kernel without space

Postby CwF » 2020-06-16 16:03

Head_on_a_Stick wrote:315MiB for the entire root partition (excepting /usr, /var & /home) is just silly, why did you do that?


I thought about making that point, but mine is no better, but has plenty...
Code: Select all
/dev/sdd1                   236M   68M  156M  31% /boot
CwF
 
Posts: 696
Joined: 2018-06-20 15:16

Re: Upgrading to new kernel without space

Postby Head_on_a_Stick » 2020-06-16 16:55

^ That's your /boot partition.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12194
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Upgrading to new kernel without space

Postby dbip » 2020-06-16 18:47

Head_on_a_Stick wrote:I would rsync the entire system on /dev/sda to a backup drive, make some new partitions (using sensible sizes this time) then rsync it all back, reinstall the bootloader and correct /etc/fstab.

315MiB for the entire root partition (excepting /usr, /var & /home) is just silly, why did you do that?

dbip wrote:Is there any way I could take advantatge of all the free space I have on other partitions so to install this new kernel?

I suppose you could clear some space for a new partition and mount it under /lib but that seems like a bit of a sticking plaster tbh.


Thank you for your help.

With "315MiB for the entire root partition" you mean such small space? Followed a tutorial when I did it 9 years ago and it worked so far in fact, which size would you recommend me then?


BR,

d.
dbip
 
Posts: 13
Joined: 2017-02-05 12:42

Re: Upgrading to new kernel without space

Postby Head_on_a_Stick » 2020-06-16 18:51

I personally just use a single partition for the entire system. In fact I use a single partition for three entire distributions atm — btrfs subvolumes ftw!
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12194
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Upgrading to new kernel without space

Postby CwF » 2020-06-16 19:36

dbip wrote: and it worked so far in fact

I wouldn't worry about it, and still think there are a few things there you don't need. Maybe plymouth or something added some bulk. I listed my boot since apples to apples that's where the kernels are. I either have a 255MB /boot with all else encrypted, or 1 single partition as hoas mentions, depending... kernels are gaining weight, and fancy splash stuff gets in there too. Anymore I think, / should be device size.
CwF
 
Posts: 696
Joined: 2018-06-20 15:16

Re: Upgrading to new kernel without space

Postby p.H » 2020-06-16 20:57

dbip wrote:With "315MiB for the entire root partition" you mean such small space?

Yes. One 4.9 kernel requires 140 MiB for itself and 20 to 60 MB for its initramfs.
A kernel update requires as much available free space. It means that you need at least 140*2+20 = 300 MiB for the kernel alone. This leaves only 15 MiB for the rest of / (including /etc and /lib). I'm afrait it won't work.

Head_on_a_Stick wrote:I suppose you could clear some space for a new partition and mount it under /lib

Don't do that. /lib is not supposed to be separated, it is supposed to be available before mounting any filesystem other than / and /usr.
However /lib* may be a symlink pointing into /usr which is mounted at early boot by the initramfs.
p.H
 
Posts: 1383
Joined: 2017-09-17 07:12

Re: Upgrading to new kernel without space

Postby arid » 2020-06-16 22:30

Followed a tutorial when I did it 9 years ago and it worked so far in fact, which size would you recommend me then?


So you think, in the magical world of computers, 9 years is an irrelevant time frame?

This 9 years also suggests it's time to upgrade your computer.

Wipe it and divide it up into sensible sizes.

Of course if you truly want the latest and greatest on your new computer, sid is your dream installation with a squeaky new 5.8 kernel. :mrgreen:
There's no drama in my sid......
arid
 
Posts: 85
Joined: 2014-05-08 18:40
Location: Aridzona

Re: Upgrading to new kernel without space

Postby stevepusser » 2020-06-17 06:11

Newer kernels are also going to include a lot more hardware drivers, so take up a lot more space. You can build your own, with just the drivers you use, but that's another topic.

The current Buster kernel takes up about 270 MB, a backported 5.6 from Sid takes over 280, and Liquorix kernels well over 300.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Kodi 18.7, QMPlay2 20.07.04, Pale Moon 28.10.0, KeepassXC 2.6.0, Krita 4.3.0, Foliate 2.4.2
User avatar
stevepusser
 
Posts: 11815
Joined: 2009-10-06 05:53

Re: Upgrading to new kernel without space

Postby CwF » 2020-06-17 12:16

Let's not get ahead of ourselves here, as p.H. pointed to, ONLY the result images for the system need to be there, NOT the whole downloaded deb file. Otherwise I to would be out of space, instead of 2/3 free with my buster kernel in 255MiB. It takes 54MB and is a 270MB DL, yet lives...the one I posted earlier is a 23MB image, tidier yet still from a much larger download..

Maybe the OP should post the contents of / and /boot so we can see the 2-3 other kernels still in there.
CwF
 
Posts: 696
Joined: 2018-06-20 15:16

Re: Upgrading to new kernel without space

Postby p.H » 2020-06-17 20:42

Again, CwF you are talking about your separate /boot while the OP has /boot in the 315-MiB root filesystem.
p.H
 
Posts: 1383
Joined: 2017-09-17 07:12

Re: Upgrading to new kernel without space

Postby CwF » 2020-06-17 20:59

p.H wrote:Again, CwF you are talking about your separate /boot while the OP has /boot in the 315-MiB root filesystem.

Yes, and we have yet to see what's in there. Could be not much, his /boot could be the majority of his / and I'll bet my penny more than one kernel.
CwF
 
Posts: 696
Joined: 2018-06-20 15:16

Re: Upgrading to new kernel without space

Postby p.H » 2020-06-18 05:43

Both are unlikely.
The OP is upgrading to stretch, so I assume the current installed kernel is jessie's 3.16 kernel.
This kernel takes about 126 MiB in /lib/modules and 23 MiB in /boot (including initramfs).
Neither jessie nor stretch support /usr merge, so /lib contents is in the root filesystem even though /usr is separated.
So one 3.16 kernel takes ~150 MiB in the root filesystem. Two kernels would take ~300 MiB out of 315 MiB, which would leave only ~15 MiB for the rest of the root filesystem contents (/bin, /boot/grub, /etc, /sbin, /lib excluding /lib/modules). On my system :
Code: Select all
11M   /boot/grub/
6,7M   /etc/
10M   /bin/
55M   /lib/
20M   /sbin/
101M   total

Two kernels cannot possibly fit.
p.H
 
Posts: 1383
Joined: 2017-09-17 07:12

Next

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable