Author |
Message |
graysky
|
Posted: Sun Jul 20, 2008 10:20 am |
|
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location:
/dev/null
|
After learning about these utils to measure fragmentation and defrag it on XFS based filesystems, I noticed that when I copy files over from my dvdrom (or through samba), to my /myth (which is XFS), they contain huge amount of fragments.... is this normal? Can anyone else running xfs confirm?
Here I queried a file ~1 gig in size that I just copied over via Samba (similar results obtained using the local dvdrom on the LINUX box):
Code: # xfs_bmap -v 18-Jun-2007.mkv 18-Jun-2007.mkv: EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL 0: [0..9503]: 67181048..67190551 0 (67181048..67190551) 9504 1: [9504..25887]: 63597504..63613887 0 (63597504..63613887) 16384 2: [25888..58655]: 58657216..58689983 0 (58657216..58689983) 32768 3: [58656..99615]: 46611680..46652639 0 (46611680..46652639) 40960 4: [99616..140575]: 10315872..10356831 0 (10315872..10356831) 40960 5: [140576..181535]: 10274912..10315871 0 (10274912..10315871) 40960 6: [181536..222495]: 10233952..10274911 0 (10233952..10274911) 40960 7: [222496..263455]: 10192992..10233951 0 (10192992..10233951) 40960 8: [263456..304415]: 10152032..10192991 0 (10152032..10192991) 40960 9: [304416..345359]: 10111088..10152031 0 (10111088..10152031) 40944 10: [345360..385919]: 10070520..10111079 0 (10070520..10111079) 40560 11: [385920..425879]: 10030560..10070519 0 (10030560..10070519) 39960 12: [425880..466199]: 9990240..10030559 0 (9990240..10030559) 40320 13: [466200..506543]: 9949896..9990239 0 (9949896..9990239) 40344 14: [506544..547343]: 9909096..9949895 0 (9909096..9949895) 40800 15: [547344..588303]: 9868136..9909095 0 (9868136..9909095) 40960 16: [588304..629223]: 9827216..9868135 0 (9827216..9868135) 40920 17: [629224..670135]: 9786304..9827215 0 (9786304..9827215) 40912 18: [670136..711055]: 9745384..9786303 0 (9745384..9786303) 40920 19: [711056..752015]: 9704424..9745383 0 (9704424..9745383) 40960 20: [752016..792895]: 9663544..9704423 0 (9663544..9704423) 40880 21: [792896..833807]: 9622632..9663543 0 (9622632..9663543) 40912 22: [833808..874767]: 9581672..9622631 0 (9581672..9622631) 40960 23: [874768..915687]: 9540752..9581671 0 (9540752..9581671) 40920 24: [915688..956607]: 9499832..9540751 0 (9499832..9540751) 40920 25: [956608..997487]: 9458952..9499831 0 (9458952..9499831) 40880 26: [997488..1038447]: 9417992..9458951 0 (9417992..9458951) 40960 27: [1038448..1079343]: 9377096..9417991 0 (9377096..9417991) 40896 28: [1079344..1120271]: 9336168..9377095 0 (9336168..9377095) 40928 29: [1120272..1161231]: 9295208..9336167 0 (9295208..9336167) 40960 30: [1161232..1202191]: 9254248..9295207 0 (9254248..9295207) 40960 31: [1202192..1243151]: 9213288..9254247 0 (9213288..9254247) 40960 32: [1243152..1284111]: 9172328..9213287 0 (9172328..9213287) 40960 33: [1284112..1325071]: 9131368..9172327 0 (9131368..9172327) 40960 34: [1325072..1374223]: 9082216..9131367 0 (9082216..9131367) 49152 35: [1374224..1423375]: 9033064..9082215 0 (9033064..9082215) 49152 36: [1423376..1472527]: 8983912..9033063 0 (8983912..9033063) 49152 37: [1472528..1521679]: 8934760..8983911 0 (8934760..8983911) 49152 38: [1521680..1570815]: 8885624..8934759 0 (8885624..8934759) 49136 39: [1570816..1619967]: 8836472..8885623 0 (8836472..8885623) 49152 40: [1619968..1669095]: 8787344..8836471 0 (8787344..8836471) 49128 41: [1669096..1718247]: 8738192..8787343 0 (8738192..8787343) 49152 42: [1718248..1767391]: 8689048..8738191 0 (8689048..8738191) 49144 43: [1767392..1816543]: 8639896..8689047 0 (8639896..8689047) 49152 44: [1816544..1865695]: 8590744..8639895 0 (8590744..8639895) 49152 45: [1865696..1914847]: 8541592..8590743 0 (8541592..8590743) 49152 46: [1914848..1963991]: 8492448..8541591 0 (8492448..8541591) 49144 47: [1963992..2013143]: 8443296..8492447 0 (8443296..8492447) 49152 48: [2013144..2062295]: 8394144..8443295 0 (8394144..8443295) 49152 49: [2062296..2111447]: 8344992..8394143 0 (8344992..8394143) 49152 50: [2111448..2160599]: 8295840..8344991 0 (8295840..8344991) 49152 51: [2160600..2209743]: 8246696..8295839 0 (8246696..8295839) 49144 52: [2209744..2251767]: 8204672..8246695 0 (8204672..8246695) 42024
_________________ Retired KM user (R4 - R6.04); friend to LH users.
|
|
Top |
|
 |
Liv2Cod
|
Posted: Sun Jul 20, 2008 12:17 pm |
|
Joined: Fri May 21, 2004 11:55 pm
Posts: 1206
Location:
Silicon Valley, CA
|
Well, I dunno if yours is a problem, but here's my XFS partition that's been used for a year or so...
Code: xfs_db> frag actual 124184, ideal 140, fragmentation factor 99.89%
_________________ Do you code to live, or live to code? Search LinHES forum through Google
|
|
Top |
|
 |
graysky
|
Posted: Sun Jul 20, 2008 12:42 pm |
|
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location:
/dev/null
|
Thanks for the reply. Have you tried to defrag that partition? Also, are you using the allocsize=512 meg switch in your /etc/fstab as suggested on this mythtv.org wiki page?
_________________ Retired KM user (R4 - R6.04); friend to LH users.
|
|
Top |
|
 |
Liv2Cod
|
Posted: Sun Jul 20, 2008 5:46 pm |
|
Joined: Fri May 21, 2004 11:55 pm
Posts: 1206
Location:
Silicon Valley, CA
|
Naaa... I just set it up a loooong time ago and ran it. I haven't really noticed anything bad. I guess the suggested setup is good, but won't it make each entry in "pretty" take up 1/2 gig? Maybe not, since they're just links.
_________________ Do you code to live, or live to code? Search LinHES forum through Google
|
|
Top |
|
 |
graysky
|
Posted: Sun Jul 20, 2008 6:17 pm |
|
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location:
/dev/null
|
Yeah, I dunno exactly how that works... I will say that mine captured several 12 hour shows and the fragment load hasn't changed really.. still under 1 %.
_________________ Retired KM user (R4 - R6.04); friend to LH users.
|
|
Top |
|
 |
graysky
|
Posted: Sat Jul 26, 2008 5:09 am |
|
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location:
/dev/null
|
This fragmentation effect seems to be unique to both SAMBA and accessing files from the local DVDROM drive. If I load up files from ftp, they are not fragmented at all.
For example, I just downloaded about 5 video files (5 gigs totally) and if I inspect each one with xfs_bmap, each of the 5 are completely solid (i.e no fragments). Contrast that with moving a file via SAMBA or simply reading it off the local DVDROM, and I'm left with results like I posted above (first post of the thread).
Very odd!
_________________ Retired KM user (R4 - R6.04); friend to LH users.
|
|
Top |
|
 |
marc.aronson
|
Posted: Sat Jul 26, 2008 7:57 am |
|
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location:
California
|
I've been using the "alloc size" setting for over a year now, but still had 98% fragmentation levels. I now have my machine defrag for 20 minutes once/day just before it shuts itself down and my fragmentation levels are at or near 0. I'm not sure that it has a material impact on my performance, but it feel good to keep your room clean  .
Marc
|
|
Top |
|
 |