Fdisk formatting flash drive. Formatting a flash drive in Linux


In this article we will talk about how to format a flash drive in Linux. Let's give an example of the most convenient ways to do this. Everything is done very simply and quickly. We are more than confident that even a beginner can cope here.

Formatting a Flash Drive in LINUX Ubuntu

You can use the drives through the GUI, they are installed by default and are easy to use. Since everything happens more than clearly and most importantly, it’s convenient.

By the way, we previously wrote about the main characteristics of your system.

  • Click the Unity Dash icon
  • Enter “Disks” in the Search column
  • 3rd point: click on the “Disks” icon


After this, a window will open and the application will appear:

  • Select the USB drive you need to format.
  • Click on the gear icon and select Format
    A special small window will appear, just select the option you want and click “Format”

Additionally:

  • There is also an option to find the desired disk and right-click on it. A new menu will appear in which you need to click on the corresponding item - Formatting.
  • After a new window opens, select in which format to format the disk and click on the desired button.

Method 2: Gparted tool

You can format a flash drive using the Gparted program. Which is used by a huge number of Linux users. There you can perform almost all basic tasks with disks that are connected to the device. This can be said to be a leader among similar programs. If you decide to do this using this program, now we will tell you how to install it.

sudo apt-get install gparted

Method 3: Using a terminal

go to Super mode by typing "su" followed by the super mode password

which will show the entire volume on your computer, or you can also use

to view the USB flash drive, suppose it could be /dev/sdb1 enter a command like:

umount /dev/sdb1

mkfs.vfat /dev/sdb1

How to format a disk in fat32 format

Then, edit

mkfs.vfat -n ‘name_for_your_pendrive’ -I /dev/sdb1

to add a name for your pendrive

conclusions

As you understand, this is done very simply. Formatting a USB flash drive in LINUX Ubuntu is very simple. Moreover, there are so many options, and you can choose the most convenient one for yourself.

If you have any questions about the topic " Formatting a Flash Drive in LINUX"- write them in the comments. We will definitely read them and if you have something to add to this article, also tell us about it.

If you find an error, please highlight a piece of text and click Ctrl+Enter.

To format any device (hard drive, flash drive, memory card) into the desired file system, Ubuntu has an excellent GUI program called GParted. How can you do the same thing in the Terminal?

First we need to identify our USB flash drive or memory card. Let's run the command in the Terminal:

sudo fdisk -l

This is what the Terminal will give us:

no talloc stackframe at ../source3/param/loadparm.c:4864, leaking memory

Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/tracks, 77825 cylinders, total 1250263728 sectors



Disk ID: 0x0009d6f7


/dev/sda1 * 2048 61441501 30719727 83 Linux
/dev/sda2 61442048 73730031 6143992 82 Linux swap / Solaris
/dev/sda3 73730048 1250263039 588266496 83 Linux

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/tracks, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk ID: 0x00075136

Device Load Start End Blocks Id System
/dev/sdb1 101113110 105322139 2104515 82 Linux swap / Solaris
/dev/sdb2 105322203 826884095 360780946+ 83 Linux
/dev/sdb3 * 2048 101111807 50554880 83 Linux
/dev/sdb4 826884096 976773119 74944512 7 HPFS/NTFS/exFAT

Partition table entries are not in disk order

Disk /dev/sde: 8115 MB, 8115978240 bytes
255 heads, 63 sectors/tracks, 986 cylinders, total 15851520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk ID: 0x000148b1

Device Load Start End Blocks Id System
/dev/sde1 * 63 15840089 7920013+ with W95 FAT32 (LBA)

In my case, the required flash drive is the device /dev/sde1, which has a size of 8Gb (8115 MB).

Let's unmount it using the command:

sudo umount /dev/sde1

Now let's format the flash drive to the fat32 file system:

sudo mkfs.vfat -n "System" -I /dev/sde1

Let's break down the above command:

1. The mkfs command is used in Linux to create a file system on your device.

2. The vfat command creates a FAT32 file system. There are also other file system formats:

mkfs.ext2 - EXT2
mkfs.ext3 - EXT3
mkfs.ext4 - EXT4
mkfs.bfs - BFS
mkfs.msdos - MSDOS
mkfs.reiserfs - ReiserFS
mkfs.minix - Minix
mkfs.ntfs - NTFS
mkfs.vfat - VFAT (Fat32)

3. The -n (Volume-name) parameter specifies the name (label) of the created file system. The name of the flash drive or device partition must contain up to 11 characters. By default, no label is created. In our case, the section name is “System”.

4. Parameter -I. I don’t quite understand the purpose of this parameter, but without it I couldn’t format my memory card.

5. The dev (device) argument specifies the device to format (in our case /dev/sde1).

That's basically it.

Hello, this article will discuss a simple method formatting a USB flash drive in the Linux Mint operating system, this is a simple process, even a novice user can do it.

Linux Mint is one of the most popular free distributions of the Linux operating system, which is actively used as the main system on home computers.

If you are a novice user of Linux Mint who has just switched to using this distribution, then you most likely have many questions about how Linux Mint performs seemingly familiar and simple actions that do not cause you any problems in the Windows operating system. For example, the process of formatting a USB drive ( flash drives). In fact, formatting a flash drive in Linux Mint is even easier than in Windows, and now I’ll show you how it’s done.

I will show the whole process using the example of the Linux Mint 19 version with the MATE graphical shell; in another graphical environment, for example, Cinnamon, the process will be exactly the same, only the Mint menu will look a little different.

Forming a flash drive in Linux Mint

To format USB drives in Linux Mint, there is a standard application included by default in the distribution. That's what it's called " ».

This is a very simple program, it can only format flash drives, it doesn’t even have any settings. With this program you can format a flash drive into file systems: NTFS, FAT32, EXT4 And exFAT. ExFAT support was added only in version 19 of Linux Mint, so if you have an earlier version, you will not be able to format a flash drive to the exFAT file system with this application.

So, let's move on to a step-by-step examination of the process of creating a USB flash drive in the Linux Mint distribution.

Step 1 – Launch the program

To run the program " Formatting a USB flash drive", you need to go to the Mint menu and in the section " Standard» find the corresponding item.

Step 2 – Selecting a USB flash drive and target file system

After the program starts, we need to select the USB flash drive and the file system into which we want to format the flash drive ( I chose FAT32 as an example).

After specifying the required parameters, click “ Format».


The program can only be used with administrative rights, so next we will have a window for entering the administrator password. Enter the password and click " Authentication».


Step 3 - Finish Formatting

When a message appears stating that " USB drive successfully formatted", the USB flash drive formatting process will be completed. Click " OK».

Now you know how to format a flash drive in Linux Mint OS, and that this process is not at all difficult. That's all I have for now!

About how to erase a disk in Ubuntu, where it was noted that optical disks are becoming a thing of the past and are being replaced by various flash drives. In this regard, the question of how to format a flash drive in Ubuntu will be even more relevant than erasing the disk, so an article on this topic simply had to appear on our website.

In Linux, there are many ways to format flash drives, both with and without a graphical interface. In this article we will tell you how to format a flash drive in Ubuntu using the GUI. For this we will use the GParted program.

Installing GParted

Unfortunately, this program is not included in the standard distribution (it is on the LiveCD but is not installed on the hard drive), so you need to install it yourself, fortunately it is in the standard repository:

Sudo apt-get install gparted

After the installation is complete, you can begin formatting the flash drive.

Format a USB flash drive in Ubuntu

First of all, we connect our flash drive to the computer and after it is determined, launch GParted. It will require administrator rights, so you will need to enter your password:

The main program window will open, where the hard drive structure is displayed by default:

But we need a flash drive, so in the upper right corner we select it from the list, for me it’s /dev/sdb/ but it may be designated differently for you:

For each computer, a flash drive may have different designations, this depends on the number of connected media and the number of hard drives, so when choosing a media you need to be extremely careful, because if you choose the wrong one, you can format the hard drive and, as a result, lose important data. BE EXTREMELY CAREFUL!

We won’t be able to format the flash drive right away, since it is mounted, this is indicated by the key icon in the “Partition” field:

To unmount the media, you need to right-click on the flash drive partition and select “Unmount” from the context menu:

After the media is unmounted, right-click on it again and select “Format in”, where in the drop-down list you need to select the file system you need, for example fat32:

Now we apply the changes by clicking on the “bird” in the GParted toolbar:

We are warned that changing partitions could potentially result in data loss. Therefore, you need to be 100% sure that exactly the desired media is being formatted and after that you can click “Apply”:

And wait for the formatting operation to complete:

There is no person in the modern world who has never resorted to using removable storage devices. Users store various files on them, from multimedia content to work documents. Sometimes there is a need to completely delete data from the media. In Windows OS this procedure is simple and does not require special knowledge. Formatting a flash drive in Linux is a more complex operation, and skills are desirable here.

Formatting a flash drive in Linux

Common reasons for the need to clean a flash drive are incorrect operation and the user’s desire to completely get rid of all information. If in the second case the standard capabilities of the system help, then if the flash drive malfunctions, they resort to low-level formatting, in which the value “0” is written to all memory sectors.

In Linux, this procedure can be performed in various ways - through the terminal or using third-party utilities. The choice depends entirely on the user's preferences.

How to open a flash drive in Linux

If the system involves a desktop environment, then mounting the drive usually occurs with minimal human intervention. When you connect a device, its shortcut will appear on the desktop. Next, you need to right-click on it and select “Mount”.

Otherwise, the operation is performed manually. First you need to find out the file name of the flash drive. A simple option is to look at it in the /dev/ directory, but to be on the safe side it is better to use the fdisk utility.

After connecting the media, enter the command in the terminal:

A list of names of available disks with information about the size and file system of their partitions will appear on the screen.

Using this information, it becomes clear which name corresponds to the desired flash drive. The next process is to write two lines:

  • sudo mkdir /mnt/usb – create a mount directory;
  • sudo mount /dev/sdc2 /mnt/usb – direct execution.

The drive can now be used.

Important! Upon completion of the work, the flash drive must be unmounted with the following command to avoid data loss and damage to the file system: sudo umount /dev sdc2.

How to format a flash drive in Linux Mint

It is possible to format a flash drive using standard Linux Mint tools. The application is initially included in the OS distribution. It supports formatting in the following file systems:

  • NTFS;
  • FAT32;
  • EXT4;
  • exFAT (since Linux Mint 19).

The program is located in the “Standard” section of the main menu and is called “Formatting a USB flash drive.”

The application will prompt you to fill in the volume label (drive name), select the desired device and file system in which the flash drive will be formatted. On Linux, you will need to enter the administrator password to perform this operation. Upon completion, a message indicating the successful completion of the procedure will be displayed on the screen.

How to format a flash drive in Linux via terminal

In the terminal, the flash drive is formatted using the mkfs utility. It works with all file systems supported on Linux. Example of running mkfs for FAT32:

sudo mkfs -t vfat -L USBFLASH /dev/sdc2

The -L option allows you to specify the partition label.

In other formats the command is identical. For example, you can format a flash drive in ext4 by setting:

sudo mkfs -t ext4 - /dev/sdc2

Important! For the drive to work with Windows, formatting is done in FAT32.

How to format a flash drive in Linux using Gparted

The Gparted utility can format a flash drive in any OS running on the Linux kernel: Debian, Ubuntu, Mint and others. Usually it is already contained in the distribution. Otherwise it needs to be installed. This is possible using the Ubuntu Program Center, or by running the command in the terminal:

  • sudo apt install gparted – for Ubuntu users;
  • sudo yum install gparted - on systems whose distributions are based on Red Hat.

The program is launched by selecting it in the menu, or by executing:

The main window of the program contains information about all connected drives, so there shouldn’t be any problems finding the right flash drive.

First of all, the drive is unmounted by selecting the appropriate item in the context menu.

Next, you need to decide on the formatting principle. If the media previously had any OS, it must be completely wiped. Low-level formatting of a flash drive in Linux becomes possible only in this way. Otherwise, you can skip this point.

In the Edit menu section, select New Partition Table. Next steps you need to follow:

  1. Select MBR table type.
  2. Agree to data loss.
  3. By pressing the “+” button, create a new partition using the entire free memory.
  4. Select the file system to format.

After completing these steps, in the Edit section you need to click Apply to apply the changes. The flash drive is formatted, you can skip the next step.

If the previous steps are not necessary, then formatting becomes easier. To do this, call up the context menu of the flash drive, in which you select the Format to command.

How to format a disk in Linux

When performing subsequent operations, you need to be extremely careful, since even the slightest error can lead to disruption of the file system.

First, you need to view the list of block devices connected to your computer. This is done using the lsblk command. The utility shows disk names, their sizes and other media characteristics. In this case, there are two HDDs: one has the system installed, the second is intended for storing files.

To format a hard drive, the Parted utility is often used. It can be launched via the terminal:

You will need to enter the administrator password, since the work uses superuser mode. Upon successful entry, a program window will appear.

The next step is to create a partition table: MBR or GPT. Let the first type be selected, then enter the command into the terminal:

Here mklabel creates a table, and msdos assumes its type is MBR.

Directly creating partitions has a template:

(parted) mkpart |Partition type| |File system| |Start of the section| |End of section|

For example, if you need one partition that will take up the entire amount of memory, the template will look like:

(parted) mkpart primary ext3 1MiB 100%

For a 2 GB partition:

(parted) mkpart primary ext3 1MiB 2GB

The memory count for the third partition will now start at 2 GB, that is, if you want to set 3 GB, the entry looks like this:

(parted) mkpart primary ext3 1MiB 2GB 5GB

The print parameter is used to view the resulting table.

Now you can exit Parted and format the desired disk using the well-known mkfs utility.

Conclusion

Having encountered the problem once, the user understands that formatting a flash drive in Linux is not as difficult a task as it is thought to be. What’s unusual is that most operations have to be performed through the terminal console. In fact, this approach allows for a more flexible approach to formatting. If the terminal causes difficulties, utilities with an advanced graphical interface come to the rescue.







2024 gtavrl.ru.