D
D
dozagufazu2017-02-14 21:18:59
linux
dozagufazu, 2017-02-14 21:18:59

How to format a flash drive in Linux?

Sorry for the noob questions. I'm just new to Linux.
There was a need to format the bootable flash drive.
Executed the command sudo dd if=/dev/zero of=/dev/sdb bs=1024
It is still running, 15 minutes have passed. No changes on the command line. I don't see the dd process in System Monitor at all. What's happening? Formatting going or not?
How to correctly and quickly format flash drives on Linux?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Moseychuk, 2017-02-14
@dozagufazu

This is not formatting a flash drive, but overwriting with zeros.
I'll try to explain.
Your flash drive (/dev/sdb) is a block device. What does it mean? So it has an exact size in bytes. And you can read/write any bytes on the device in any order.
To store files on a flash drive, it must be formatted.
The formatting procedure creates a file system on a block device - a set of data that allows you to track free space on a flash drive and stores file names (very, very simplified).
On Linux, you can create a file system directly on a
fat32
ext4 block device.
Almost all formatting utilities are named mkfs.fsname, where fsname is the name of the file system.
Or first split the device into sections. To do this, you need to place a partition table at the beginning of the disk. Now the 2 most popular types of tables are MBR and GPT.
To work with the MBR, there is the fdisk utility.
All created partitions will be named like this
/dev/sdb1
/dev/sdb2
/dev/sdb3
etc.
Each partition can be formatted with its own file system.
If you write anything to /dev/sdb, you will most likely destroy information about created partitions and filesystems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question