우분투 boot 파티션 용량 부족 해결 방법

🏷️ 리눅스

우분투에서 APT를 이용해 커널 업데이트를 진행할때 boot 파티션의 용량이 부족하다는 메시지와 함께 진행이 되지 않는 경우 apt autoremove 명령어를 통해 이전 커널을 삭제할 수 있지만 의존성 관련 오류가 생기는 경우 apt autoremove 명령이 진행되지 않고, 커널의 의존성 문제를 해결하기 위해서 apt -f install 명령을 사용하면 boot 파티션 용량이 부족해 진행이 되지 않는 딜레마에 빠지는 경우가 있습니다.

이때 다음과 같이 boot 파티션의 이전 커널을 사용자가 직접 정리해서 업데이트를 진행할 수 있습니다.

파티션 용량 확인

root@SUN:/# df -h
Filesystem                Size  Used Avail Use% Mounted on
udev                      472M     0  472M   0% /dev
tmpfs                      99M  3.0M   96M   3% /run
/dev/mapper/SUN--vg-root 1006G  6.5G  948G   1% /
tmpfs                     491M     0  491M   0% /dev/shm
tmpfs                     5.0M     0  5.0M   0% /run/lock
tmpfs                     491M     0  491M   0% /sys/fs/cgroup
/dev/sda2                 237M  233M     0 100% /boot
/dev/sda1                 511M  3.6M  508M   1% /boot/efi
cgmfs                     100K     0  100K   0% /run/cgmanager/fs
tmpfs                      99M     0   99M   0% /run/user/1000

df -h 명령어를 통해 /boot 파티션의 용량을 확인합니다. 4M 밖에 여유 공간이 없네요.

커널 버전 확인

root@localhost:/# uname -r
4.4.0-109-generic

boot 파티션의 용량을 확보하기 위해서 이전 커널들을 삭제해야 하므로 위 명령어로 현재 사용하고 있는 커널 버전을 확인합니다.

root@localhost:/# dpkg -S vmlinuz
linux-signed-image-4.4.0-137-generic: /usr/lib/linux/vmlinuz-4.4.0-137-generic.efi.signature
linux-image-4.4.0-64-generic: /boot/vmlinuz-4.4.0-64-generic
linux-image-4.4.0-109-generic: /boot/vmlinuz-4.4.0-109-generic
linux-image-4.4.0-57-generic: /boot/vmlinuz-4.4.0-57-generic
linux-image-4.4.0-112-generic: /boot/vmlinuz-4.4.0-112-generic
linux-signed-image-4.4.0-112-generic: /usr/lib/linux/vmlinuz-4.4.0-112-generic.efi.signature
linux-image-4.4.0-104-generic: /boot/vmlinuz-4.4.0-104-generic
linux-signed-image-4.4.0-64-generic: /usr/lib/linux/vmlinuz-4.4.0-64-generic.efi.signature
linux-signed-image-4.4.0-104-generic: /usr/lib/linux/vmlinuz-4.4.0-104-generic.efi.signature
linux-signed-image-4.4.0-57-generic: /usr/lib/linux/vmlinuz-4.4.0-57-generic.efi.signature
linux-signed-image-4.4.0-109-generic: /usr/lib/linux/vmlinuz-4.4.0-109-generic.efi.signature
linux-signed-image-4.4.0-116-generic: /usr/lib/linux/vmlinuz-4.4.0-116-generic.efi.signature

위 명령어를 통해 설치되어 있는 커널 버전들을 확인합니다. 이전 커널들이 꽤 많이 남아있네요.

필자가 사용하는 우분투 같은 경우 사용하는 커널은 4.4.0-109-generic 이지만 상위 버전도 존재하기 때문에 현재 사용하는 커널과 바로 이전 버전, 상위 버전을 제외한 나머지 커널을 모두 삭제해 용량을 확보할 수 있습니다.

참고 : 우분투 이전 커널 삭제하기

우분투

저자

댓글

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

Fill out this field
Fill out this field
유효한 이메일 주소를 입력해주세요.

같은 카테고리 글

Linux 크론탭 Crontab 사용법
Linux 크론탭(Crontab) 사용법
크론탭(Crontab)은 리눅스에서 정해진 시간에 스크립트나 데몬 등을 실행하는 스케줄러(Scheduler) 기능입니다. 특정 시간, 요일에 특정한 작업을 실행해야 하거나 반복 작업을 할…