ComputersEquipment

Formatting the flash drive via the command line without losing data

Without flash drives it is difficult to imagine the modern life of an office or an ordinary user today. Send data from computer to computer, pass a report or keep something important and intimate - all this is possible thanks to removable storage media. All flash drives are delivered from the factory already formatted. As a rule, their file system is FAT32. In the modern world, it is already obsolete, since it has several significant drawbacks. Among them, you can identify the inability to move files to the flash drive more than 4 GB, as well as a limitation on the size of partitions hard drives.

A little bit about file systems and their differences

The Windows OS has been using the FAT file system since its launch. Its more advanced version is FAT32. Following it goes NTFS, which appeared in Windows XP.

The difference in the data of representatives of file systems is the restriction on the size of the allocated files and partitions. FAT16 can use up to 2 GB, FAT32 - up to 4 GB for the file and 8TB for the volume. More modern NTFS can manage files and partitions up to 16 exabytes. However, there is a limit on the length of the path, which must be no more than 255 characters.

Apple uses the HFS + file system for its hardware. It also has a limit on the length of the path name or file of 255 characters. It's worth remembering when creating documents automatically or saving them. The file and partition sizes can be up to 8,000 petabytes.

Linux distributions use a line of ext filesystems. Its latest version is ext4, which is still in use since 2008.

Interestingly, Linux-systems can safely work with file systems FAT, FAT32 and NTFS. But the Windows environment does not even see the ext and derivative partitions without additional software.

How to format the flash drive via the command line

A newer and more modern file system is NTFS. It can work effectively with large partitions and files. In addition, its speed is much higher than its predecessor. Also, the reliability when placing data on a partition and indexing them helps to take a place more optimally for both performance and volume.

In order to format the flash drive via the command line from FAT32, there are several ways to NTFS.

Standard Operating System Tools

All OS families of Linux and Windows are equipped with standard utilities that can format the flash drive via the command line. First you need to deal with the Windows system. It has a utility for formatting the flash drive via the command line - diskpart. Since this is a system program and affects important areas of the OS, it should be run as administrator.

Run in Windows it is possible by going to the Start menu, then "All Programs" - "Standard". Here you need to right-click on the "Command line" item and select "Run as administrator".

A command window opens. It is enough to type diskpart and press "Enter". Now the further input of commands will be broadcast through the utility and executed by it.

To start the formatting process, type format Z: / FS: NTFS. Here, Z stands for the drive letter of the flash drive. And the FS key and the NTFS instruction tell the utility that it is necessary to format the disk in the NTFS file system.

The only drawback of this method is that if there were files on the flash drive, they would be lost hopelessly.

Formatting the flash drive via the command line without losing data

In fact, this task is impossible. You can not format a drive without erasing the data. But you can convert from one file system to another. The utility diskpart can also help here. How to run it from the administrator is described above. Next, you need to enter the list volume command. It will display a list of all available partitions and disks with their letters and volumes. The following command is a list disk. It will show the presence of all physical drives in the system. Discs can be marked with the digits 0, 1, 2 and so on.

Now, by calling the select disk 1 command, the desired drive is selected. Then convert ntfs. указанный диск обрет ё т файловую систему NTFS. After that, the specified drive acquires the NTFS file system.

other methods

Before that, the methods of formatting the flash drive through the Windows 7 command line were shown. But what if you need to perform this procedure under Ubuntu or Debian? Next, a method of formatting a flash drive via the Linux command line will be described.

More precisely, it is called in Linux a terminal or console. You can open it by pressing Ctrl + Alt + T. Then you need to see the list of connected devices. This can be done with the fdisk -l command.

In this case, the flash drive is listed under the name / dev / sdb1. In Linux, you need to unmount them to work with changing partitions or disks. This is necessary in order to gain access to data that can be used at the moment.

But in order to make sure that the drive is unmounted, you should type a simple command:

Df -h

After pressing Enter, the screen displays a list of all the devices that are currently mounted. If something like / dev / sdb1 is present in it, then, therefore, it is necessary to disconnect it. This is done with the umount / dev / sdb1 command.

Now you can format the flash drive via the command line. For this, there is a built-in mkfs command. It needs to pass several parameters to the input. First, it's a file system. In this case - ntfs. By the way, this utility can be used to format the flash drive via the command line in fat32. Next, you must specify a name or label for the drive. Well, the last - the way to the flash drive. In the end, this should look like this:

Mkfs.ntfs labelname / dev / sdb1.

After the process is completed, you will get a USB flash drive with a new NTFS file system.

Third-party programs for formatting

Some manufacturers of removable drives have their own software for fast and reliable formatting in a convenient graphical interface. There are also programs from third-party developers. The following is a list of the most commonly used products:

  • HP USB Disk Storage Format Tool. Probably the most famous program. Its interface is simple and resembles the standard windows of the operating system.
  • Transcend Autoformat. This utility is used mainly for mobile storage formats - SD, MMC, CF.
  • HDD Low Level Format Tool. A utility that does formatting at a low level. Sometimes it helps to bring a flash drive or hard disk back to life. It supports many devices and has a wide range of functions.
  • SD Formatter is a very simple and easy program. Used mainly for formatting flash drives for mobile devices. The interface is simple and clear, and the license for its use is free.

Conclusion

применения командной строки. In many operating systems, there are more elegant ways of formatting, without using the command line. Using the graphical interface, you can also easily accomplish this task. Formatting a flash drive via the command line is intended primarily for a low-level process, when other methods do not help.

There are also more complex and multistep methods of resuscitation of flash drives. отдельно на каждый контроллер накопителя . They use special programs, oriented separately to each controller of the drive . But this information is beyond the scope of this article.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.birmiss.com. Theme powered by WordPress.