LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 03-08-2010, 08:29 AM   #1
TheOneKEA
Member
 
Registered: Oct 2003
Distribution: Debian GNU/Linux 11 (amd64) w/kernel 6.0.15
Posts: 299

Rep: Reputation: 30
Question Best LVM2 volume group extent size for photo storage


I just finished setting up an LVM2 volume group with 128 MB extents, for the purposes of running a series of RAID 1-style LVM2 mirrored logical volumes. I was doing research online with Google and noted that increasing the extent size from the default of 4 MB works well for volume groups containing logical volumes with large files.

My camera currently shoots in RAW+JPEG, and since I set up the logical volume for the purpose of storing my photo collection (currently at 11 GB) I have dozens of 2 MB and 11 MB files in the logical volume (formatted with ext4). Is a volume group extent size of 128 MB too big/inefficient? Should I decrease it, or does the use of ext4 offset the large extent size?

Physical volumes:

Code:
  PV         VG              Fmt  Attr PSize   PFree   DevSize                            
  /dev/sda10 RAID_One_Mirror lvm2 a-   640.00M 512.00M 651.04M
  /dev/sdb   RAID_One_Mirror lvm2 a-   298.00G 234.00G 298.09G
  /dev/sdc   RAID_One_Mirror lvm2 a-   298.00G 234.00G 298.09G
Volume groups:

Code:
  VG              Attr   Ext     #PV #LV #SN VSize   VFree                               
  RAID_One_Mirror wz--n- 128.00M   3   1   0 596.62G 468.50G
Logical volumes:

Code:
  LV       VG              #Seg Attr   LSize  Maj Min KMaj KMin Origin Snap%  Move Copy%  Log           Convert
  Pictures RAID_One_Mirror    1 mwi-ao 64.00G  -1  -1 254  3                       100.00 Pictures_mlog
Relevant commands:

Code:
pvcreate --metadatacopies 2 /dev/sdb
pvcreate --metadatacopies 2 /dev/sdc
pvcreate --metadatacopies 2 /dev/sda10
vgcreate --addtag RAID1 --physicalextentsize 128 RAID_One_Mirror /dev/sda10 /dev/sdb /dev/sdc
lvcreate -L 64G -n Pictures -m 1 RAID_One_Mirror
mke2fs -L Pictures -m 0 -O large_file,dir_index,extent,uninit_bg,sparse_super -t ext4 /dev/mapper/RAID_One_Mirror-Pictures
 
Old 03-02-2012, 07:56 PM   #2
sirmonkey
Member
 
Registered: Dec 2004
Posts: 31

Rep: Reputation: 15
Two year bump... because this post comes up on alot of google searches...

what is the answer? I have no idea but I would like to know.
 
Old 03-06-2012, 02:20 PM   #3
ba.page
Member
 
Registered: Feb 2012
Location: Canada
Distribution: Scientific,Debian
Posts: 35

Rep: Reputation: 7
I don't believe the file size matters in choosing an extent size. you base your filesystem type on the size and volume of files you plan to use. ext4 will do fine for a ton of small files (yes, 11mb is small).

the physical extent (PE) matters in a different way.
A logical volume (LV) is limited to 65,536 PE.
so choosing a PE of 4MB (the default size in current kernels) limits your LV to 256GB.
choosing a PE of 8MB will yield a maximum LV of 512GB.
(and so on)

the crappy part:
you can't alter PE size without fremoving the LV first, and rebuilding the physical volume with a larger extent size.
 
  


Reply

Tags
devicemapper, logical, lvm, lvm2, volume



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
lvm2 Newly created Volume Group lost after reboot seanikins Linux - Newbie 5 04-11-2010 12:55 PM
extent size of a logical volume tajamari Linux - Server 0 02-24-2009 04:53 AM
How to move an lvm2 volume group from one physical to another? shwouchk Linux - Software 2 10-29-2008 07:16 PM
LVM2 volume group not seen after FC4 install digithead1011 Fedora - Installation 6 10-09-2005 09:25 PM
LVM2 on Sarge - HD failure in the volume group container /root Golovko Debian 3 06-20-2005 09:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 07:39 AM.

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
Open Source Consulting | Domain Registration