ubuntu提示boot磁盤空間不足


系統提示boot磁盤空間不足,同時內核image升級錯誤。我的boot是單獨分區的,問題應該是安裝的boot內核版本過多。

1.先查看磁盤空間的情況


:/$  df

Filesystem     1K-blocks    Used Available Use% Mounted on

udev             3991136       0   3991136   0% /dev

tmpfs             802248    9788    792460   2% /run

/dev/sda8       49082176 1273956  45291896   3% /

/dev/sda10      98298500 5337252  87944928   6% /usr

tmpfs            4011236     228   4011008   1% /dev/shm

tmpfs               5120       4      5116   1% /run/lock

tmpfs            4011236       0   4011236   0% /sys/fs/cgroup

/dev/sda7         184307  154957     15731  91% /boot

/dev/sda12       9711136  474504   8720280   6% /tmp

/dev/sda9       49082176 2147976  44417876   5% /var

/dev/sda11      49082176 4253012  42312840  10% /home

tmpfs             802248      80    802168   1% /run/user/1000

經常升級Linux內核,導致更新時警告/boot分區空間不足。這是以為多次升級內核后,導致內核版本太多,清理一下沒用的內核文件就行了。命令如下:



:/$ dpkg --get-selections |grep linux-image

linux-image-4.4.0-21-generic			deinstall

linux-image-4.4.0-38-generic			install

linux-image-4.4.0-42-generic			install

linux-image-4.4.0-45-generic			install

linux-image-extra-4.4.0-21-generic		deinstall

linux-image-extra-4.4.0-38-generic		install

linux-image-extra-4.4.0-42-generic		install

linux-image-extra-4.4.0-45-generic		install

linux-image-generic				install

注意:卸載老的內核之前,首先用uname -a查看當前啟動的是哪個內核(防止把當前正在使用的內核卸載了):



eliefly@thinkpad-s5:~$ uname -a

Linux thinkpad-s5 4.4.0-42-generic #62-Ubuntu SMP Fri Oct 7 23:11:45 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

卸載舊的內核,命令如下:
//卸載linux-image-4.4.0-38-generic


eliefly@thinkpad-s5:/$ sudo apt-get purge linux-image-4.4.0-38-generic

也可使用$ sudo apt-get autoremove linux-image-4.4.0-38-generic

之后根據提示輸入yes即可完成卸載。

再次查看磁盤空間



eliefly@thinkpad-s5:/$ df

Filesystem     1K-blocks    Used Available Use% Mounted on

udev             3991136       0   3991136   0% /dev

tmpfs             802248    9788    792460   2% /run

/dev/sda8       49082176 1060068  45505784   3% /

/dev/sda10      98298500 5337212  87944968   6% /usr

tmpfs            4011236     264   4010972   1% /dev/shm

tmpfs               5120       4      5116   1% /run/lock

tmpfs            4011236       0   4011236   0% /sys/fs/cgroup

/dev/sda7         184307  106538     64150  63% /boot

/dev/sda12       9711136 1016168   8178616  12% /tmp

/dev/sda9       49082176 2147120  44418732   5% /var

/dev/sda11      49082176 4253136  42312716  10% /home

tmpfs             802248      92    802156   1% /run/user/1000

boot空間已經夠用,可以更新版本了


sudo apt-get upgrade


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM