This question already has an answer here:
I have a server with a hard drive I'd like to test using smartctl (smartmontools) and badblocks. I would use smartctl first, then badblocks.
My question is three parts:
- How can I run the commands over SSH so the process won't stop when I close the Terminal?
- How can I output the badblocks results and the smartctl info to a file?
- How can I run smartctl and then badblocks will start automatically (when smartctl is finished) without having to SSH again?