If you had used the fdisk command without the block device as an argument, it would have simply printed out the information for all recognized devices. We used the fdisk command with an argument to make the output less cluttered and more relevent. The sector size is 512 bytes long, and it has one partition, "Microsoft basic data" which is know is a FAT partition. This output shows that our device (the flashdrive) has a capacity of 14.9 GiB (or 15.99 GB). Sector size (logical/physical): 512 bytes / 512 bytes The output would look sudo fdisk -l /dev/sdaĭisk /dev/sda: 14.9 GiB, 16008609792 bytes, 31266816 sectors
#How to format usb drive on linux password#
You will need superuser access for this, simply insert your password to give it access: To see more details about the device and partition, invoke the "fdisk -l" command with the block device (sda in this case) as an argument. The numbers after the letters demarcate the various partitions present on the device. In this case it's sd a but it could also be sd b or sd c depending on your configuration. Usually a newly plugged in USB drive shows up as sd X with X being a letter. This shows the boot MicroSD card and its various partitions.
If you had ran the lsblk command before plugging in the USB device, you'd have only seen entries under "mmcblk1". Running it on your board should show something similar to the lsblk The first is issuing the command lsblk - List Block devices: There are two quick ways we can confirm that the USB drive is "recognized" by the system. Plug in your USB device into your board and open up a terminal, either locally or via SSH. Some basic understanding of using the linux terminal: Howtogeek Confirm that the drive is recognized by Linux We will also briefly go over setting file and directory permissions for the newly created volume.Īccess to terminal, either locally or via SSH
#How to format usb drive on linux how to#
We will also be going through how to "mount" the volume to allow the system and user (you) to modify and read from it.
It will also show you how to format the device for use under linux (Recommended but not necessary, most linux distros are happy to read/write to Windows filesystems). This guide will show you various ways to view connected USB storage devices under linux.