[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: where is my disk space



tomás, on 2019-08-04:
> On Sun, Aug 04, 2019 at 08:32:00AM +0000, Long Wind wrote:
> > i have stretch at sda2, which has 9.8G
> > free space is far more than 1 G
> > but some program i'm unware of take all space
> >
> > how to find out and solve? Thanks!
>
> Your request is too general for a meaningful answer.
>
> First off, space on a file system is taken up by "files". If you want
> to find out where the space is missing, "du" is a good command.
>
> Files live on file systems, so "sda2" (the device) is pretty meaningless
> in this context [1]. Let's assume /dev/sda2 is mounted on / -- then
>
>   sudo du -sh /*
>
> will give you, directory for directory, where the space goes (the option
> "-s" says "summary", the option "-h" is for "human readable" (i.e. it
> would say "1.2G" instead of "1201345", for example).
>
> Then you can work your way down. May be you find a file you "know" and
> decide you can remove it. Maybe you aren't sure -- then the next step
> would be to find out which program is generating those files.
>
> There are many details I left off, but you'd have to be more specific
> if you want more specific help.

Good day Long Wind,

In complement to the advice from tomás about using "du", if you
have a bit of space left, you can install "ncdu" and use it to
identify which directory takes all the space:

	$ sudo apt install ncdu

To scan your root file system, assuming it is the mount point of
your /dev/sda2, for instance you could run the following
command, give some time to the command for proceeding to the
scan, and navigate in your file system tree, sorted by disk
usage:

	$ sudo ncdu -x /

Note the "-x" switch, which will avoid to cross file system
mount points, this is useful for instance to /not/ scan
directories such as /proc or /sys, which are not stored on disk
but in memory, and generally it avoids to scan files which are
not members of the partition.  The "du" command also accepts
this option, by the way, but is a bit tricky to use when
scanning /* as one would have to exclude explicitly mount points
such as /sys, /proc and /dev with several --exclude= options.

Kind Regards
-- 
Étienne Mollier <etienne.mollier@mailoo.org>
               5ab1 4edf 63bb ccff 8b54 2fa9 59da 56fe fff3 882d


Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: