use fmt; use io; use cmd; use gpt; export fn mkbackup(vol: str, args: []str) void = { const vol = cmd::openvol(vol); const vol = match(gpt::from(vol)) { case let g: *gpt::gpt => yield g; case gpt::nogpt => fmt::fatalf("{}: disk does not have valid gpt", args[0]); case => fmt::fatalf("{}: could not access volume", args[0]); }; defer { gpt::commit(vol)!; gpt::finish(vol); }; gpt::mkbackup(vol); };