format thumb drive

Amedee Van Gasse amedee-ubuntu at amedee.be
Sun Mar 14 12:47:59 UTC 2010


On 13-03-10 17:01, William Biggs wrote:
> I need to format my thumb drive I need to know how ?
>
I can tell you how I would do it, and my method works for all Linux 
distributions (works also for BSD). But perhaps it's not the recommended 
Ubuntu way.

All actions are done in a console. No GUI software needed.


1. Unplug the thumb drive

2. Plug the thumb drive.

3. Type 'dmesg'. You will get something like this at the end:

usb 1-6: new high speed USB device using ehci_hcd and address 3
usb 1-6: configuration #1 chosen from 1 choice
scsi9 : SCSI emulation for USB Mass Storage devices
usb 1-6: New USB device found, idVendor=05dc, idProduct=0200
usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-6: Product: JUMPDRIVE PRO
usb 1-6: Manufacturer: LEXAR   MEDIA
usb 1-6: SerialNumber: H158081127070315AA
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
usb-storage: device scan complete
scsi 9:0:0:0: Direct-Access     LEXAR    JUMPDRIVE PRO    0    PQ: 0 ANSI: 2
sd 9:0:0:0: [sdg] 2014992 512-byte hardware sectors (1032 MB)
sd 9:0:0:0: [sdg] Write Protect is off
sd 9:0:0:0: [sdg] Mode Sense: 6b 00 00 00
sd 9:0:0:0: [sdg] Assuming drive cache: write through
sd 9:0:0:0: [sdg] 2014992 512-byte hardware sectors (1032 MB)
sd 9:0:0:0: [sdg] Write Protect is off
sd 9:0:0:0: [sdg] Mode Sense: 6b 00 00 00
sd 9:0:0:0: [sdg] Assuming drive cache: write through
sdg: sdg1
sdg1: <bsd: >
sd 9:0:0:0: [sdg] Attached SCSI removable disk
sd 9:0:0:0: Attached scsi generic sg7 type 0

/dev/sdg is the device name of the thumb drive, and /dev/sdg1 is the 
device name of the first partition. Some thumb drives (Kingston and some 
other brands) also have a second partition /dev/sdg2 for their U3 software.

4. Make sure that the thumb drive isn't mounted. Type 'mount' to see all 
the mount points. If you don't see /dev/sdg1 then continue to the next 
step. If it's there, type 'sudo umount /dev/sdg1', then type 'mount' 
again to confirm that it's unmounted.

5. If there is more than one partition on the thumb drive (U3 devices) 
then you can remove all partitions with fdisk. That is outside the scope 
of my answer.

6. format the first (and only?) partition on the thumb drive with one of 
these:
sudo mkfs.ext2 /dev/sdg1
sudo mkfs.vfat /dev/sdg1

Use ext2 if you are only going to use it with Linux, and vfat if you are 
also using it with Windows or Mac. You could also use ext3 or ex4 or 
others, but I usually don't bother.


-- 
Amedee




More information about the kubuntu-users mailing list