返回列表 發帖

How to rescue a Raspbian SD card without free disk space due to large log files?

本帖最後由 角色 於 2019-1-28 21:25 編輯

When I used tcpdump to carry out V2Ray experiments without too much attention, the file size of the system became full. When I rebooted the system, it stopped after a while. Is there any way to remote the large log files (I guessed)?

After having searched on the Internet, I found that I have to install the same Linux Raspbian as I have one on hand on another new SD card.

I downloaded a lite version of Raspbian of size 3xxMB. I was able to install on a new SD card and made it run on my Rasberry Pi 3b box. I put it on a USB reader and plugged into the USB slot before powering up the Raspberry Pi.

After powering up, I got three files /dev/sda, /dev/sda1 and /dev/sda2
/dev/sda1 is vfat filesystem
/dev/sda2 is ext4 filesystem

using the command mount -t ext4 /dev/sda2 /media/usb (where usb has to be created before the mount command)

went to /var/log and checked the file size
removed the large files such as /var/log/daemon.log and other large-sized logs.

After the above steps, I was able to rescue the Raspbian SD card.

There is another method which is the same as above if you have a Raspbian Desktop version SD card. Just boot it up and plug the over-run sized SD card into one of the USB slot with an SD card reader. After just a few second, the system will detect the presence of the inserted SD card with two partitions. You can easily edit the over-sized partition by removing unnecessary big log file.

TOP

返回列表