Soak the beans overnight in plenty of cold water, or quick-soak: boil 2 minutes, cover and let stand 1 hour. Drain and rinse.
Put the beans, ham hocks and water in a large pot. Bring to a boil, skim off any foam, then lower to a gentle simmer. Partly cover and cook for 2 1/2 to 3 hours, stirring now and then and adding hot water if the beans peek above the liquid, until they're very soft.
Meanwhile, melt the butter in a skillet over medium heat and cook the onion (and celery) for 8 to 10 minutes, until golden. Add the garlic for the last minute.
Lift out the ham hocks and let them cool a little. Pull off the meat, discard the skin and bones, and chop the meat.
Mash about 1 cup of the beans against the side of the pot with a spoon. Return the ham and add the browned onion. Simmer 15 minutes.
Season with pepper and salt to taste (taste first; the hocks are salty). Stir in the parsley and serve.
Slow cooker: LOW 8 to 9 hours. Instant Pot: HIGH pressure 30 minutes for soaked beans, 20-minute natural release.Keeps 4 to 5 days in the fridge and 3 months frozen. Thin with water when reheating.