In reply to steveej:
I'm no expert and there will be a wide range of views on this but...
6 weeks - not long to go.... you have 3, perhaps 4 training weeks before tapering down. In those weeks I'd probably do a 22, a 24 and a 26, keeping the same amount or a little more hill each time - how much hill are you doing on your 20 miler? Try to be getting somewhere between 1500 and 2000 of ascent if you can. Then perhaps you might fit in a 30 miler, perhaps over easier terrain and take that one very slow, effectively at the speed you aim to do your 40 at. Practice eating and hydration on that one and aim for time on feet and being in good condition at the end of it. That one will help by giving time on feet, getting used to appropriate pacing and will mentally give you the boost of 'I've done 75% of the distance'.....
Mid weeks aim for a gently recovery run, short easy and lots of stretching, one longer easy run and one speed session of some kind. Make your gently run gently and your speed run hard... don't let them fall into a mid ground of too fast for recovery/too slow for speed as you don't get the benefits you are aiming for then.
You could also consider doing back to backs... 15 to 20 miles one day (late in day if possible) then 10 the next morning early so you have only limited rest between... aim to do both those sessions at your race pace so that again you are getting time on feet and used to running on tired legs but less strain/injury potential than doing 30 to 35 straight off.
Take it easy in last 2 weeks. Even in the 6 you will not get much fitter, in the last 2 you definitely will not and you should aim to take it easy and arrive at race on fresh legs. Take your boost and confidence from knowing you have done long sessions 3 to 6 weeks back, not 'I did 20 k at a good pace 2 days ago'.
Running empty is good - gets your body used to using fat. Just find some bars/gels etc that you like and can stomach now so that you know what to eat on the run. Keep fluids up (you need a lot to absorb even the gels you are taking on) but don't over do the water or you may feel uncomfortable or actually overhydrate if not careful. And if you are troubled about time, remember you can make a huge gain through efficiency. If you typically run 20 miles plus without stopping much, you can do the same on race day... you don't need to fill bottles, eat, take a break at every check point... just dib in and sail through if all is going well, or grab a banana and carry on or whatever. Equally, try to know or visualise the route and be able to get kit in and out of bag, map etc whiel on the move so that you can navigate without stopping etc. Not uncommon for me to be passed regularly by people that I then sail past as they faff with bags, agonise over map at every junction/track turning etc... if you are confident at nav and can read map and terrain you can cruise along a lot more efficiently.