Format usb device linux

Содержание
  1. How to Format a USB or SD Card in Ubuntu Linux
  2. Format USB disks on Ubuntu & other Linux distributions
  3. Troubleshooting when you cannot format the USB disk on Ubuntu Linux
  4. Step 1:
  5. Step 2:
  6. Step 3:
  7. Step 4:
  8. Step 5:
  9. Как отформатировать USB-накопители и SD-карту в Linux
  10. How to Format USB Drives and SD Cards on Linux
  11. В этом руководстве мы покажем вам, как отформатировать USB-накопитель или SD-карту в Linux с помощью parted утилиты.
  12. Установка parted
  13. Установить parted на Ubuntu и Debian
  14. Установить parted на CentOS и Fedora
  15. Определение имени USB или SD-карты
  16. Безопасное стирание данных (необязательно)
  17. Создание раздела и форматирование
  18. Форматировать с помощью FAT32
  19. Формат с EXT4
  20. Вывод
  21. How To Format USB Drive in Linux Command Line
  22. Step 1 – Attach USB to System
  23. Step 2 – Format USB Drive in Linux
  24. Conclusion
  25. How to Format USB Drives in Linux
  26. Which File System to Use for USB Formatting?
  27. Method 1: Format USB Using the Terminal
  28. Step 1: Locate USB Drive
  29. Step 2: Unmount and Format USB Drive
  30. Step 3: Verify USB Drive Formatting
  31. Method 2: Format USB Using Disk Utility
  32. Step 1: Open Disk Utility
  33. Step 2: Identify the USB Drive
  34. Step 3: Format the USB Drive
  35. Method 3: Format USB Using GParted Tool
  36. Step 1: Install GParted Tool
  37. Step 2: Start the Formatting Process
  38. Step 3: Start the Process

How to Format a USB or SD Card in Ubuntu Linux

Brief: Wondering how to format a USB or SD card on Ubuntu Linux? This screenshot tutorial teaches you exactly that along with a few hints about possible troubleshooting.

Formatting removable media like a USB disk or an SD card is a pretty simple task on Ubuntu Linux. No, I won’t be using the terminal here although you can always use the command line on Linux. I’m going to show you how to format a USB on Ubuntu or other Linux distributions graphically.

Format USB disks on Ubuntu & other Linux distributions

I’m using Ubuntu with the GNOME desktop environment in this tutorial, but it should be applicable to other Linux distributions and other desktop environments as well.

Plug in your USB or SD card. Now go to the File manager. You should see your USB or SD Card here.

Right click on it and you should see the format option.

When you hit the format option, it will give you the option to name the device and choose the filesystem.

When you’ve selected the appropriate options, hit the Next button in the top right corner.

Chose the filesystem on the USB

You’ll see a warning that all the data on the USB disk/SD card will be erased. That’s obvious.

Just hit the format button in the top right corner.

Your USB disk will be formatted in a few seconds or a couple of minutes at the most.

Once it’s formatted, you’ll see that it has reappeared in the file manager with the new name you gave it.

That’s it. That’s the standard way of formatting a USB drive on Ubuntu Linux.

Troubleshooting when you cannot format the USB disk on Ubuntu Linux

I never thought I would have trouble formatting a simple SD card or USB/pen drive until I encountered this problem on Ubuntu. When I looked at the options available by right clicking on the mounted removable disk, I found none for formatting.

So I tried using the default disk utility of Ubuntu: Disks. But it failed and gave me the following error:

Error formatting disk – Error synchronizing after initial wipe: Timed out waiting for object (udisks-error-quark, 0)

The above mentioned error is a known bug which has been unresolved for months – despite this, Disks is still being served as the default disk utility program (why?).

I had to go around and format the removable disk with the help of GParted. And thus I came up with this tutorial to help others learn how to format a SD card or USB key in Ubuntu.

Step 1:

Install GParted. It’s a free and open source partition manager for Linux. You can install it using the terminal (Ctrl+Alt+T):

Читайте также:  Не могу выключить защитник windows

Step 2:

Insert the SD card or USB key. Now launch GParted. To do that, go to the Unity dash and search for GParted. It takes some time to search for all the disks present on the system. Have some patience. When it’s recognized the drives, you’ll see a screen as below. By default it goes to the hard drive of your computer. To access removable media, go to the top-right corner of the application and choose the removable media. You can see the size of the removable media to identify the right one :

Step 3:

Now you’ll see a screen like the one below. This shows the partitions of the removable disk. Before you go for formatting, unmount the disk by right-clicking on the partition in the following manner:

Step 4:

Once you have it unmounted, right-clicking on it will show you the Format To option. You can choose whatever type of file system you want on the disk. Once you’ve selected the drive to format, click on the Tick sign at the top to start the process:

Step 5:

Nothing more needs to be done now. You will see a couple of warnings and then the format procedure will start.

Voila! You are done.

There is another possible formatting related issue. I’ve written another tutorial to fix this ‘error formatting volume’ issue in Ubuntu.

Was the tutorial helpful to you and were you able to format a USB key in Ubuntu? Any questions? Feel free to go to the comments section of the page.

Like what you read? Please share it with others.

Источник

Как отформатировать USB-накопители и SD-карту в Linux

How to Format USB Drives and SD Cards on Linux

В этом руководстве мы покажем вам, как отформатировать USB-накопитель или SD-карту в Linux с помощью parted утилиты.

Прежде чем вы сможете использовать SD-карту или USB-накопитель, его необходимо отформатировать и разбить на разделы. Как правило, большинство USB-накопителей и SD-карт предварительно отформатированы с использованием файловой системы FAT и их не нужно форматировать «из коробки». Однако в некоторых случаях вам может потребоваться отформатировать диск.

В Linux вы можете использовать графический инструмент, такой как GParted, или инструменты командной строки, такие как fdisk или, parted чтобы отформатировать диск и создать необходимые разделы.

Важно отметить, что форматирование — это разрушительный процесс, и он удалит все существующие данные. Если у вас есть данные на диске UDS или на SD-карте, обязательно сделайте резервную копию.

Установка parted

GNU Parted — это инструмент для создания и управления таблицами разделов. Пакет parted предустановлен в большинстве дистрибутивов Linux. Вы можете проверить, установлен ли он в вашей системе, набрав:

Если parted он не установлен в вашей системе, вы можете установить его с помощью менеджера пакетов вашего дистрибутива.

Установить parted на Ubuntu и Debian

Установить parted на CentOS и Fedora

Определение имени USB или SD-карты

Вставьте флэш-накопитель USB или SD-карту в компьютер с Linux и найдите имя устройства с помощью lsblk команды:

Команда выведет список всех доступных блочных устройств:

В приведенном выше примере имя устройства SD есть /dev/sdb , но оно может различаться в вашей системе.

Вы также можете использовать dmesg команду, чтобы найти имя устройства:

После того, как вы подключите устройство, dmesg отобразится имя устройства:

Безопасное стирание данных (необязательно)

Перед форматированием диска вы можете безопасно стереть с него все данные, перезаписав весь диск случайными данными. Это гарантирует, что данные не могут быть восстановлены никаким инструментом восстановления данных.

Вы должны полностью стереть данные, только если устройство будет отдано. В противном случае вы можете пропустить этот шаг.

Будьте очень осторожны перед выполнением следующей команды и безвозвратно сотрите данные с диска. of=. Часть dd команды должна указывать на целевой диск.

В зависимости от размера диска процесс может занять некоторое время.

Как только диск будет удален, dd команда выведет «Нет свободного места на устройстве»:

Создание раздела и форматирование

Наиболее распространенными файловыми системами являются exFAT и NTFS в Windows, EXT4 в Linux и FAT32, которые можно использовать во всех операционных системах.

Читайте также:  Mac os узнать открытые порты

Мы покажем вам, как отформатировать USB-накопитель или SD-карту в FAT32 или EXT4. Используйте EXT4, если вы собираетесь использовать диск только в системах Linux, в противном случае отформатируйте его в FAT32. Для большинства случаев достаточно одного раздела.

Форматировать с помощью FAT32

Сначала создайте таблицу разделов, выполнив следующую команду:

Создайте раздел Fat32, который занимает все пространство:

Отформатируйте загрузочный раздел в FAT32:

После этого используйте команду ниже, чтобы распечатать таблицу разделов и убедиться, что все настроено правильно:

Вывод должен выглядеть примерно так:

Это все! Вы отформатировали свое устройство.

Формат с EXT4

Создайте таблицу разделов GPT, выполнив:

Выполните следующую команду, чтобы создать раздел EXT4, который занимает все пространство:

Отформатируйте раздел в ext4:

Проверьте это, распечатав таблицу разделов:

Вывод должен выглядеть примерно так:

Вывод

Форматирование USB-накопителя или SD-карты в Linux — довольно простой процесс. Все, что вам нужно сделать, это вставить диск, создать таблицу разделов и отформатировать ее в FAT32 или предпочитаемой файловой системе.

Источник

How To Format USB Drive in Linux Command Line

USB formatting is the process of erasing all data from the disk and prepare it for use. Sometimes we are required to change the filesystem on our USB drive, In that case, we have to format the USB drive with the new filesystem type. Formatting a USB drive in Ubuntu using Terminal commands is much easier than formatting it in Windows systems.

This tutorial will help Ubuntu (Linux) users with the simple steps for format a USB flash drive using the command line.

Step 1 – Attach USB to System

Insert a USB drive into your system and identify your USB drive correctly. This is the step you need to take care, because you may format the wrong disk if not correctly identify your disk.

Now, You can see that the USD drive is attached as /dev/sdc1 device. Which is mounted on /media/tecadmin.

Step 2 – Format USB Drive in Linux

Whenever we attach a USB drive in Ubuntu, it is automatically mounted to the system. We can not format any disk on Linux systems that are already mounted. So first un-mount /dev/sdc1 USB drive on your system.

Now, Use one of the following commands as per the file system you want. To format a USB drive, most of the users prefer VFAT and NTFS file systems because they can be easily used on the Windows operating system.

  • Format with vFat File System
  • Format with NTFS File System
  • Format with EXT4 File System

Similarly, you can format a USB Flash drive with any required file system.

Conclusion

In this tutorial, you have learned to format a USB drive on a Linux system via the command-line interface.

Источник

How to Format USB Drives in Linux

Home » Bare Metal Servers » How to Format USB Drives in Linux

Occasionally, it is necessary to format the USB drive (for example, when changing the file system or deleting data). However, many Linux users are afraid to start the formatting process, thinking it is either a very complicated or time-consuming task.

In this tutorial, you will learn how to format the USB drive in Linux using three quick and simple methods:

  • Terminal
  • Disk Utility
  • GParted tool

  • A system running Linux
  • A USB drive
  • Access to the terminal/command line
  • A user account with sudo/root privileges

Which File System to Use for USB Formatting?

There are many file systems in use, differing by maximum file size and operating system compatibility. The most commonly used file systems when formatting a USB drive are:

Their main features and differences are:

File System Supported File Size Compatibility Ideal Usage
FAT32 up to 4 GB Windows, Mac, Linux For maximum compatibility
NTFS 16 EiB – 1 KB Windows, Mac (read-only), most Linux distributions For internal drives and Windows system files
exFAT 16 EiB – 1 KB Windows, Mac, Linux (requires extra drivers to access) For files larger than 4 GB

Method 1: Format USB Using the Terminal

The easiest and fastest way to format a USB drive in Linux is through the terminal. The procedure consists of three steps:

  1. Locating the USB drive.
  2. Unmounting and formatting the USB drive.
  3. Verifying the process was successful.
Читайте также:  Google chrome windows services

Follow the instructions below to format a USB drive using the terminal.

Step 1: Locate USB Drive

Open the terminal and run the following command:

The terminal prints out a list of all mounted partitions and relevant information: used space, available space, used space percentage, and the path.

Locate the USB in the list and find the corresponding device. In this example, the USB drive is /dev/sdb1 .

Note: If you are unsure of the drive designation, unplug the USB drive temporarily before running the df command again. The device that is now gone from the list is your USB device.

Step 2: Unmount and Format USB Drive

Unmount the USB drives before formatting. To do so, run this command:

After unmounting, format the USB drive using the preferred file system (replace sdb1 with the name of your device):

  • To format a USB drive with FAT32 file system, use:
  • To format a USB drive using the NTFS file system run:
  • To format a USB drive in accordance with the exFAT file system use:

Step 3: Verify USB Drive Formatting

Confirm the formatting process has completed successfully:

A USB drive with no files indicates successful formatting.

Method 2: Format USB Using Disk Utility

The GNOME Disk Utility is a graphical tool for partitioning and formatting storage drives in Linux.

Follow the outlined steps to format a USB drive using the Disk Utility tool.

Step 1: Open Disk Utility

To open the Disk Utility:

  1. Launch the Application menu.
  2. Type “disk” in the search bar.
  3. Click the Disks icon.

Step 2: Identify the USB Drive

Locate the USB drive from the left pane and select it. The right pane contains details about the drive, such as model name, size, serial number, and contents.

Step 3: Format the USB Drive

1. Click the gear icon and select the Format Partition option from the drop-down menu.

2. Type the preferred name for the USB drive.

Optionally, enable the Erase option to overwrite the existing data from the USB drive. Choose the file system format and click on the Next button.

3. A pop-up appears with a warning message about data deletion and formatting details. Start the formatting process by clicking the Format button.

4. The progress line displays the remaining time until the formatting process completes. Close the Disk Utility when the job completes.

Method 3: Format USB Using GParted Tool

Formatting via GParted takes the most time as it involves an additional step – installing the tool. However, it is a handy tool that you can use even after you have finished formatting the USB drive.

Follow the steps below to format a USB drive using the GParted tool.

Step 1: Install GParted Tool

1. Open the terminal and install the GParted tool using this command:

Confirm the installation by pressing y and then hit Enter. Wait until the process completes.

2. Run the GParted tool with:

The terminal loads the GParted home screen.

Step 2: Start the Formatting Process

1. Select the /dev/sdb option from the drop-down menu at the top of the GParted home screen.

2. Right-click the /dev/sdb1 partition and select Format to. Choose the preferred file system from the list to continue.

Step 3: Start the Process

1. Click the green checkmark button to apply all operations.

2. A pop-up appears with a warning message about data deletion. Click Apply to continue.

The GParted formats the drive. The time required for the formatting process varies depending on the size and type of the USB drive.

3. Click the Close button to exit the menu when the operation completes.

In this article, you learned how to format a USB drive in Linux using several methods. Additionally, we went through the main features and differences between the three most commonly used file systems.

Источник

Оцените статью