{"id":925,"date":"2007-11-14T12:56:50","date_gmt":"2007-11-14T02:56:50","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/2007\/11\/14\/better-disk-allocation-with-mythtv-and-xfs\/"},"modified":"2007-11-14T12:56:50","modified_gmt":"2007-11-14T02:56:50","slug":"better-disk-allocation-with-mythtv-and-xfs","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2007\/11\/14\/better-disk-allocation-with-mythtv-and-xfs\/","title":{"rendered":"Better disk allocation with MythTV and XFS"},"content":{"rendered":"<p>Running MythTV on XFS? Noticed that all your recordings end up rather fragmented? (use xfs_bmap to find out) Well, the culprit is MythTV not being too nice to the file system. Good news is, it&#8217;s rather fixable.<\/p>\n<p>From the MythTV source code, edit libs\/libmythtv\/ThreadedFileWrite.cpp and look for the following:<\/p>\n<p>void ThreadedFileWriter::Sync(void)<br \/>\n{<br \/>\nif (fd &gt;= 0)<br \/>\n{<br \/>\n#ifdef HAVE_FDATASYNC<br \/>\nfdatasync(fd);<br \/>\n#else<br \/>\nfsync(fd);<br \/>\n#endif<br \/>\n}<br \/>\n}<br \/>\nYou then want to, after the first squiggly bracket (a { ) put in a &#8220;return;&#8221; so that it looks like this:<\/p>\n<p>void ThreadedFileWriter::Sync(void)<br \/>\n{<br \/>\nreturn;<br \/>\nif (fd &gt;= 0)<br \/>\n{<br \/>\n#ifdef HAVE_FDATASYNC<br \/>\nfdatasync(fd);<br \/>\n#else<br \/>\nfsync(fd);<br \/>\n#endif<br \/>\n}<br \/>\n}<\/p>\n<p>Recompile MythTV and go!<\/p>\n<p>(Before anybody says, yes &#8211; this patch could be neater and all that&#8230; I just haven&#8217;t had time yet).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Running MythTV on XFS? Noticed that all your recordings end up rather fragmented? (use xfs_bmap to find out) Well, the culprit is MythTV not being too nice to the file system. Good news is, it&#8217;s rather fixable. From the MythTV &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2007\/11\/14\/better-disk-allocation-with-mythtv-and-xfs\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[21],"tags":[],"class_list":["post-925","post","type-post","status-publish","format-standard","hentry","category-mythtv"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-eV","jetpack-related-posts":[{"id":553,"url":"https:\/\/www.flamingspork.com\/blog\/2006\/01\/16\/upgraded-mythtv-box-to-breezy\/","url_meta":{"origin":925,"position":0},"title":"upgraded mythtv box to breezy","author":"Stewart Smith","date":"2006-01-16","format":false,"excerpt":"Finally got arround to upgrading the mythtv box. Less RAM being used is good - it's only got 512MB and some of the recordings were getting pretty fragmented due to having to flush things to disk a bit too often. Hopefully things will be a bit better now. Annoying things\u2026","rel":"","context":"In &quot;cool gadgets&quot;","block_context":{"text":"cool gadgets","link":"https:\/\/www.flamingspork.com\/blog\/category\/cool-gadgets\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":907,"url":"https:\/\/www.flamingspork.com\/blog\/2007\/10\/22\/practical-mythtv-for-1495us\/","url_meta":{"origin":925,"position":1},"title":"Practical MythTV for $14.95US","author":"Stewart Smith","date":"2007-10-22","format":false,"excerpt":"Julie at Apress let me know that over at Bookpool: Practical MythTV: Building a PVR and Media Center PC they're having a big sale of Apress titles, including Practical MythTV. So over there now for (a bit) less than $15US you can get Practical MythTV. Pretty neat. So everybody should\u2026","rel":"","context":"In &quot;mythtv&quot;","block_context":{"text":"mythtv","link":"https:\/\/www.flamingspork.com\/blog\/category\/mythtv\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":862,"url":"https:\/\/www.flamingspork.com\/blog\/2007\/07\/13\/another-positive-review-for-practical-mythtv\/","url_meta":{"origin":925,"position":2},"title":"Another positive review for Practical MythTV!","author":"Stewart Smith","date":"2007-07-13","format":false,"excerpt":"Over at fosswire.com, there's a review of Practical MythTV. Here the copy of the book was provided by our publisher, Apress - who are getting some copies out there to people to look at and review (and the reviews are positive which is great news for us!). You can get\u2026","rel":"","context":"In &quot;mythtv&quot;","block_context":{"text":"mythtv","link":"https:\/\/www.flamingspork.com\/blog\/category\/mythtv\/"},"img":{"alt_text":"","src":"http:\/\/www.assoc-amazon.com\/e\/ir?t=flamin-20&l=as2&o=1&a=1590597796","width":350,"height":200},"classes":[]},{"id":856,"url":"https:\/\/www.flamingspork.com\/blog\/2007\/06\/30\/another-favourable-practical-mythtv-book-review\/","url_meta":{"origin":925,"position":3},"title":"Another favourable Practical MythTV Book Review","author":"Stewart Smith","date":"2007-06-30","format":false,"excerpt":"Over at mythpvr.com, there's a review of Practical MythTV. It's good to see the book being well received.","rel":"","context":"In &quot;mythtv&quot;","block_context":{"text":"mythtv","link":"https:\/\/www.flamingspork.com\/blog\/category\/mythtv\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1039,"url":"https:\/\/www.flamingspork.com\/blog\/2008\/03\/18\/mythtv-021-released\/","url_meta":{"origin":925,"position":4},"title":"MythTV 0.21 released!","author":"Stewart Smith","date":"2008-03-18","format":false,"excerpt":"Yep, a new MythTV version is now about 10 days old. I've been running a \"recent\" SVN build for a while now, and there's a lot of pretty goodness there - and been fairly stable. Nothing radically different than before, just natural evolution for the better.","rel":"","context":"In &quot;mythtv&quot;","block_context":{"text":"mythtv","link":"https:\/\/www.flamingspork.com\/blog\/category\/mythtv\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":589,"url":"https:\/\/www.flamingspork.com\/blog\/2006\/02\/20\/mythtv-lircrc-with-xine-goodnees\/","url_meta":{"origin":925,"position":5},"title":"mythtv lircrc with xine goodnees","author":"Stewart Smith","date":"2006-02-20","format":false,"excerpt":"xine --keymap=lirc Is a useful command to run. I redirected it to a file and appended an edited copy to my existing lircrc for mythtv. I used to run irxevent, but am now using mythtv's builtin support. I had to symlink ~\/.lircrc to ~\/.mythtv\/lircrc I have a Winfast TV Deluxe\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/925","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=925"}],"version-history":[{"count":0,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/925\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}