LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-05-2009, 11:11 PM   #1
umwai
Member
 
Registered: May 2008
Location: Sri Lanka
Distribution: Ubuntu
Posts: 57
Blog Entries: 1

Rep: Reputation: 16
Unhappy Formating a Pen drive


How to Format a pen drive using terminal. (How to find my pen drive inside the /dev folder )
 
Old 02-05-2009, 11:21 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,043

Rep: Reputation: 375Reputation: 375Reputation: 375Reputation: 375
You can start with fdisk -l

You could as well write an udev rule so it's always named the same way. That way you don't have to hunt for it.

http://reactivated.net/writing_udev_rules.html
 
Old 02-11-2009, 01:34 AM   #3
umwai
Member
 
Registered: May 2008
Location: Sri Lanka
Distribution: Ubuntu
Posts: 57
Blog Entries: 1

Original Poster
Rep: Reputation: 16
Thumbs up Formating a Pen drive

Thanks i92guboj
 
Old 02-11-2009, 06:45 AM   #4
cloud9repo
Member
 
Registered: Oct 2008
Location: Middle TN
Posts: 134

Rep: Reputation: 19
Quote:
Originally Posted by umwai View Post
How to Format a pen drive using terminal. (How to find my pen drive inside the /dev folder )
parted and mkfs usually work. mkfs is included in parted, which is the way it's recommended to use it.

As a super user, and in a terminal, type parted.
Within the commands prompts, the help command will list available options.

There's also info on the Inet.
 
Old 02-11-2009, 07:06 AM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,043

Rep: Reputation: 375Reputation: 375Reputation: 375Reputation: 375
Quote:
Originally Posted by cloud9repo View Post
parted and mkfs usually work. mkfs is included in parted, which is the way it's recommended to use it.
Mmmm, if you are talking about the regular mkfs tool then

A) it's not part of parted, it's an independent tool
B) it not recommended or discouraged to run it from within parted. mkfs existed much before in fact. If you just want to reformat a partition there's absolutely no sense in installing parted just for that. Just mkfs is all you need and it works ok, plus you can probably fine tune it better.

Parted is good at partitioning, but it's not needed at all if you just want to reformat.
 
Old 02-11-2009, 08:37 AM   #6
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Want to know what /dev your USB memory stick is ? A couple simple commands will take care of that for you..
Issue the following command and then plug in your drive, so you can watch it being detected.
Code:
it-lenny:~# tail -f /var/log/messages
Feb 11 05:45:58 it-etch -- MARK --
Feb 11 06:05:59 it-etch -- MARK --
Feb 11 06:25:59 it-etch -- MARK --
Feb 11 06:45:59 it-etch -- MARK --
Feb 11 07:05:59 it-etch -- MARK --
Feb 11 07:26:00 it-etch -- MARK --
Feb 11 07:46:00 it-etch -- MARK --
Feb 11 08:06:00 it-etch -- MARK --
Feb 11 08:07:00 it-etch syslogd 1.5.0#5: restart.
Feb 11 08:26:00 it-etch -- MARK --
Feb 11 08:30:30 it-etch kernel: usb 6-7: new high speed USB device using ehci_hcd and address 19
Feb 11 08:30:30 it-etch kernel: usb 6-7: configuration #1 chosen from 1 choice
Feb 11 08:30:30 it-etch kernel: scsi18 : SCSI emulation for USB Mass Storage devices
Feb 11 08:30:35 it-etch kernel:   Vendor: USB 2.0   Model: Flash Disk        Rev: 1100
Feb 11 08:30:35 it-etch kernel:   Type:   Direct-Access                      ANSI SCSI revision: 00
Feb 11 08:30:35 it-etch kernel: SCSI device sdb: 3963904 512-byte hdwr sectors (2030 MB)
Feb 11 08:30:35 it-etch kernel: sdb: Write Protect is off
Feb 11 08:30:35 it-etch kernel: SCSI device sdb: 3963904 512-byte hdwr sectors (2030 MB)
Feb 11 08:30:35 it-etch kernel: sdb: Write Protect is off
Feb 11 08:30:35 it-etch kernel:  sdb: sdb1
Feb 11 08:30:35 it-etch kernel: sd 18:0:0:0: Attached scsi removable disk sdb
Feb 11 08:30:35 it-etch kernel: sd 18:0:0:0: Attached scsi generic sg1 type 0
As you can see the system identified the USB Flash drive I plugged in is /dev/sdb


My listing shows there is already a partition on my USB drive (sdb1) and I know the default file system for flash drives is fat32.

if I wanted to reformat the USB drive as fat32 from the command line I would use mkdosfs.

http://wiki.linuxquestions.org/wiki/Mkdosfs
 
  


Reply

Tags
shell


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot iso on pen drive by grub installed on pen drive jena Linux - Hardware 2 11-01-2008 10:09 AM
Formating a USB Drive lmcilwain Fedora 3 09-29-2007 12:19 AM
formating hard drive icanspellnew Linux - General 9 11-13-2004 04:56 PM
Formating Hard Drive Zakane Linux - Newbie 20 08-25-2003 01:13 PM
Formating 2 hard drive Tenchi147 Linux - Hardware 1 05-31-2003 06:01 PM


All times are GMT -5. The time now is 01:33 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration