The correct reference would point to our nandroid tag-wiki, as a Nandroid backup is what covers all content. However, this is only available via custom recoveries.
An alternative to that would be the dd command ("Disk Duplicator"1).
Disclosure: the following describes an application I wrote and maintain:
My tool Adebar is able to generate you dd scripts for all partitions your device holds, which you then can cross-check before execution. While doing that, Adebar tries to figure out what each partition is used for, so you won't end up just with cryptic names on the disk-images. To get to the content, you still had to figure the file system used on each partition (to be able to mount it as a Loop Device). But for the "worst case", you should be able to use these images to restore your device to the state it was in when you've created them (though I must admit I've never tried that yet).

files pulled/generated by Adebar (click image for larger variant)
Adebar is mainly written in Bash version 4, and utilizes adb to communicate with the device. It definitely runs fine on Linux. I have not tested it on other systems, and so far got no feedback from users maybe having tried that.
1: careful: it's nick-named "Disk Destroyer", as if you use it the wrong way around (i.e. swap source and target), you can end up with a "disk without content"