relopfo.blogg.se

Linux how to format usb drive
Linux how to format usb drive











The following command will format using the NTFS Filesystem for use on Windows and some supported Linux distributions: sudo mkfs.ntfs /dev/sdb1 The following command will format using the FAT filesystem for use in Linux, Windows, and macOS: sudo mkfs.vfat /dev/sdb1 Format for NTFS Filesystem The following command will format using the EXT4 filesystem for use on Linux Systems: sudo mkfs.ext4 /dev/sdb1 Format for FAT/vFAT Filesystem Not all filesystems are supported on all operating systems, so choose one that works for you.īe warned – all files will be removed – so make sure you’re sure you want to remove everything on the drive and that you use the correct path to the device to avoid formatting the wrong drive. The mkfs set of commands will create an empty file system on a given device. The above command will unmount /dev/sdb1. Some systems will have mounted the drive automatically, and some will not have. You can’t format a drive that is in use, so the drive must be unmounted from the file system. The device names sdb/sdb1 may differ on your system! Make Sure the Drive Isn’t Mounted dev/sdb1 2048 61341695 61339648 29.3G c W95 FAT32 (LBA)Ībove, you can see the device /dev/sdb (the physical USB drive) and /dev/sdb1 – a FAT partition on that drive. I/O size (minimum/optimal): 512 bytes / 512 bytesĭevice Boot Start End Sectors Size Id Type Sector size (logical/physical): 512 bytes / 512 bytes Among them (hopefully last in the list to make it easy to find) will be the device you just plugged in: Disk /dev/sdb: 29.26 GiB, 31406948352 bytes, 61341696 sectors The fdisk command will output a list of storage devices attached to your system.

linux how to format usb drive

We’ll be using the sudo command frequently – many of these tasks require administrative privileges. Next, find the drive you just plugged in using the fdisk command to list ( -l) the attached storage devices: sudo fdisk -l

linux how to format usb drive

The first step – plug in your USB stick or external hard drive and give it a few moments to be detected. This article will show you how to format a USB stick or external USB hard drive from the Linux command line/shell for FAT, NTFS, and EXT file systems.













Linux how to format usb drive