Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
04-29-2022, 10:39 PM
|
#1
|
Member
Registered: Feb 2002
Location: NZ
Distribution: Kubuntu, Mint
Posts: 411
Rep:
|
Partition full, but files make up only half partition size
I have a partition which gparted reports is 228GB with 1.5GB free
Using the Disk usage app in Linux Mint 20.3, the files total only 118.8GB, which I believe to be the true size.
Running e2fsck I get:
Code:
mint@mint:~$ sudo e2fsck -f /dev/sda2
e2fsck 1.45.5 (07-Jan-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda2: 631943/14942208 files (0.6% non-contiguous), 56405689/59767552 blocks
Where do I go from here?
|
|
|
04-29-2022, 11:01 PM
|
#2
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,384
|
Start by showing relevant info. This will get us started. Partitons ain't filesystems although they are inextricably inked.
|
|
1 members found this post helpful.
|
04-29-2022, 11:30 PM
|
#3
|
Member
Registered: Feb 2002
Location: NZ
Distribution: Kubuntu, Mint
Posts: 411
Original Poster
Rep:
|
Thank you syg00
Code:
chris@chris-H61M-USB3-B3:~$ df -hT
df: /run/user/1000/doc: Operation not permitted
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs tmpfs 385M 1.4M 384M 1% /run
/dev/sda2 ext4 224G 211G 2.1G 100% /
tmpfs tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
tmpfs tmpfs 385M 16K 385M 1% /run/user/1000
/dev/sdf1 vfat 1.9G 24M 1.9G 2% /media/chris/ADATA-2GB
chris@chris-H61M-USB3-B3:~$
Code:
chris@chris-H61M-USB3-B3:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 232.9G 0 disk
├─sda2 8:2 0 228G 0 part /
└─sda3 8:3 0 4.9G 0 part [SWAP]
sdf 8:80 1 1.9G 0 disk
└─sdf1 8:81 1 1.9G 0 part /media/chris/ADATA-2GB
sr0 11:0 1 1024M 0 rom
chris@chris-H61M-USB3-B3:~$
|
|
|
04-30-2022, 01:17 AM
|
#4
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,253
|
Code:
/dev/sda2 ext4 224G 211G 2.1G 100% /
It is full (obviously). That disk usage app might miss something, I don't really know, but df cannot lie.
You can use some tools to find out what is it, for example ncdu. But do it as root and without gui. Don't forget about hidden (dotted) files/dirs.
|
|
|
04-30-2022, 01:53 AM
|
#5
|
Member
Registered: Feb 2002
Location: NZ
Distribution: Kubuntu, Mint
Posts: 411
Original Poster
Rep:
|
It is full (obviously). ??
Running ncdu:
Quote:
Total disk usage: 100.5 GiB Apparent size: 100.3 GiB Items: 118993
|
|
|
|
04-30-2022, 02:54 AM
|
#6
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,253
|
yes, ncdu missed again some files. Most probably those hidden files. But without details hard to say more.
|
|
|
04-30-2022, 03:15 AM
|
#7
|
Member
Registered: Jan 2022
Location: Earth
Distribution: Debian
Posts: 249
Rep: 
|
Or it could be that there is a large file that was created and deleted, but is still in use by some process. So while the file is marked as deleted it is still there on the filesystem using space till the process is terminated. I have seen this in the past and it was a pain to debug. One option is to reboot and see if the space is still being used.
Another thing to do is to perform a filesystem check on the partition. The simplest way to force fsck filesystem check on a root partition is to create an empty file called forcefsck in the partition's root directory and rebooting. It will force a check on the partition.
|
|
|
04-30-2022, 03:34 AM
|
#8
|
Member
Registered: Feb 2002
Location: NZ
Distribution: Kubuntu, Mint
Posts: 411
Original Poster
Rep:
|
Quote:
yes, ncdu missed again some files. Most probably those hidden files. But without details hard to say more.
|
This is the ncdu output:
Quote:
100.5 GiB [##########] /home
7.7 GiB [ ] /usr
. 918.7 MiB [ ] /var
722.9 MiB [ ] /opt
310.7 MiB [ ] /boot
. 23.8 MiB [ ] /media
. 13.2 MiB [ ] /etc
. 1.4 MiB [ ] /run
. 64.0 KiB [ ] /tmp
! 16.0 KiB [ ] /lost+found
e 4.0 KiB [ ] /srv
! 4.0 KiB [ ] /root
e 4.0 KiB [ ] /mnt
e 4.0 KiB [ ] /cdrom
. 0.0 B [ ] /proc
. 0.0 B [ ] /sys
0.0 B [ ] /dev
@ 0.0 B [ ] libx32
@ 0.0 B [ ] lib64
@ 0.0 B [ ] lib32
@ 0.0 B [ ] sbin
@ 0.0 B [ ] lib
@ 0.0 B [ ] bin
Total disk usage: 110.2 GiB Apparent size: 109.8 GiB Items: 717576
|
It is hard to imagine there could be 100GB hidden files. It's an ext4 file system. How do we find them?
|
|
|
04-30-2022, 03:42 AM
|
#9
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,253
|
Quote:
Originally Posted by Johng
This is the ncdu output:
It is hard to imagine there could be 100GB hidden files. It's an ext4 file system. How do we find them?
|
based on post #7 (if you have a file [or more] which is already deleted but still kept by a process) you only need to reboot.
should display everything on your root partition, which is not [yet] deleted.
|
|
|
04-30-2022, 05:01 AM
|
#10
|
Member
Registered: Feb 2002
Location: NZ
Distribution: Kubuntu, Mint
Posts: 411
Original Poster
Rep:
|
Code:
ncdu -x /
100.9 GiB [##########] /media
100.5 GiB [######### ] /home
7.7 GiB [ ] /usr
927.6 MiB [ ] /var
722.9 MiB [ ] /opt
310.7 MiB [ ] /boot
20.8 MiB [ ] /root
13.3 MiB [ ] /etc
88.0 KiB [ ] /tmp
e 16.0 KiB [ ] /lost+found
e 4.0 KiB [ ] /srv
e 4.0 KiB [ ] /mnt
e 4.0 KiB [ ] /cdrom
@ 0.0 B [ ] libx32
@ 0.0 B [ ] lib64
@ 0.0 B [ ] lib32
@ 0.0 B [ ] sbin
@ 0.0 B [ ] lib
@ 0.0 B [ ] bin
> 0.0 B [ ] /sys
> 0.0 B [ ] /run
> 0.0 B [ ] /proc
> 0.0 B [ ] /dev
Total disk usage: 211.0 GiB Apparent size: 210.6 GiB Items: 635346
As shown above, the file in /media was the problem.
The computer is not mine. I now suspect the owner plugged in an external USB drive, and did not un-mount it!
Thank you for your help.
On an aside (breaking the rules) when an external drive is mounted at /media, does rsync treat the mount as a symlink?
|
|
|
04-30-2022, 05:08 AM
|
#11
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,253
|
Quote:
Originally Posted by Johng
Code:
ncdu -x /
100.9 GiB [##########] /media
100.5 GiB [######### ] /home
Total disk usage: 211.0 GiB Apparent size: 210.6 GiB Items: 635346
As shown above, the file in /media was the problem.
|
it looks like.
Quote:
Originally Posted by Johng
The computer is not mine. I now suspect the owner plugged in an external USB drive, and did not un-mount it!
|
No, it looks like the owner copied files into /media on the local disk instead of mounting USB and copying files onto that usb stick.
Quote:
Originally Posted by Johng
On an aside (breaking the rules) when an external drive is mounted at /media, does rsync treat the mount as a symlink?
|
rsync or any other tool has no any idea what is really located at /media (If it was a local dir, a mount point or whatever), it will just use that.
|
|
|
04-30-2022, 03:04 PM
|
#12
|
Senior Member
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: KDE Neon
Posts: 1,271
|
If I remember correctly, when a USB drive is automounted it creates a new directory in /media with the users name, and then makes another in that with the device name.
So it does seem that files were copied into /media and took up space on the drive.
|
|
|
04-30-2022, 06:54 PM
|
#13
|
Senior Member
Registered: Aug 2016
Posts: 3,345
|
Remember one thing about directories that are used as mount points. If files are in that directory then something is mounted on that directory / mount point, the content is hidden and inaccessible even though it takes up space on the file system.
Except in rare cases and done deliberately a user should not put content into a directory used as a mount point. Especially a user should avoid /mnt, /media and /run/media since those are often used mount points.
|
|
|
05-01-2022, 02:09 AM
|
#14
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,253
|
Quote:
Originally Posted by computersavvy
Remember one thing about directories that are used as mount points. If files are in that directory then something is mounted on that directory / mount point, the content is hidden and inaccessible even though it takes up space on the file system.
Except in rare cases and done deliberately a user should not put content into a directory used as a mount point. Especially a user should avoid /mnt, /media and /run/media since those are often used mount points.
|
That is the typical case, when you have no idea if /media is mounted or not. So you will copy a lot of files onto it and surprisingly they cannot be found on the usb.
But next time you mount it successfully you will not find it in /media too (because as you wrote the local content is hidden).
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 08:03 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|