LVM: Building a LV and a Filesystem to just fit
The idea: Write a script that will analyze a directory and build a LV/FS to fit that directory perfectly with no wasted space.
The problem: Getting the sizing right. Default settings make too many inodes and waste space. Analyzing the directory with find just seems to get too close and then some overhead of creating the FS makes it just not fit either on inodes or space. In general it seems more art than algorithm. I'm using RHEL4 and LVM2. :-Dan |
the style and content of this reads just like a university final year project to me. as such we aren't here to do your wrk for you, especially as you've done nothing but recite it, and haven't even asked a question at all...
|
Thanks I guess. I never had much university and certainly never made it to any final year. At least we agree that the problem is challenging. I had considered posting all my trial and error methods, but it is really just guess work and I was concerned that my attempts would tempt someone to make minor tweaks to my trail and failures, instead of making an unprejudiced suggestion.
I'm not looking for anyone to do my work for me, I would like someone who understands the interactions between the LVM and the filesystem to point me in the right direction. |
Your best bet is to post up what you have done already. Otherwise we'll end up suggesting things you have tried. It also may be that you were on the right track with one of your ideas. We'll never know unless you tell us.
|
Script and Eaxmples
This is my trial and error script and a few examples. I'm sure the trick is in figuring out some factor to add to the size and inode counts, but I'd like it to be based on reason and not trial and error.
Code:
1 #!/bin/bash This run is small (and it fails). The actual volumes we expect to create are in the 60-80GB range (but the runs take a long time and always fail with this script: Code:
# ./MakeImgVol.sh /cacheimg/raidu0/pcl/v007 Code:
|
Any file system gurus out there?
Here is an example of failure with a larger volume and a small tweak to the mke2fs command (on line 22) in the script to reduce the blocks "reserved for the super user" from the default 5% to 0% (didn't seem to make any difference):
22 mke2fs -m 0 -O sparse_super,filetype -N ${cnt} -L ${NAME} /dev/ReadOnly/${NAME} The man page says that "sparse_super,filetype" are defaults. Just making sure. Note: The size of this volume is in the range we expect to see. Code:
# ./MakeImgVol.sh /cacheimg/raidu0 |
All times are GMT -5. The time now is 02:38 PM. |