LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-16-2010, 01:20 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Label and Format USB Drive


I have a USB thumb drive that I just partitioned using the 'fdisk' utility in Linux. Now I am trying to learn the command that will allow me to format the drive as 'fat32' while also setting the disk label on the device as "ocz_usb" when the drive gets mounted. Does anyone know the command I would use that will format the USB drive and properly set the disk label at the same time?
 
Old 06-16-2010, 02:09 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
The command would be something like:

Code:
mkdosfs -n ocz_usb /dev/device
Where device would be whatever your flash drive is (say, /dev/sda). Depending on the size of the drive, you might also want to use the "-F" option to enable 32 bit mode, as my understanding is that this is still set to 16 bit by default.
 
Old 06-16-2010, 02:14 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
I don't understand why my Linux system is telling me that it doesn't exist:

Code:
[root@tuna ~]# mkdosfs -F 32 -n oczusb /dev/sdd1
mkdosfs 3.0.9 (31 Jan 2010)
/dev/sdd1: No such file or directory
I know it's there because I see it 'dmesg' and I can format it with the 'fdisk' utility.

Code:
usb 1-4: new high speed USB device using ehci_hcd and address 6
scsi10 : usb-storage 1-4:1.0
scsi 10:0:0:0: Direct-Access     OCZ      CROSS OVER       0.00 PQ: 0 ANSI: 2
sd 10:0:0:0: Attached scsi generic sg5 type 0
scsi 10:0:0:1: Direct-Access     OCZ      SD0StorageDevice 0.00 PQ: 0 ANSI: 2
sd 10:0:0:0: [sdd] 15794176 512-byte logical blocks: (8.08 GB/7.53 GiB)
sd 10:0:0:1: Attached scsi generic sg6 type 0
sd 10:0:0:0: [sdd] Write Protect is off
sd 10:0:0:0: [sdd] Mode Sense: 00 00 00 00
sd 10:0:0:0: [sdd] Assuming drive cache: write through
sd 10:0:0:1: [sde] Attached SCSI removable disk
sd 10:0:0:0: [sdd] Assuming drive cache: write through
 sdd:
sd 10:0:0:0: [sdd] Assuming drive cache: write through
sd 10:0:0:0: [sdd] Attached SCSI removable disk
 
Old 06-16-2010, 03:36 PM   #4
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
That log output shows that while it detects the drive itself, it doesn't see any partitions on it. So that would seem to indicate there was a problem when you partitioned it with fdisk. Try something like the following, and see what it lists:

Code:
fdisk -l /dev/sdd
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] /dev/disk/by-label DISAPPEARED! Can't mount USB flash drive ShellyCat Linux - Desktop 5 11-16-2010 11:30 PM
Label a Drive During the Format Command carlosinfl Linux - General 3 12-18-2009 03:17 PM
How to format a USB drive? JeffC1 Linux - Newbie 6 02-25-2009 12:15 PM
can't change the disk label of my new 500gig usb drive oskar Linux - Hardware 12 08-01-2007 06:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:57 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration