Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-14-2016, 01:43 PM   #1
LQ Newbie
Registered: Sep 2013
Posts: 17

Rep: Reputation: Disabled
Smile Losing 4Gb on Debian LVM?

Hello all,

I'm creating LVM in the following way,

pvcreate /dev/sdc (a virtual disk of 275G)
Physical volume "/dev/sdc" successfully created
vgcreate vg_test /dev/sdc
Volume group "vg_test" successfully created
lvcreate -n lv_test -l 100%FREE vg_test
Logical volume "lv_test" created
root@debian:~# pvs
PV VG Fmt Attr PSize PFree
/dev/sdc vg_test lvm2 a-- 275.00g 0
root@debian:~# vgs
VG #PV #LV #SN Attr VSize VFree
vg_test 1 1 0 wz--n- 275.00g 0
root@debian:~# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv_test vg_test -wi-a----- 275.00g
Then i proceed to create an ext4 fs

mkfs.ext4 /dev/mapper/vg_test-lv_test (everything OK)

and when i mount it...

/dev/mapper/vg_test-lv_test 271G 63M 257G 1% /mnt

Why do i loose 4 GB in the process? is this normal? 4 GB?

It's a LOT of space...

I tried creating a partition of 275GB with the same results..I'm just confused


Last edited by mozer; 07-14-2016 at 01:45 PM.
Old 07-14-2016, 01:57 PM   #2
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,775

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
df shows space available to non-privileged users. The default is to reserve some space for privileged use. For example:

 df |grep home
                     205261560  27068952 167742896  14% /home
sudo tune2fs -l /dev/mapper/vg_ntt2-lv_home |grep 'lock count:'
Block count:              52166656
Reserved block count:     2608332
1 members found this post helpful.
Old 07-14-2016, 02:18 PM   #3
Registered: Aug 2002
Posts: 15,925

Rep: Reputation: 1824Reputation: 1824Reputation: 1824Reputation: 1824Reputation: 1824Reputation: 1824Reputation: 1824Reputation: 1824Reputation: 1824Reputation: 1824Reputation: 1824
To elaborate on the above 5% is reserved for root when ext2/3/4 filesystems are created. That 5% is not included in the output of the df command so the numbers do not add up. 5% is 13GB.

The difference in the logical volume size versus filesystem size is overhead i.e. metadata. 1.5-2% for ext4 if I remember correctly is normal.
Old 07-14-2016, 06:53 PM   #4
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,721

Rep: Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120
And for a data filesystem, the reserved is pointless - set it to zero using tune2fs.
Note if you plan on running the filesystem really full (95% say) all the time and actively adding/deleting files (all the time) maybe you need some reserved. Never needed to in real life.
Old 07-14-2016, 07:22 PM   #5
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,702

Rep: Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270
You also loose space to support the inode list, block allocation maps, and the journal.

These are necessary to manage files in the filesystem and recover from system crashes/power failures.


debian, lvm

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Problem with LVM mirror and failed PV, can't recover -- Debian Squeeze lvm 2.02.66-5 Linux Ninja Linux - Server 2 06-02-2017 04:50 PM
upgrade system with lvm on software raid-1 data volume w/o losing data BinWondrin Linux - General 1 01-13-2009 03:25 PM
512mb from 4Gb is not recognized on Debian brgsousa Linux - Newbie 10 09-18-2008 06:46 PM
4GB on 32-bit Debian? sycamorex Debian 6 07-03-2007 11:52 AM
LVM without losing data daihard Linux - Software 12 05-28-2007 01:27 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:26 AM.

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