2016-07-25 26 views
0

我目前的Ubuntu是16.04.1 LTS,我用它來構建最新的linux 4.7內核。所有的構建過程是平滑的,安裝時除外,它會提示以下錯誤:安裝Linux內核生成「gzip:stdout:設備上沒有空間」錯誤

# make modules_install install 
...... 
    DEPMOD 4.7.0 
sh ./arch/x86/boot/install.sh 4.7.0 arch/x86/boot/bzImage \ 
     System.map "/boot" 
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.7.0 /boot/vmlinuz-4.7.0 
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.7.0 /boot/vmlinuz-4.7.0 
update-initramfs: Generating /boot/initrd.img-4.7.0 
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays. 

gzip: stdout: No space left on device 
E: mkinitramfs failure cpio 141 gzip 1 
update-initramfs: failed for /boot/initrd.img-4.7.0 with 1. 
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1 
arch/x86/boot/Makefile:191: recipe for target 'install' failed 
make[2]: *** [install] Error 1 
arch/x86/Makefile:261: recipe for target 'install' failed 
make[1]: *** [install] Error 2 
Makefile:523: recipe for target '__build_one_by_one' failed 
make: *** [__build_one_by_one] Error 2 

我dobut有我的主機上沒有空間,所以我用「df -h」命令檢查:

# df -h 
Filesystem     Size Used Avail Use% Mounted on 
udev       1.9G  0 1.9G 0% /dev 
tmpfs      390M 11M 379M 3% /run 
/dev/mapper/ubuntu--vg-root 454G 25G 407G 6%/
tmpfs      2.0G  0 2.0G 0% /dev/shm 
tmpfs      5.0M  0 5.0M 0% /run/lock 
tmpfs      2.0G  0 2.0G 0% /sys/fs/cgroup 
/dev/sda2     473M 179M 270M 40% /boot 
/dev/sda1     511M 3.5M 508M 1% /boot/efi 
tmpfs      100K  0 100K 0% /run/lxcfs/controllers 
tmpfs      390M  0 390M 0% /run/user/0 

看來只有/dev目錄已滿,但不知是否是根本原因。任何人都可以在這個問題上提供一些線索嗎?

回答

0

正如喲可以在DF的執行有留在你的的/ boot分區只有少數兆看到。

你可以做的第一件事是檢查是否有你不再使用老版本的內核:

# uname -r 
4.6.0-1-amd64 
# dpkg -l linux-image* 
Deseado=desconocido(U)/Instalar/eliminaR/Purgar/retener(H) 
| Estado=No/Inst/ficheros-Conf/desempaqUetado/medio-conF/medio-inst(H)/espera-disparo(W)/pendienTe-disparo 
|/ Err?=(ninguno)/requiere-Reinst (Estado,Err: mayúsc.=malo) 
||/ Nombre         Versión     Arquitectura    Descripción 
+++-=========================================-=========================-=========================-======================================================================================= 
un linux-image        <ninguna>     <ninguna>     (no hay ninguna descripción disponible) 
ii linux-image-4.5.0-2-amd64     4.5.5-1     amd64      Linux 4.5 for 64-bit PCs 
ii linux-image-4.6.0-1-amd64     4.6.4-1     amd64      Linux 4.6 for 64-bit PCs 
ii linux-image-amd64       4.6+74     amd64      Linux for 64-bit PCs (meta-package) 

正如你可以在我的例子中看到的,我有當前的內核和以前的一個安裝。這是我通常的行爲,但在ubuntu中,在某些配置中,也許你安裝了兩個以上的內核。

您可以安全地移除在這兩個旁邊安裝的任何其他內核,因爲您已經測試了當前的內核以及之前的內核。

如果這不是你可以嘗試擴大你的的/ boot分區的情況下,這是在大多數情況下複雜,我看到你有LVM/分區配置。您可以嘗試使用knoppix來啓動您的機器,並調整分區大小以爲分區提供一些額外的空間給您的/boot分區。但是你必須避免在lvm中添加這個空間,因爲我認爲你的安裝在啓動過程中不支持lvm。

最好的選擇應該嘗試調整整個lvm分區的大小,並給予額外的空間/boot