config: rework disk parse

Clean up hard code, add checking for file, index, format

Signed-off-by: Dunrong Huang <riegamaths@gmail.com>