You are not logged in.

#1 2018-04-08 16:51:25

linusvanpelt
Member
From: Sydney, Australia
Registered: 2017-04-12
Posts: 12

[SOLVED] df showing incorrect size

I've Googled at length and searched the forums before posting.  If I missed something obvious my apologies.

Background:

  • 1TB SSD

  • ~ 800GB partition LUKS encrypted

  • LVM with partitions for Root/Home/Data.

  • The Data partition is the one with the issue

lvdisplay /dev/mapper/vg00-Data 
  --- Logical volume ---
  LV Path                /dev/vg00/Data
  LV Name                Data
  VG Name                vg00
  LV UUID                mcrUej-LtNu-xJ18-zf1l-eI60-835Q-NoF7Oe
  LV Write Access        read/write
  LV Creation host, time arch, 2017-02-23 22:30:47 +1100
  LV Status              available
  # open                 1
  LV Size                <717.62 GiB
  Current LE             183710
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:3

From /etc/fstab:

# /dev/mapper/vg00-Data
UUID=f2d0552a-9678-4a1c-bc52-2c071262c0f6	/data     	ext4      	rw,relatime,data=ordered	0 2

(As an aside, am I missing mount options that I should be using with an SSD?)

The volume was filling up, so I copied over 100GB to an external hard drive and deleted the files (KVM images)

However, I'm getting this:

df -h /data
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/vg00-Data  706G  669G  1.5G 100% /data

I've run lsof | grep deleted, fsck, and rebooted.

Last edited by linusvanpelt (2018-04-24 22:25:59)

Offline

#2 2018-04-08 20:11:55

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] df showing incorrect size

By default ext filesystems reserve 5% of the available blocks for roots use only (to prevent runaway user processes filling up your root partition) meaning that around 35GB of your disk is currently unusable. This can be changed using tune2fs.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2018-04-08 23:06:24

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [SOLVED] df showing incorrect size

linusvanpelt wrote:

However, I'm getting this:

df -h /data
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/vg00-Data  706G  669G  1.5G 100% /data

Firstly, please use code tags to format your posts.

Second, what do you expect the output to be?

Offline

#4 2018-04-09 00:12:40

NoSuck
Member
Registered: 2015-03-04
Posts: 157
Website

Re: [SOLVED] df showing incorrect size

So the problem is that you deleted ~100 GB of files, yet df only shows ~37 GB of free space?  If so, the deleted files were either sparse or hard links with multiple references.  Or the sky is falling.  Try running fstrim to be sure.

Offline

#5 2018-04-12 21:20:21

linusvanpelt
Member
From: Sydney, Australia
Registered: 2017-04-12
Posts: 12

Re: [SOLVED] df showing incorrect size

Firstly, please use code tags to format your posts.

Ok, thanks.  Although I will comment that other forum software makes it much easier to do so, and makes the functionality more apparent.  But, I'll bookmark that separate URL, and reference it the next time I post (and embed code).

Offline

#6 2018-04-12 21:26:06

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] df showing incorrect size

The link is right below the edit box... the difference between this and other forums is this one does not have a javascript toolbar for inserting the bbcode.

Last edited by eschwartz (2018-04-12 21:27:19)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2018-04-12 21:41:49

linusvanpelt
Member
From: Sydney, Australia
Registered: 2017-04-12
Posts: 12

Re: [SOLVED] df showing incorrect size

NoSuck wrote:

So the problem is that you deleted ~100 GB of files, yet df only shows ~37 GB of free space?  If so, the deleted files were either sparse or hard links with multiple references.  Or the sky is falling.  Try running fstrim to be sure.

Sorry for the late reply, I was at a conference sucking up all my free time.

I'm sure the sky was falling. 

But, in case it wasn't, I think the files may have been sparse?  They were all .qcow2 files I don't currently need.  (TBH I never got QEMU/KVM working but that's a topic for another day).

I looked on my backup drive, and those files were:

genesis% du -h *.qcow2
21G	Antergos.qcow2
51G	Fedora.qcow2
51G	Mint.qcow2
genesis% du -h --apparent-size *.qcow2
21G	Antergos.qcow2
51G	Fedora.qcow2
51G	Mint.qcow2

Although --apparent-size didn't make any difference, the probability that both Fedora and Mint are the exact same size is remote.  I'm guessing QEMU/qcow2 allocates the entire disk rather than dynamically increasing the virtual disk size as required. 

fstrim didn't make any difference.

I did read Sparse but I'm still fuzzy on why the file system thinks the files are ~130GB, but I only got ~37GB after deleting those files.  Hopefully Google and more reading will enlighten me.

Offline

#8 2018-04-12 21:44:16

linusvanpelt
Member
From: Sydney, Australia
Registered: 2017-04-12
Posts: 12

Re: [SOLVED] df showing incorrect size

Eschwartz wrote:

The link is right below the edit box... the difference between this and other forums is this one does not have a javascript toolbar for inserting the bbcode.

Thanks, I now know that code tags == BBCode.  I'll also edit my OP for those who may read this thread in the future.

Edit:  But I wonder how many web developers hand code their HTML/CSS/etc. tags?  Or do they use a s/w tool to make it easier and faster?  Calling a spade a spade, editing my original post was a PITA, taking longer than it should have had I been able to highlight text and click a button.

Last edited by linusvanpelt (2018-04-12 21:53:18)

Offline

#9 2018-04-13 06:54:02

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,360

Re: [SOLVED] df showing incorrect size

linusvanpelt wrote:

Edit:  But I wonder how many web developers hand code their HTML/CSS/etc. tags?  Or do they use a s/w tool to make it easier and faster?  Calling a spade a spade, editing my original post was a PITA, taking longer than it should have had I been able to highlight text and click a button.

More than you would expect, especially in this distribution.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#10 2018-04-13 12:14:13

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,254

Re: [SOLVED] df showing incorrect size

Real pros use frontpage, though ;-P


qcow2 files are incredibly prone to be sparse and of lower actual size. You could load (or just mount) the images and "du" them, if the accumulated size is about 37GB (or less, depending on the free space you had before), there's your answer.

Offline

Board footer

Powered by FluxBB