LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 12-07-2018, 12:28 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
root partition 97% full.


Hi: I have the root partition 97% full. But when I installed the O.S. it took much less space. So I want to delete/transfer some files. The question is what files? I would use du to see the directory that is taking a significant part of the disk. But in what way? I cannot begin
Code:
du -hs /
Actually I would begin by determining which files take more than 1 GB. But how do I do this?

I could do
Code:
ls -lR
and have a script that tells me when the file takes more than 1GB. Of course the script would have to scan the output of ls. Is there a simple way to achieve this?

I discovered this:
Code:
root@darkstar/home/bill/.local/share# du -h -d1 .
72K	./xorg
168K	./okular
12K	./autojump
16K	./kxmlgui5
4.5G	./Trash
4.5G	.
What is this Trash directory?

Last edited by stf92; 12-07-2018 at 12:37 PM.
 
Old 12-07-2018, 01:00 PM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Trash is where things you delete get moved to like in windows.

You could use 'df' to see how much space is used and available on your mount points:

Code:
/ $ \df -h
Filesystem                           Size  Used Avail Use% Mounted on
/dev/mapper/centos_us19netdt01-root   50G  3.8G   47G   8% /
devtmpfs                             3.8G     0  3.8G   0% /dev
tmpfs                                3.8G     0  3.8G   0% /dev/shm
tmpfs                                3.8G   49M  3.7G   2% /run
tmpfs                                3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/sda1                           1014M  228M  787M  23% /boot
/dev/mapper/centos_us19netdt01-home  407G  207M  407G   1% /home
tmpfs                                3.8G  5.5M  3.8G   1% /opt/omd/sites/eurofins/tmp
tmpfs                                765M     0  765M   0% /run/user/1000
Once you know which mount point is using the most space you can move to that directory and figure out what is using so much space.

You will notice that my root partition is separate from the other partitions in the Mounted On column. You claim that root is almost full, 97%, but you are looking at your home directory above. If home and root are mounted separately then clearing the Trash folder is not going to help you with your root being full.

Go back and use the df command on the root level to see what is being used where.
 
Old 12-07-2018, 01:14 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
I have everything (the OS) mounted on a single point. In Trash I found a lot of movies, which take a lot of space. I proceeded to deleted Trash and now df gives 64% full instead of 97%. This leaves me with
Code:
root@darkstar/# du -h -d1
7.0M	./etc
12K	./srv
du: cannot access './proc/3745/task/3745/fd/4': No such file or directory
du: cannot access './proc/3745/task/3745/fdinfo/4': No such file or directory
du: cannot access './proc/3745/fd/3': No such file or directory
du: cannot access './proc/3745/fdinfo/3': No such file or directory
0	./proc
54M	./boot
792K	./run
4.0K	./opt
3.1G	./usr
3.9G	./almacen
1.5G	./home
4.0K	./juan
4.0K	./mnt
4.0K	./debian
0	./sys
2.1G	./root
12K	./tmp
0	./dev
16K	./lost+found
4.0K	./pasaje
2.2G	./var
13G	.
root@darkstar/#
Why 2.2G in /var? /almacen is a separate partition.

Last edited by stf92; 12-07-2018 at 01:15 PM.
 
Old 12-07-2018, 01:30 PM   #4
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Can you run df from root?
 
Old 12-07-2018, 02:04 PM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Code:
root@darkstar~# df -h
Filesystem      Size  Used Avail Use% Mounted on
dev             952M     0  952M   0% /dev
run             958M  796K  957M   1% /run
/dev/mmcblk0p1   15G  8.8G  5.0G  65% /
tmpfs           958M   65M  893M   7% /dev/shm
tmpfs           958M     0  958M   0% /sys/fs/cgroup
tmpfs           958M  8.1M  950M   1% /tmp
/dev/mmcblk0p2   14G  3.9G  8.9G  31% /almacen
tmpfs           192M     0  192M   0% /run/user/0
tmpfs           192M  4.0K  192M   1% /run/user/1000
root@darkstar~#
 
Old 12-07-2018, 11:54 PM   #6
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Looks like you found more fluff to delete on the root directory. If you don't mind telling what distro is this that placed everything on the root?
 
Old 12-08-2018, 06:14 AM   #7
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Thumbs up

It is Arch Linux. Please notice I said the root partition is nearly full, not the root directory. Actually the problem can be stated in more general terms: partition part_foo is nearly full and I want to delete unnecesary files lying in that partition. Asuming part_foo is mounted in directory /dir_foo, how to discover files under /dir_foo that occupy more than 1 GB? This won't be answered by df, but either du or ls look like ideal tools for the job. And how to automate the procedure.

A question: Do you call / the root directory?

Arch does not have an installer. You yourself do all things an installer normally does. The first thing you do after given a prompt by the iso image is to run wifi-menu in order to get connected to the web. Then
Code:
    # timedatectl set-ntp true
    # mount /dev/mmcblk01 /mnt
    # pacstrap /mnt base
    # genfstab -U /mnt >> /mnt/etc/fstab
    
    # arch-chroot /mnt
where /dev/mmcblk01 is the root partition, followed by other stuff. However in the Arch circles they speak about the installer, a thing I don't understand.

I know who is the one that placed those audio and video files in .../Trash. It is Transmission, a program to manipulate torrents. Maybe I choose 'Remove torrent and delete files'. And judging by the result he puts everything in .local/.../Trash.

One procedure to follow when df says / is nearly full if to erase all hidden files in the home directory and run df again to see the result, it seems.

A further question: I did 'rm -r ~/.local/share/Trash'. Will the Trash directory get regenerated again? I mean, perhaps I should have done 'rm -r ~/.local/share/Trash/*'.

Last edited by stf92; 12-08-2018 at 06:50 AM.
 
Old 12-08-2018, 10:05 AM   #8
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,362

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
What is the output of parted -l
 
Old 12-08-2018, 10:15 AM   #9
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Code:
root@darkstar~# parted -l
Model: MMC S10032 (sd/mmc)
Disk /dev/mmcblk0: 30.6GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  16.0GB  16.0GB  primary  ext2
 2      16.0GB  30.6GB  14.6GB  primary  ext2


Error: /dev/mmcblk0boot0: unrecognised disk label
Warning: Error fsyncing/closing /dev/mmcblk0boot0: Input/output error
Retry/Ignore? i
This is quite new to me! cfdisk /dev/mmcblk0 does not complain at all.

Last edited by stf92; 12-08-2018 at 10:22 AM.
 
Old 12-08-2018, 10:39 AM   #10
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by stf92 View Post
Why 2.2G in /var?
/var is where all of the logfiles (and i.e. printer temporary files) go to.
Look again at /var/log and /var/spool, those are the most likely ones.
A command like
Code:
du -sm /var/*|sort -n
as root (there are a lot of dirs that are non-visible to normal users) will give you an idea of where the most diskspace is used.
 
Old 12-08-2018, 11:29 AM   #11
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
And what if I straightforwardly delete /var/log and /var/spool?
 
Old 12-08-2018, 10:25 PM   #12
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by stf92 View Post
It is Arch Linux. Please notice I said the root partition is nearly full, not the root directory.
Yes, sorry.

Quote:
Asuming part_foo is mounted in directory /dir_foo, how to discover files under /dir_foo that occupy more than 1 GB? This won't be answered by df, but either du or ls look like ideal tools for the job. And how to automate the procedure.
Via scripting.

Quote:
A question: Do you call / the root directory?
No '/' is root but '/root' is the root directory.

Quote:
Arch does not have an installer. You yourself do all things an installer normally does. The first thing you do after given a prompt by the iso image is to run wifi-menu in order to get connected to the web. Then
Code:
    # timedatectl set-ntp true
    # mount /dev/mmcblk01 /mnt
    # pacstrap /mnt base
    # genfstab -U /mnt >> /mnt/etc/fstab
    
    # arch-chroot /mnt
where /dev/mmcblk01 is the root partition, followed by other stuff.
Seems a bit backwards. I'd think the first thing any installation would have you do is partition the drive. It is here where you should make a root partition and at least a home partition.

Quote:
However in the Arch circles they speak about the installer, a thing I don't understand.

I know who is the one that placed those audio and video files in .../Trash. It is Transmission, a program to manipulate torrents. Maybe I choose 'Remove torrent and delete files'. And judging by the result he puts everything in .local/.../Trash.

One procedure to follow when df says / is nearly full if to erase all hidden files in the home directory and run df again to see the result, it seems.

A further question: I did 'rm -r ~/.local/share/Trash'. Will the Trash directory get regenerated again? I mean, perhaps I should have done 'rm -r ~/.local/share/Trash/*'.
I'd go with the second one to delete the files and leave the directory.
 
Old 12-09-2018, 03:54 AM   #13
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Exclamation

Quote:
Originally Posted by lazydog View Post
No '/' is root but '/root' is the root directory.
So we have three roots. The tree vertex, the root directory and a user called root. Thanks lazydog for your kind replies.
 
Old 12-09-2018, 06:38 AM   #14
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by stf92 View Post
So we have three roots. The tree vertex, the root directory and a user called root. Thanks lazydog for your kind replies.
To get the terminology right:
Code:
/ is the root _directory_ of the whole tree of a Linux system
/root is the home directory of the user "root"
and the one you were concerned about is the partition that has
been mounted on the / dir (and shown by df as /)
/dev/sda1        11160720    7945872   3101460  72% /
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Does Linux unmount the root partition when the partition is about 80% full? winger9 Linux - General 5 06-07-2014 04:46 AM
General Partitioning Limits: How full is too full to partition? orangesky Linux - Hardware 1 12-05-2009 06:27 PM
RHEL4 root directory says full but sum of use is nowhere near full. Why? SteveInTallyFL Linux - Server 11 02-05-2009 05:45 AM
root partition gets full when using cp -a on another partition timsch75 Linux - General 2 10-02-2005 06:41 AM
root files: create as root:root or root:wheel? pcass Linux - Security 1 02-07-2004 04:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 07:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration