Disk space full, and can't remove files because it's full?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Disk space full, and can't remove files because it's full?
First off, Hello. This is my first post. I'm trying to learn Linux. I started with slackware64 14.1. I installed it and have been using it just fine for weeks. Now today, I put in a HDD, all good. Now I try to delete some files from it, well trash gets full. I open trash and delete it from there. Somewhere along the way desktop crashes, and most commands won't work. It keeps saying disk space full. Even remove commands.
I'm at a loss. I just don't known Linux well enough yet to troubleshoot it, I don't even know how to phrase the problem well enough to find a solution for my system.
As for the system. It's slackware 14.1 x64. Installed on a 120G SSD. Split into two partitions /dev/sda1 is just a small boot partition, the rest is an extended partition with 3 lvm luks encrypted partitions.
I checked disk usage and everything has space. I tried checking inodes, but from what I read, being encrypted can make that read zero.
If you try to delete too many files at a time - the disk may be used to hold the names. Just start with the biggest files you want/need to delete and delete them one at a time. As you release space, you can start to select more files ...
Oh - I wouldn't use the desktop to do it - use the console command line.
Depending on your partition layout, you could just remove everything in the /tmp/ directory. None of that is required for a properly running system.
Code:
rm -rf /tmp/*
If you have a separate /home/ partition, you'd need to find some large files to remove. As perbh mentioned, I would highly suggest using the commandline to remove stuff, as trying to use a filemanager may cause additional issues if it's trying to generate thumbnails or other similar files.
If you need to find out what's taking all your space, you can use the handy command below. Then once you find a large directory you'd like more info on, you can change into that directory and run the command again until you find some stuff you can delete.
It actually ended up being btrfs. It was working fine for a while, so I forgot that could be an issue. I still couldn't get the workarounds to fix it though. So I went back to ext4. I'll play around with btrfs on a separate drive, vm, or something another time.
I'm trying to learn Linux. I started with slackware64 14.1. I installed it and have been using it just fine for weeks. Now today, I put in a HDD, all good. Now I try to delete some files from it, well trash gets full. I open trash and delete it from there. Somewhere along the way desktop crashes, and most commands won't work. It keeps saying disk space full. Even remove commands.
What tool are you using to delete files ?
The reference to Trash sounds like a GUI tool at work.
Are you able to delete files from the command line ?
Quote:
As for the system. It's slackware 14.1 x64. Installed on a 120G SSD. Split into two partitions /dev/sda1 is just a small boot partition, the rest is an extended partition with 3 lvm luks encrypted partitions.
I checked disk usage and everything has space. I tried checking inodes, but from what I read, being encrypted can make that read zero.
bassmadrigal's and perbh's posts have some useful hints.
And now I need to study up on LUKS and inode counts ... IMO, it would be a nasty regression if LUKS hides or mis-reports inode counts !
Thanks for the info.
-- kjh
Last edited by kjhambrick; 07-01-2016 at 07:22 AM.
It actually ended up being btrfs. It was working fine for a while, so I forgot that could be an issue. I still couldn't get the workarounds to fix it though. So I went back to ext4. I'll play around with btrfs on a separate drive, vm, or something another time.
Rebalancing didn't work? The usual cause is that the space for allocations gets split between the metadata and the actual data. Rebalancing is SUPPOSED to change the split, which would then allow you some space.
The problem sounds like too much GUI. That doesn't delete things very well - as it actually does a "mv src trash" type thing, which can require an expansion of the trash directory, if not a full copy of the file. Using the command line "rm" will delete files, and with a minimum (to no) overhead.
When your disk is full I don't recommend using rm. That only deletes the pointer to the file but the data may still be on disk. It's best to find a big file, like a large log, and empty it out.
I have plenty of space and the logs are taken care of by logrotate so I don't worry about it. If it wasn't for this thread I probably would have never even noticed it was even happening
When your disk is full I don't recommend using rm. That only deletes the pointer to the file but the data may still be on disk. It's best to find a big file, like a large log, and empty it out.
That is exactly how files are deleted. When the last pointer to the file is removed, the file is deleted.
When a file is NOT deleted, there are still pointers to the file.
That is exactly how files are deleted. When the last pointer to the file is removed, the file is deleted.
When a file is NOT deleted, there are still pointers to the file.
This is true in the sense that nothing references the file anymore, but it doesn't actually delete anything. This isn't an issue with HDDs, because they'll just overwrite that sector when new data needs to be written, but SSDs require the sector to be zeroed out before it can be written, which running rm won't do. If you have an SSD, you need to trim the drive after the data is "deleted", as this prepares it for future writes. If you don't, when you try to write something else to that sector, you have to first clear it and then write it, doubling the time it takes to write. This is why fstrim or discard options in fstab are so important on SSDs.
But I will admit, I'm not familiar with btrfs or other similar setups, so it could be completely different there compared to normal HDD or SSD operations.
This is true in the sense that nothing references the file anymore, but it doesn't actually delete anything. This isn't an issue with HDDs, because they'll just overwrite that sector when new data needs to be written, but SSDs require the sector to be zeroed out before it can be written, which running rm won't do. If you have an SSD, you need to trim the drive after the data is "deleted", as this prepares it for future writes. If you don't, when you try to write something else to that sector, you have to first clear it and then write it, doubling the time it takes to write. This is why fstrim or discard options in fstab are so important on SSDs.
That is handled by the SSD itself, not Linux. The fstrim option is the flag for the filesystem to provide that signal to the device.
Quote:
But I will admit, I'm not familiar with btrfs or other similar setups, so it could be completely different there compared to normal HDD or SSD operations.
As long as the filesystem supports SSD usage, there is no difference. And just truncating a file will NOT generate the signals to an SSD for the required activity - unless the filesystem ALREADY supports fstrim.
But it is still true that the file isn't "deleted" by simply removing the pointers. It only occurs on SSDs when trim is used, and on HDDs you need to manually do it, since there isn't something in place to do it (since there's really no need unless you need to securely remove the file).
removing the pointers is all the filesystem needs. That is ALL that is needed.
The "trim" is only required by the device, and since it is a device activity, guess what - the filesystem has to do it.
If the filesystem doesn't support the trim, guess what - you can't do it at all. "manually do it" is called "writing data". Might be zeros, might not, but writing data is your activity.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.