Posted by: Niko | January 12, 2007

How to format USB memory stick in Linux

1. To find out the USB device name run fdisk -l
In this case my stick is /dev/sdb1
2. Make sure the memory stick isn’t mounted. To unmount run umount /dev/sdb1
3. To format with ext3 filesystem run mkfs.ext3 /dev/sdb1
4. To label your stick run e2label /dev/sdb1

About these ads

Responses

  1. muchisimas gracias, era lo que necesitaba para formatear un disco de 250Gb con ext3

  2. Thank you, just what I needed.

  3. perfect, the “security” (root) was “deleted” when i used the terminal but the USB flash drive still had data on it.

    I formated it using the formating tool on XP (right click on the disck => format) and it worked. Thx a lot for the help. Im a new user of linux and i really appreciate its capacity to “solve” problems:)

    hope i was clear!!

  4. Thanks man, simple and efficient.

  5. Watch out! see “http://wiki.laptop.org/go/How_to_Damage_a_FLASH_Storage_Device” for why this is a bad idea for a disk which will get heavy use.

  6. oh well… those sticks are like a couple of bucks for a 4 or 8 Gigs version. I wouldnt worry too much if not for the data on them, but hey, that should be backed up in the first place before messing with these sticks LOL :-)

  7. Hi,

    I got a Toshiba 4GB stick as a present. I deleted all the files in it. When I mount it I get two devices: Toshiba and U3 system. U3 system has three files in it. U3Lauchpad.zip, autorun.inf and launchU3.exe. What ever I do I can not erase them. When I tried to format it I get “Read-only file system while setting up superblock” message when I give “mkfs.ext3 /dev/scd1″ command. How can I have a clean stick just to use in Linux?

    Many thanks

    • You should be using sudo
      “sudo mkfs.ext3 /dev/scd1″

  8. Is there a particular reason you’re formatting your USB key in ext3? Machines running Windows aren’t natively able to access ext3 partitions, and your device is going to lose space and slow down because ext3 is a journaled file system.

    @Osman: Try wiping all the partitions on the device before you create a new file system. See if my post helps:

    http://www.bytetrap.com/blog/2009/04/13/formatting-usb-stick-arch-linux/

  9. Thanks, works great.
    Reason #1 for using a ext3 stick is file names.
    FAT sticks can’t handle upper and lower case.
    Reason #2 is security, Windows people can’t read you files
    Reason #3, related to #2, is you now have file permission settings available to you.

  10. Here is a command line method to format a usb in linux http://blog.sriunplugged.com/linux/how-to-format-a-usb-in-linux/

  11. there is a graphical tool developed to format usb/flash stick/memory in linux, its easy to use and install please check this link

    http://cha-wares.blogspot.com/

    enjoy!

  12. [...] http://nikste.wordpress.com/2007/01/12/how-to-format-usb-memory-stick-in-linux/ [...]

  13. [...] http://nikste.wordpress.com/2007/01/12/how-to-format-usb-memory-stick-in-linux/ [...]

  14. i have a Iball 8 gb pen drive when i try to format, it shows a massage “can not formatted the disk is write protected” i use many tricks but fails.please tell me how i formate it.?
    operating system windows 7, & windows xp


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: