All and whole have similar meanings. They can both be used with singular nouns to mean complete. The word order is different.
- He lived all his life in Africa. OR He lived all of his life in Africa. (Word order: all (of) + determiner + noun)
- He lived his whole life in Africa. (Word order: determiner + whole + noun)
- I spent the whole day in bed.
- I spent all (of) the day in bed.
Differences between all and whole
We do not normally use all before indefinite articles (a/an).
- You have eaten a whole loaf. (NOT You have eaten all a loaf.)
- I learned a whole lesson in ten minutes. (NOT I learned all a lesson in two minutes.)
- She wrote a whole novel in two weeks.
We do not usually use whole with uncountable nouns.
- The cat has drunk all the milk. (More natural than The cat has drunk the whole milk.)
Whole and whole of
Before proper nouns and pronouns, we use the whole of.
- The whole of Paris was talking about her affairs. (NOT Whole Paris was talking about her affairs.)