16

I have downloaded the newest most stable Linux kernel, 2.6.33.2.

I thought I would test this using VirtualBox. So I create a dynamically sized harddisk of 4 GB. And installed CentOS 5.3 with just the minimum packages.

I setup the make menuconfig with just the default settings.

After that I ran make and got the following error:

net/bluetooth/hci_sysfs.o: final close failed: No space left on device
make[2]: *** [net/bluetooth/hci_sysfs.o] Error 1
make[1]: *** [net/bluetooth] Error 2
make: *** [net] Error 2

The amount of space I have left is:

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      3.3G  3.3G     0 100% /
/dev/hda1              99M   12M   82M  13% /boot
tmpfs                 125M     0  125M   0% /dev/shm

My virtual size is 4 GB, but the actual size is 3.5 GB.

$ ls -hl
total 7.5G
-rw-------. 1 root root 3.5G 2010-04-13 14:08 LFS.vdi

How much size should I give when compiling and installing a Linux kernel? Are there any guidelines to follow when doing this? This is my first time, so just experimenting with this.

Peter Mortensen
  • 12,090
  • 23
  • 70
  • 90
ant2009
  • 3,045
  • 17
  • 46
  • 53

5 Answers5

8

On my recent AMD64 build of 4.4.0-57 on Ubuntu 16.04, I needed about 14.5 GB of space for the build outputs.

That seems a a lot and it seems that is mostly transiently needed files (e.g., .o files resulting from compiling a .c file).

BeeOnRope
  • 1,051
  • 1
  • 13
  • 24
3

Refer to this link >> https://ubuntuforums.org/showthread.php?t=2266609

I compiled/made linux kernel 4.0.0-rc1 on my HP Stream 13 (2GB RAM, dual core Intel Celeron N2840) based on the clear instruction on https://wiki.ubuntu.com/KernelTeam/GitKernelBuild, and this is my experience:

After the "git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git" the disk in use in the separate kernel directory: 1691 MB

During the make/compile, the disk space in use went up to 15674 MB. So: more than 15GB ...

Total compile time was: 299 minutes, or 5 hours. Quite long, probably caused by my slow CPU and slow disk.

  • Git is entirely different beast. You’d usually download a snapshot. The git respository contains the entire history of Kernel development. Also, compiling will *never* take that long when irrelevant options are deselected. – Daniel B Oct 15 '16 at 12:18
2

From Guide,

NOTE: If you do not have lot of disk space in /usr/src then you can unpack the kernel source package on any partition where you have free disk space (like /home). Because kernel compile needs lot of disk space for object files like *.o. For this reason the /usr/src/linux MUST be a soft link pointing to your source directory.

ukanth
  • 10,660
  • 11
  • 43
  • 60
  • This answer also lacks the amount of free disk space (in GB) that is required to compile the kernel: 1.7GB neither 5.4GB aren't enough for building an amd64-3.11.0 kernel on Ubuntu 13.10. – Pro Backup Mar 12 '14 at 14:01
1

An april 2010 linux kernel is about 60MB bzip2 archive, which after unpacking and compiling takes about 400-500MB.

You can check your directory size with du -hs like:

/mnt/storage/linux-2.6.33$ du -hs                               
437M    .
Pro Backup
  • 519
  • 1
  • 7
  • 23
Ivan Petrushev
  • 1,719
  • 4
  • 16
  • 28
  • 1
    Hello, if that is the case then why is all my disk space being used up. I have allocated a 4gb harddisk and only installed CentOS with only the development tools and libraries. Shouldn't take up that much disk space. When I installed CentSO I just setup 1 partition for root and nothing else. Any problem with that? – ant2009 Apr 13 '10 at 10:40
  • You can investigate what is eating your space with `du -h --max-depth=1` run in your root directory (/). Take the biggest directory, go into it, repeat. Do this untill you find your disk hogs. – Ivan Petrushev Apr 15 '10 at 05:40
  • 1
    To list files in current dir sorted by size use `ls -lhS`, and to see top 10 biggest file in the current dir use `ls -lhS|head -10`. – Ivan Petrushev Apr 15 '10 at 05:41
  • 4
    The problem is with the space being used while compiling, not unpacking, methinks. – Nikana Reklawyks Jun 29 '13 at 07:52
  • Confirming, most space is used while compiling. – lethalman Sep 20 '13 at 12:59
0

It seems that the size requirement either has increased over the years or is greater for the realtime kernel. My linux-rt-devel directory is ~36GB:

du -sh linux-rt-5.15/
36G     linux-rt-5.15/
sage
  • 1,117
  • 2
  • 14
  • 22