Running out of disk space on /home directory?
I have a 200GB HD and have just installed Linux Mint (12 - KDE) as the only OS (I formatted and wiped my previous Windows 7 installation). I am in the process of installing my "sandbox" and because I'm new to Linux am installing all of the stuff that can't be found with package managers under my /home/<username>
directory, stuff like:
- Jenkins CI
- Artifactory
- Eclipse and all of its plugins
- AppDynamics Lite
- WebCastellum
And others. While trying to install an Eclipse plugin (Google's GAE/GWT plugin) I got a notification that I was about to run out of space under my /home
directory, and sure enough, the Eclipse plugin failed to finish installing because it ran out of available disk space.
When I run df
from the terminal I get this output:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda5 13783792 12133900 958336 93% /
udev 4016004 4 4016000 1% /dev
tmpfs 1611136 1056 1610080 1% /run
none 5120 0 5120 0% /run/lock
none 4027832 84 4027748 1% /run/shm
Again, new to Linux, so this doesn't mean much to me, but it looks like I am currently using up 93% of my disk (which I assume is /dev/sda5
)?
That's crazy!?! This is 200GB and all I've done is install a few relatively-tiny apps. I don't even think I have any media (photos, videos, etc.) on this machine yet! I literally installed the OS and started setting up my sandbox!
A few things:
- Am I reading this
df
output correctly? - Do I need to "mount" or do something special with my
/home
directory that I failed to do? - Is it common to get this out-of-disk-space error under
/home
if you're an inexperienced Linux user (and did not do any mounting or other Linux magic as prescribed above)? - How could I possibly be at 93%?!?! Could I have a virus?!?
Thanks in advance for any help here!
Edit: although it currently reads 93% now, last night (which is when I got these errors) it was at 99%.
Output from lsblk
:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 232.9G 0 disk
├─sda1 8:1 0 211.8G 0 part
├─sda2 8:2 0 1K 0 part
├─sda5 8:5 0 13.2G 0 part /
└─sda6 8:6 0 7.9G 0 part [SWAP]
sr0 11:0 1 1024M 0 rom
sdb 8:16 1 1.9G 0 disk
└─sdb1 8:17 1 1.9G 0 part /media/PKBACK# 001
sr1 11:1 1 7M 0 rom
Solution 1:
The output of df -h
("human-readable sizes") might be a little clearer than plain df
.
In fact, it would probably show that the size of /
is only about 13 GB – I'm guessing you created a second ~190 GB partition for /home
but forgot to actually have it mounted, so all files are being stored on the first (/
) partition.
You can use lsblk
or partitioning tools such as parted
/gparted
to list all existing partitions and their sizes.
Check if the partition for /home
is listed by lsblk
or in your /etc/fstab
, then try to mount it. But for now, mount it somewhere else than /home
, though – for example, /mnt
– to make transferring the files easier.
Your update shows a large partition at /dev/sda1
. You can mount it temporarily on /mnt
:
# mount /dev/sda1 /mnt
If the command succeeds, it will return quietly. If it complains about "unknown fstype", it might be that the partition does not have any file system yet – mkfs.ext4 /dev/sda1
would format it as ext4, the most common one.
To move your files over, log out from your account, then log in as root, and use rsync -avP /home/ /mnt/
to transfer data. Afterwards, delete it from old /home
manually.
To make the partition permanenly mounted on /home
, add the following to fstab:
/dev/sda1 /home ext4 rw,relatime,acl 0 2
Having /
and /home
separate makes it much easier to reinstall Linux (e.g. if you ever want to switch distributions). But if you want to merge them, you can do that with gparted
– however, only from a live CD, not from the same system.
Inside GParted, simply delete the large empty partition, and resize the existing 13 GB one. Be aware that you might need to reinstall your bootloader (GRUB or whatever) after doing so.
Solution 2:
If my math is correct the size of the partition is 13.7 GB based on the value in 1K-blocks column. Looks like when you, or your linux distro created the partitions, it only made 13.7 GB available to your machine, the rest of the disk isn't being used. You can resize the partition using GParted.