(1) Put all your gear (including equivalent in weight and bulk of a week's food) in a box. Take the box to the store. Try a bunch of different packs with the gear loaded inside. Remember that the clothing you wear while hiking (in good weather) and your trekking poles will not be in the pack (unless it's "Naked Hiker Day").
(2) Put all your gear in a box (see above), but be sure the box is rectangular. Pack so the top surface is flat. Use tape measurement to find length, width, height. Calculate the volume by multiplying the three as we learned in school. A liter is approximately 60 cubic inches (not exact, but close enough). Do remember, though, that not all pack volumes are standard, so you will still have to try the gear in the pack. If you are ordering a pack, have the gear ready to put in the pack when it arrives, load it up, adjust and take an hour or two (preferably two) hike around the house. Boring, but helps you decide whether or not the pack is a "keeper."
Weight is also important; most manufacturers show on their websites the maximum weight suggested for their packs. Remember that this is total pack weight, including, fuel, food, water and the pack. IMHO, subtract 5 pounds.