Categories
Computing Linux Technology

Reformat Drives to 512 bytes / sector

Got some IBM NetApp drives? Or drives from some other big SAN? Operating system can’t see them? They might be low-level formatted to 520 byte sectors or some other oddball size. Many other drives you see on eBay (etc) have this same issue. These drives can be very affordable, but you can’t use them as-is.

This guy- https://youtu.be/BbtPPH3W7nU advises booting CentOS 6 and installing sg3utils, which I did. Under this regime, the drives are referred to as /dev/sgx where x is a number. Not the usual /dev/sdx or /dev/hdx.

  • dnf install sg3_utils
    • (or apt install for debian/ubuntu)
  • sg_scan -i
    • Look, it sees all my drives!
  • Format the drive:
    • sg_format --format --size=512 --fmtpinfo=0 /dev/sg3
    • Yup, sg3, not sdc
      • More recently, 2021-05-21, the syntax above worked perfectly,
      • Formatting two drives on the same controller (run from two different consoles) took 96m 16s
    • Sometimes this FAILED, so I did  this:
    • sg_format --FFF --size=512 --fmtpinfo=0 /dev/sg3
    • This forces the format, even if it can’t read the sense key properly.
    • If this completes without error, try it again without the -FFF, using just -F instead.
    • Using -FFF completes without error, but repeating with -F fails again.
    • So upon further research, I tried this:
    • sg_format --F --size=512 --six --fmtpinfo=0 /dev/sg3
    • The six option can be used in case the drive cannot be formatted with default 10 byte MODE SENSE/SELECT
    • Works much better (but no faster.) Eventually finished, 140m, 16s later, or 2 hours, 20 minutes, 16 seconds.
    • The drives work fine now, as do all drives I tried this on.

Categories
Computing Linux Technology

Linux

Linux is an operating system, like Windows is an operating system, but they are not the same.

  • Windows is a for-profit product of Microsoft
  • Linux is Free and Open Source Software (FOSS) https://itsfoss.com/what-is-foss which is available for download at no cost. However, people and companies can and do charge for support contracts and other services, for those who feel they need it.
  • Windows is proprietary. The code/programming used to create it is (by and large) a closely guarded secret, and even if it did get out, it’s protected by copyright/patents/other legal guards.
  • Linux is open-source, which means that the code for it can be examined by anyone. This has a number of implications. Linux is known not to contain nefarious phone-home, tattle on the user, security-challenged features, because anyone can take it apart line-by-line and determine exactly what each line of code does.
  • Windows is known to “phone home” and report on what you’re doing, etc.
  • Windows, starting with Windows 10, forces users to accept all updates from Microsoft, even if it breaks things.
  • Linux leaves updates and version upgrades to the user, though performing them is very easy.
  • Windows requires an ever-increasing amount of hardware horsepower to run.
  • Linux makes excellent use of high-powered CPUs, memory, and other components, but also runs well on lower-powered equipment. It can often breath new life into older PCs and laptops that would otherwise hit the scrap heap.

Stay tuned for future posts on Linux and other FOSS technology.