I've got my 4GB SD card full and Raspbian won't complete the boot process.
Is it possible to access the file system on a different computer (by plugging in the SD card) and editing/deleting files there? If so, how?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
Yes, the most obvious and straightforward way is to mount them under linux, where ext4 is the native filesystem. Keep in mind that the raspberry pi is not actually the focus of the linux world -- not including android (which uses the kernel), between 1-5% of PCs (desktops, laptops, etc), 30-40% of web servers, and 95% of the world's supercomputers run some flavor of GNU/Linux, of which Debian is a primary stream (and raspbian an offshoot of debian). So that's well into the tens of millions of users and you have plenty of options to choose from -- most of which are, like raspbian, distributed without charge.
If you don't want to install linux on a PC, you could use a "Live CD". This is an install disk that boots a normal, running OS from a CD or DVD so you can try it out. It doesn't actually install anything unless you ask it too, and they are generally useful for doing recovery things -- you could certainly mount the SD card. Most distributions, including debian, have a live DVD (nb. Intel 64-bit architecture is part of the 'amd64' stream for debian; other distros call it 'x86_64'). You just download the .iso image and burn it onto a disk. Note you do not have to use debian, and you can generally presume that any install disk you download will work as a live disk, including ubuntu and fedora.
Running from a DVD can be a little slow but it should be fine if you just want to check the SD card in an environment that is actually equipped to repair something if necessary (mostly meaning: you can run
e2fsck on the partition). It is also very easy -- again, just download the .iso, burn the disk, boot it. You can also do this with a USB stick.
Running a live CD doesn't allow you to save a configuration of anything, etc. however. A popular choice in recent years, now we all have beefy multi-core systems that can do it smoothly, is to run a virtual machine with linux inside windows or OSX, so that you do not actually have to install it to a partition or boot it, but you can maintain the system on a hard drive.
Finally, while Microsoft and Apple are evidently adverse to including ext4 support (there's nothing stopping them from doing so), it is not impossible to get it there (I can't endorse any of those methods as I have not tried them, but there must be something stable around). However, again, you will not be able to repair the filesystem that way.
In addition to mounting the ext4 partition of the SD card as @goldilocks suggests, you should be able insert the SD card into any Windows machine and edit
cmdline.txt in the vfat
/boot partition (which should be directly available to Windows) and add the following parameter to the line that is already in that file:
According to this posting, this tells the kernel to run
/bin/sh instead of
This should allow you to list out the contents for the root file system and then delete anything you don't need to free up space in the file system.
You would then need to edit
/boot/cmdline.txt and remove the
init=/bin/sh parameter. You can use
nano to perform that update.