How to remove all lines from file, starting from a known line, using sed

This command will look for a line starting with volumes: and remove all lines after said line from the file (including the line starting with volumes: itself).

sed -i -e '/^volumes:/,$d' myfile

The command edits the file in-place (-i), no copy (or backup) of the file will be created.