what is the use of /dev/null or /dev/zero file while creating a swapfile?
Printable View
what is the use of /dev/null or /dev/zero file while creating a swapfile?
/dev/null outputs 'null' data so its good for creating empty swapfiles and clearing out partitions.
How do you use this and where do you see this?
Those 2 Devices represent 0 and NULL hope that helps.
/dev/null is the bit-bucket. Anything output there is gone into the great garbage collector in the sky. /dev/zero is also a special device that is used mostly for zero-filling data files. It is sometimes used to write null (ascii 0) data to disc drives in order to "reformat" them. Most drive controllers these days will, while zeroing out the drive, remap bad sectors when you do this. In fact, that is the only way to do a low-level format any more.