Differences between revisions 41 and 42
Revision 41 as of 2010-09-25 10:53:20
Size: 6725
Editor: ?wekt
Comment:
Revision 42 as of 2010-09-25 11:05:53
Size: 6320
Editor: ?wekt
Comment:
Deletions are marked like this. Additions are marked like this.
Line 117: Line 117:
 * DebianPkg:popularity-contest Requires file system option strictatime. run {{{ popularity-contest | sort > popcon }}}
Line 134: Line 135:
You might consider running {{{ dpkg -l }}} periodically and manually going through it to see if there are packages which you never use. Alternately you can install the package popularity-contest and run {{{ popularity-contest | sort > popcon }}} This will list the packages in least-used order in a text file called ~/popcon. Then to actually remove some unwanted/unused package you can do {{{ aptitude purge -s <unwanted package> }}} to simulate the process and see what else is affected. You can answer yes to seemingly drastic removals because the {{{ -s }}} makes it simulate and report, not actually execute. Once you are happy with the consequences do {{{ aptitude purge <unused package> }}} and aptitude will still tell you what it's doing and what dependencies are affected, but when you say Yes, it will actually execute the removal. == Compressed File Systems ==
Line 136: Line 137:
Using a compressed filesystem can save a lot of space. Typically squashfs reduces space used by about 50%, but it is read-only. === Application Level / User Space ===
 * GVFS Zip format archives can be mounted by GVFS.
 * DebianPkg:fuse-utils There are many file systems which offer compression and operate through FUSE.
Line 138: Line 141:
If you have a read-only source like a DVD, an overlaid unifying file system like [[http://aufs.sourceforge.net/|aufs]] or Linux's "union mount" can save changes in a writeable filesystem, saving the user the space of the unchanged portions. The same could be accomplished with a snapshotted filesystem as with Linux Volume Manager (lvm2). === In Linux ===
 * squashfs read-only

==== Not ready for general use ====
The development level of these file systems is such that they are not yet usable for general purpose.
 * Reiser4FS
 * BTrFS
Line 150: Line 159:
If you have a read-only source like a write once optical disk, an overlaid unifying file system like [[http://aufs.sourceforge.net/|aufs]] or Linux's "union mount" can save changes in a writeable filesystem, saving the user the space of the unchanged portions. The same could be accomplished with a snapshotted filesystem as with Linux Volume Manager (lvm2).

Translation Deutsch

Freeing Disk Space

Disk Usage or Occupied Space

To determine degree of usage of disks and partitions see DiskFull .

Command line tools to see seldom used files

These will not function if file systems are not usually mounted without option strictatime.

/usr/bin/find

The following options are of special interest

  • -usage
  • -atime

See which packages are using the most disk space

Command line

  • kernel packages are large older versions are not removed automatically for your safety

To list packages that take up most of the disk space with aptitude into visual mode, select Views → New Flat Package List (this menu entry is available only after etch version), press l and enter ~i, press S and enter ~installsize, then it will give you nice list to work with. Doing this after upgrading aptitude should give you access to this new feature.

In lenny, aptitude has "why" and "why-not".

 aptitude why package1 

shows why package1 may have been installed.

 aptitude why package1 package2 

tries to work out why installing package1 would drag in package2.

"why-not" looks at conflicts.

These commands only provide one possible explanation. Check /var/log/aptitude for definitive information.

Using aptitude to list uninstalled recommended or suggested packages:

aptitude search '~RBsuggests:~i!~i'

To list upgradeable packages:

aptitude search '~U'

To list manually installed packages:

aptitude search '~i!~M'

To install without recommends but not uninstalling other recommends:

aptitude install -R -o Aptitude::Keep-Recommends=true

To list packages in increasing order of size:

aptitude -F '%I %p' search '~i'|egrep '^[0-9]+[\.,]?[0-9]*[MG]B'|sort -n

Using dpigs (debian-goodies):

dpigs -n50

Using wajig :

wajig size

sorts installed packages by size:

dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -n

Graphical Interface

synaptic, go to installed packages and click on the size column.

Tools to see which directories are using the most disk space

baobab in package gnome-utils

Command line program du of package coreutils

/usr/bin/du --total --summarize --human-readable --one-file-system

Find things to erase

Categorically Expendable Directories

Temporary

/tmp
/var/tmp

Contents of these directories are only intended to be used in the short term or while a program is running and are generally expendable.

Logs

/var/log

Cache

  • packages in /var/cache/apt/archives usually eats some space. As root or using sudo, you can get rid of them with:

apt-get clean

or

aptitude clean

Use apt-get autoclean if you want to remove old packages for which you also have the last package.

Spool

Things in

/var/spool

are intended to be processed but may be expendable.

Tools

Duplicate Handling

When you find duplicates, you can hard link them, if they are on the same file system, or erase duplicates to make them unique.

Finders

files you do not want

packages you do not want

  • debfoster

  • deborphan The textual user interface is provided by the program orphaner.

  • popularity-contest Requires file system option strictatime. run  popularity-contest | sort > popcon 

Tools to alter files to reduce them

Stripping dbus-daemon exposes a bug in BFD. Executing in find /usr/bin -not -name strip -and -not -name dbus-daemon -execdir strip --strip-unneeded '{}' \;  reduced the size of contents of the directory in a Squeeze installation from 140MB to 120MB.

Do not compress bash or your scripts will crash. Compressed executables may require more memory when run.

Reduce data creation

Use the following line as your /etc/rsyslog.conf configuration file in order to not save logs but output them on virtual terminal 12:

  • *.* -/dev/tty12

On systems that have been running for some time you might consider stripping out old log files.

Note that localepurge is a package that will strip unwanted language versions from everything you install. If you want a new language in the future you will have to add the locale and then re-install the package.

Compressed File Systems

Application Level / User Space

  • GVFS Zip format archives can be mounted by GVFS.
  • fuse-utils There are many file systems which offer compression and operate through FUSE.

In Linux

  • squashfs read-only

Not ready for general use

The development level of these file systems is such that they are not yet usable for general purpose.

  • Reiser4FS
  • BTrFS

Turn Off Reserved Blocks on ExtFS

By default, ExtFS reserves 5% of the file system for the user 'root' as a safety measure. To turn this off:

tune2fs -r 0 /dev/sda2

This can be done on a mounted filesystem.

Off Line Storage

You may move data to off line storage, such as removable optical disks or disks on an external data bus (such as Firewire or USB).

If you have a read-only source like a write once optical disk, an overlaid unifying file system like aufs or Linux's "union mount" can save changes in a writeable filesystem, saving the user the space of the unchanged portions. The same could be accomplished with a snapshotted filesystem as with Linux Volume Manager (lvm2).

Wish list:

  • media compressions.

  • free space disk control like df

  • using Quota as usrquota groupquota waringquota in quota