How do I format hard disks and restore failed disks on a Linux OS?
1. Visit the open source community and download sg3_utils at the following address:
2. After the correct installation package is downloaded, copy it to the Linux OS, and run the following commands to install sg3_utils (the following uses the tar.gz format as an example):
tar -zxvf sg3_utils-1.33.tar.gz
3. After the installation is complete, the sg_format tool is available in the system. Use this tool to format the hard disk.
Formatting command: sg_format -F /dev/sdb
(Change the drive letter according to the actual situation.)
4. After the formatting is started, do not restart the system or remove the hard disk. Wait until the formatting is complete.
5. After the formatting is complete, the hard disk can be used properly.
Note: During the formatting, you can run sg_format -F -v /dev/sdx to query the formatting progress. (If the hard disk is not being formatted, the command starts formatting the hard disk.)