Niloc Posted June 27, 2009 Share Posted June 27, 2009 In the past whenever I wanted to empty a memory stick of all data, I borrowed a Windows machine and used 'Format'. Is there an equivalent Linux command?? Colin Link to comment Share on other sites More sharing options...
Tywais Posted June 27, 2009 Share Posted June 27, 2009 mkfs, the primary command (front end) with sub commands depending on the format required. http://www.go2linux.org/mkfs-linux-command-line http://linux.about.com/od/commands/l/blcmdl8_mkfs.htm Link to comment Share on other sites More sharing options...
Niloc Posted June 27, 2009 Author Share Posted June 27, 2009 Thanks Tywais but how on earth do I specify the device I want to format? Link to comment Share on other sites More sharing options...
Tywais Posted June 27, 2009 Share Posted June 27, 2009 Thanks Tywais but how on earth do I specify the device I want to format? I take it you have not mounted a Flash drive on your linux box? If you have, it will be the same /dev/xxx as that one. As mentioned in the article, need to be sure you select the right device. Normally the main hard drive will be /dev/hda or /dev/sda followed by a 1, 2, etc for the partition. Example /dev/hda1 (or /dev/sda1 depending on your system) will be the first hard drive first partition. Normally the Flash drive will be /dev/sdb. Best way to check is try mounting the flash drive to determine which device is correct. You can make a test directory such as "mkdir /test" (without parenthesis) then "mount -t vfat /dev/sdb1 /test" and then do a "ls -la /test" to see if the files show up on it. It may be vfat or vfat32 depending on how it was formatted in windows. Link to comment Share on other sites More sharing options...
RKASA Posted June 27, 2009 Share Posted June 27, 2009 You can use any of the programs that are used to make a partition. exp gparted a gui program, just start it and select the device like sdb and partition you want to format and click click. You get the warning format will distroy the data on that partition. etc. Just like disk managment in windows only ten time as many options in format type from fat16 to ntfs another is qtparted there are about ten of them out there. You will see all the partition on the PC with these make sure you don't select the wrong one, but its normally pretty easy if you have ever uses the windows one before. its just about the same thing with differant colour used to show the differant type of formats in use. no commandline needed for this. You can even get livecd versions of these programs to clean and build drives before use. Link to comment Share on other sites More sharing options...
Tywais Posted June 27, 2009 Share Posted June 27, 2009 exp gparted a gui program, I figured there must be a GUI version on the distributions, but not sure which one the OP is using. Since I run only Linux servers, I do nearly everything by command line and should have looked up the GUI versions. That sounds like a simpler method as long as the right device is determined. Just a small correction in your reply regarding "any of the programs that are used to make a partition." I use cfdisk exclusively, a standard partition app with all distributions. You have to then format with another application such as mkfs after running it. Link to comment Share on other sites More sharing options...
jackdanielsesq Posted June 27, 2009 Share Posted June 27, 2009 A word to the wise - most thumbdrives use MS Fat16/32 as the file medium. This is not the same as the GParted/cfdisk/etc utilities we use in Linux. I didnt know this either, but it was discussed extensively on another forum. It has - clearly - to do with MS compatibility, etc. Dual boot. Find another GF - one with M$. That also does not guarantee that ya wont format root/C\:/yadda by accident!!!! BR>Jack Link to comment Share on other sites More sharing options...
higgy88 Posted June 27, 2009 Share Posted June 27, 2009 I use gparted (aka partition editor), which came as standard equipment on Ubuntu, to reformat all of my flash drives FAT 32 on a regular basis, and never had a problem with using them on Windows. Actually, they are immediately reformated and sanitized using linux any time they have been used on a public computer, such as a photo shop, before they even get close to my Windows machine. Link to comment Share on other sites More sharing options...
PastEgo Posted June 27, 2009 Share Posted June 27, 2009 higgy88 same here, unline windows you don't have to download another format prog to do the job lol do i miss the viruses no PastEgo Link to comment Share on other sites More sharing options...
Tywais Posted June 27, 2009 Share Posted June 27, 2009 Step by step guide to formatting a Flash drive as FAT16/FAT32 or other file system formats using Ubuntu and GParted > Format a USB Flash Drive Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now