A
A
Athanasius Sidorov2021-02-04 23:51:47
linux
Athanasius Sidorov, 2021-02-04 23:51:47

Low-level disk formatting in Linux?

Hello everybody! For low-level formatting, there is a program on WIndows HDD Lewel Format Tool.
I read online that on Linux you can use the command dd if=/dev/zero of=/dev/sdX for low-level formatting .
There is also a command dd if=/dev/null of=/dev/sdX .
The fact is that I want to prepare the disc for sale + there are software bad blocks on it.
Using low-level formatting, you can erase all data and even fix some bad blocks.

I didn't understand what's the difference between zero and null?

Answer the question

In order to leave comments, you need to log in

7 answer(s)
R
rPman, 2021-02-04
@rPman

Low-level formatting - this requires utilities from the manufacturer, each has its own.
An ssd drive can be 'formatted' by running the trim command on the whole drive (blkdiscard utility)
The second command is wrong, /dev/zero returns infinite zeros, and /dev/null cannot be read, only write anything to it endlessly
To prepare the drive for sale, dd if=/dev/zero of=/dev/sdX. more than enough.
You can’t do anything with bads, they will be visible in smart reports (and even before they appear), such a disk is only for a landfill / spare parts for repairmen (sell on Avito, they can buy as a donor by attaching a SMART screen).

V
Vitsliputsli, 2021-02-05
@Vitsliputsli

I didn't understand what's the difference between zero and null?

zero is zero;
null is the absence of a value.
/dev/zero generates a stream of zeros when read, and ignores everything that enters it when writing.
/dev/null sends end of file when read, ignores everything in it when writing.

A
Artem @Jump, 2021-02-05
Tag curated by

Low-level disk formatting in Linux?
It is made exclusively at the factory; it is impossible to make it at home without buying specialized equipment.
Low-level formatting is writing servo marks on the platter.
High-level or normal is just creating an operating system, i.e. writing a few files.
I read on the internet that on Linux you can use the dd if=/dev/zero of=/dev/sdX command for low-level formatting.
And I read a three-letter word on the fence.
The DD command is a data copy command, it has nothing to do with formatting at all.
The fact is that I want to prepare the disc for sale + there are software bad blocks on it.
Software bad blocks are blocks marked by the operating system.
If you remove the OS, the marks will also be deleted.
I didn't understand what's the difference between zero and null?
Zero is zero, null is nothing.

A
Alexey Cheremisin, 2021-02-05
@leahch

Bad blocks can't be fixed like this! You can fix it with the disk manufacturer's utilities, but it's better not to do it at all.
You need to write down zero - these are zeros, and null - emptiness, will not write anything.

R
Ruslan, 2021-02-05
@msHack

gnome disk utility
gparted

P
pfg21, 2021-02-05
@pfg21

it's not low-level formatting, it's filling the disk with zeros.
there is no difference between /dev/null and /dev/zero.
both streams when reading give an unlimited stream of zeros.
Yes, and when recording, they behave identically - everything recorded is deleted.

P
Puma Thailand, 2021-02-05
@opium

Both have nothing to do with low-level formatting
. Troubles cannot be fixed; the disk itself must be relocated to spare places
. And it’s enough to do a full long format in Windows (uncheck the quick one) and that’s enough before selling

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question