The last thing you want to happen inside your backpack is for your fuel to spill all over your food. So, it's important to store food separate from fuel. Pack your fuel containers upright and preferably in outside pockets. Your food goes inside your pack. For added protection, not just from an accidental fuel spill, but from moisture, leaking toiletries and other unexpected problems, pack your food in plastic zip-top bags. Some people sort their food into plastic bags by type, such as breakfast foods or snacks. Others prepare one bag for each day's meals. However you choose to compartmentalize your food, having it sorted in separate bags makes it easier to grab and provides it with some extra protection. But keep in mind, plastic bags aren't enough to completely protect your food from hungry animals. They're not that airtight.
If you have room in your backpack for your cookware, pack it inside. If not, you can attach it to the outside of your backpack with straps. But it's important to pack as much as you can inside your backpack. Although straps and clips make it easy to attach a wide variety of gear to your backpack, any gear that hangs from your backpack is likely to become snagged in the brush. And, no matter how carefully you tie it on, it can be lost.
If you're in bear country, your food will need extra protection at night, and you'll probably need to carry a bear canister with you while you hike. So you'll need to factor that weight and the canister's size into your packing strategy. If you hike in an area with black bears, a soft sided bear proof container may be enough. You'll need to hang the container in the air, suspending it between two trees, about 20 feet (6 meters) in the air.
If you're hiking in an area where grizzly bears are common, your food will require more aggressive measures. Because the grizzly is less concerned about confronting humans than the black bear is, and because it's larger, you'll need a hard-sided food container. You also should consider preparing your meals and eating before setting up camp. Eat your meal, clean up and then hike on at least 200 yards (183 meters) before setting up camp. Once you're in camp, don't eat anything and store your food in the hard bear-proof vault at least 100 yards (91 meters) from camp.