You are not logged in.

#1 2012-03-12 23:21:08

mathfeel
Member
Registered: 2010-05-08
Posts: 36

LVM2 overhead?

I just installed a system on LVM2. It seems to be working. But then when I check the spaces:

# df -h
Filesystem                 Size  Used Avail Use% Mounted on
rootfs                     5.0G  3.8G  1.1G  79% /
/dev                       2.0G     0  2.0G   0% /dev
/run                       2.0G  288K  2.0G   1% /run
/dev/mapper/VGK210-ROOT    5.0G  3.8G  1.1G  79% /
shm                        2.0G  248K  2.0G   1% /dev/shm
/dev/mapper/VGK210-BOOT    497M   43M  430M  10% /boot
/dev/mapper/VGK210-HOME     50G  890M   47G   2% /home
/dev/mapper/VGK210-VAR     5.0G  993M  3.8G  21% /var
tmpfs                      2.0G   52K  2.0G   1% /tmp
/dev/mapper/VGK210-EXPORT  100G  1.7G   94G   2% /export

I noted that /home and /export already have almost 1G and 1.7G used, respectively. This is a new install. /home is almost empty and I just mkfs.ext4-ed /export.

]# du -sh /home /export
12M	/home
20K	/export

Why is there so much space in used already?


Cheers!

M

Offline

#2 2012-03-13 00:52:13

Ashren
Member
From: Denmark
Registered: 2007-06-13
Posts: 1,229
Website

Re: LVM2 overhead?

When creating filesystems with ext4 5% of the filesystem is reserved for the super-user.

From the mkfs.ext4 man page:

       -m reserved-blocks-percentage
              Specify  the  percentage  of the filesystem blocks reserved for the super-user.  This avoids fragmenta‐
              tion, and allows root-owned daemons, such as syslogd(8), to continue to function correctly  after  non-
              privileged processes are prevented from writing to the filesystem.  The default percentage is 5%.

When creating big filesystems you can safely set this variable lower than 5%.

Offline

#3 2012-03-13 08:30:09

Silvah
Guest

Re: LVM2 overhead?

That's the size of the filesystem metadata created when formatting, such as the inode table. Nothing to do with LVM, but rather with ext filesystem family.

#4 2012-03-13 08:56:40

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: LVM2 overhead?

You can change the number of inodes (at formating time only) if you think you're going to write big files to the partition:

sudo mkfs.ext4 -i 262144 /dev/sdbX

The reserved blocks percentage can be changed after formating, with tune2fs.

Offline

#5 2012-03-15 08:39:03

mathfeel
Member
Registered: 2010-05-08
Posts: 36

Re: LVM2 overhead?

This partition is mean to host my media files for sharing. So mp3/flac's of a few MB and movies of a 0.5-4 GB each. What would be a good amount to set this parameter to?

Thanks.


Cheers!

M

Offline

#6 2012-03-15 10:32:18

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: LVM2 overhead?

It's hard to answer without seeing your files collection, but if you're not going to have any file smaller than 1MB, it should be safe to use just that: "-i 1048576".

You could also use "-T largefile" which might be preferable because it also affects block size, but I haven't tried it. See /etc/mke2fs.conf, "man mke2fs.conf" and "man mke2fs" for more information...

You can use "df -i" to see current inodes usage.

Offline

#7 2012-03-15 12:26:08

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: LVM2 overhead?

stqn wrote:

It's hard to answer without seeing your files collection, but if you're not going to have any file smaller than 1MB, it should be safe to use just that: "-i 1048576".

You could also use "-T largefile" which might be preferable because it also affects block size, but I haven't tried it. See /etc/mke2fs.conf, "man mke2fs.conf" and "man mke2fs" for more information...

You can use "df -i" to see current inodes usage.

-T largefile can have a _really bad_ effect on space usage if you have a lot of small files btw, so use with care.

Also I suggest watching this: http://www.youtube.com/watch?v=FegjLbCnoBw


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB