LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-14-2016, 01:43 PM   #1
mozer
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)
Quote:
Physical volume "/dev/sdc" successfully created
vgcreate vg_test /dev/sdc
Quote:
Volume group "vg_test" successfully created
lvcreate -n lv_test -l 100%FREE vg_test
Quote:
Logical volume "lv_test" created
Quote:
root@debian:~# pvs
PV VG Fmt Attr PSize PFree
/dev/sdc vg_test lvm2 a-- 275.00g 0
Quote:
root@debian:~# vgs
VG #PV #LV #SN Attr VSize VFree
vg_test 1 1 0 wz--n- 275.00g 0
Quote:
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

Cheers!!

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

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

Code:
 df |grep home
/dev/mapper/vg_ntt2-lv_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
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,513

Rep: Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693
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
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,279

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
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
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,672

Rep: Reputation: 1257Reputation: 1257Reputation: 1257Reputation: 1257Reputation: 1257Reputation: 1257Reputation: 1257Reputation: 1257Reputation: 1257
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.
 
  


Reply

Tags
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 0 08-14-2011 11:43 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


All times are GMT -5. The time now is 11:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration