Format usb drive for Windows from Linux
From time-to-time you will need to give format to an usb drive in your Linux system, for example to backup important files or just share data with a colleague. In this recipe I will show you the commands you could use in Debian/Ubuntu.
First start plugging the USB and then check where the system recognise it, for that use:
|
|
It will show you at the end of the report, in that locate the lines that says “usb” and “New USB device found”, below those oyu will find messages from other modules/drivers that says “sd” and between square brakts you will find the device name like “[sdb]” and below yu will find fro example “sdb: sdb1”, sbd1 is the name you are looking for.
Make sure is not mounted you can check it with:
|
|
you can dismount with:
|
|
the tool we are going to use is mkfs, if is not installed in your system, you can execute sudo apt install dosfstools
now you are ready to go, for the format execute:
|
|
where:
- -c : to check the device for bad blocks before building the file system
- -n <drive_label> : to give your drive a label
- -t : used only by mkfs specify the type of file system
Checking the drive after the format is done:
|
|
done! you have a new USB that you can use in windows and also in linux.
G