Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
RFC: Aggressive disk space reclamation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
pdl
n00b
n00b


Joined: 06 Apr 2006
Posts: 42

PostPosted: Tue Apr 17, 2007 12:36 am    Post subject: RFC: Aggressive disk space reclamation Reply with quote

Can I reclaim unused disk space by trusting the atime property of my files and directories?

In more detail, suppose I use the find command to generate a list of all files that haven't been opened, read from, or used in any way for some long period -- say, 3 months -- and summarily delete them. What, if anything, will break?

Of course I have looked through the list just mentioned, and not seen anything alarming about to be vaporized. But the list is long, and some entries are unfamiliar. So I haven't summoned the moxie to actually go ahead and send all those files to the bit-bucket. I would rather hear some well-informed comments first. Here are two issues that worry me:

1. File systems are mounted read-only during the boot process. So the files used only for booting will never get their atime fields updated. Deleting these ones would make all sorts of trouble.

2. Recent editions of /etc/fstab from Gentoo HQ promote the use of the noatime optimization flag. Obviously once that flag has been turned on for about 3 months, the proposal above would remove pretty well everything. More trouble, guaranteed.

Are there any other things to worry about here, or should I just try it, and report back after a complete reinstall? :D
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Tue Apr 17, 2007 2:14 am    Post subject: Reply with quote

Moved from Documentation, Tips & Tricks to Other Things Gentoo, as it is a query.
Back to top
View user's profile Send private message
jesnow
l33t
l33t


Joined: 26 Apr 2006
Posts: 857

PostPosted: Tue Apr 17, 2007 2:31 am    Post subject: Reply with quote

Try it!

J.
Back to top
View user's profile Send private message
tarpman
Veteran
Veteran


Joined: 04 Nov 2004
Posts: 1083
Location: Victoria, BC, Canada

PostPosted: Tue Apr 17, 2007 5:19 am    Post subject: Reply with quote

Although it will take a while, I highly recommend running 'equery belongs' on any file before you remove it, because you never know.

Oh, and you do keep backups, right? :)
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Tue Apr 17, 2007 5:52 am    Post subject: Reply with quote

tarpman wrote:
Although it will take a while, I highly recommend running 'equery belongs' on any file before you remove it, because you never know.
Alternatively, qfile -v (app-portage/portage-utils) can be used to provide the same information as equery b (app-portage/gentoolkit).
Back to top
View user's profile Send private message
pdl
n00b
n00b


Joined: 06 Apr 2006
Posts: 42

PostPosted: Wed Apr 18, 2007 7:13 am    Post subject: Picking up the gauntlet Reply with quote

Jesnow urges:
Quote:
Try it!

OK, you're on. But Tarpman raises a good question that's probably not purely rhetorical:
Quote:
Oh, and you do keep backups, right?

I guess I'll back up before taking drastic action, and this will delay the next report by a day or two. Part of being a n00b means nothing that sounds fast and easy turns out to be either.

For those who care, here is some background.

Philosophical: My question about saving disk space is really an instance of a perennial Gentoo question: "How much software does one man need?" [Apologies to Tolstoy.] There is a certain aesthetic appeal in deleting everything I never use, and the atime test might help identify just what is redundant to me. Tarpman and Desultory suggest asking portage which package owns the stale files that I never touch, but that's not my plan. I'm looking for an installation that is capable of executing all my usual requests (as defined by my 3-month usage pattern) and nothing else. The result should be very lean, infuriating to users other than me, and a great way to learn a lot about the way Gentoo Linux works.

Technical: I want to see how small a system I can get, starting with a conventional Stage 3 installation. My mid-tower case used to contain a 13 GB hard disk drive and a 1 GB compact flash drive pretending to be an IDE disk. Using a full-featured Gentoo installation on the hard disk, I compiled a smaller system onto a 500MB partition, made sure it booted OK, then copied that partition onto the CF card and removed the hard disk drive completely. [This took a week of trial and error.] The CF system currently uses 360 MB, and I think it could be smaller. It started as a Gentoo system, but it was built with gcc, portage tree, perl, distribution files, and many Gentoo components symlinked on the hard disk drive. Now that the HDD is gone, the CF system has no compiler, no portage tree, and probably doesn't even deserve the Gentoo name. But it runs quite nicely -- CF speed is 150X -- and at least it has a Gentoo kernel. I'd like to see if I can squeeze this thing into an even smaller space. I'm sure there are better ways to build a small minimalist system (TinyGentoo comes to mind), but this is a learning adventure!

More news when it happens. Thanks for your interest.
Back to top
View user's profile Send private message
jesnow
l33t
l33t


Joined: 26 Apr 2006
Posts: 857

PostPosted: Thu Apr 19, 2007 10:11 pm    Post subject: Reply with quote

I've thought about this too, but how do you keep files you've killed from coming back
the next time you do emerge -DNu world? I've thought of having a permanent list of
files somewhere that I have declared data non grata, they could get deleted by a cron job
every so often.

Let me know how your experiment turns out!

Make a backup!

Jon.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum