ceb0 How-To repartiton (format) a USB flash drive. - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Miscellaneous > Howtos & FAQs (Moderated)

Howtos & FAQs (Moderated) Would you like to share some of your solutions for certain problems? Tips or tricks? Post here. All new topics are automatically moderated.

Reply
 
Thread Tools Display Modes
  #1  
Old February 12th, 2010, 14:29
michaelrmgreen's Avatar
michaelrmgreen michaelrmgreen is offline
Member
 
Join Date: Nov 2008
Location: The Peoples Republic of Couch
Posts: 193
Thanks: 35
Thanked 15 Times in 13 Posts
Default How-To repartiton (format) a USB flash drive.

The partition and formatting on a USB flash memory drive is sometimes a bit faulty.

Symptoms include (but are not limited to) FreeBSD complaining about the start and/or end of the partiton not being on a track boundary, the total number of sectors not being a multiple of the number of tracks, the drive not being recognised especially in MS Vista and errors when saving files in Windows.

If you have a malfunctioning USB stick try this:

Copy off any files you want to keep. (important)

Plug in the stick and check what device it is recognised as. It's usually da0 if you don't have any SCSI drives. But CHECK.

Now remove the existing partiton information:
# dd if=/dev/zero of=/dev/da0 bs=2m count=1

Create a new slice/partiton
# fdisk -i /dev/da0
In the interactive section accept the defaults except for sysid, which is 165 for FreeBSD but for FAT32 is 12.
Ignore the 'fdisk: Class not found' error.

Create a new file system ('format')
# newfs_msdos -F32 /dev/da0s1

Enjoy working USB drive.

Last edited by DutchDaemon; February 12th, 2010 at 21:12. Reason: added [cmd] tags
Reply With Quote
The Following 2 Users Say Thank You to michaelrmgreen For This Useful Post:
bebuxe (January 26th, 2011), Huckey (May 7th, 2011)
  #2  
Old February 12th, 2010, 14:50
graudeejs's Avatar
graudeejs graudeejs is offline
Style(9) Addict
 
Join Date: Nov 2008
Location: Riga, Latvia
Posts: 4,523
Thanks: 422
Thanked 607 Times in 475 Posts
Default

Why would one want to partition usb flash?
Simply run newfs_msdos /dev/da0, and it works well
Reply With Quote
  #3  
Old February 12th, 2010, 16:27
michaelrmgreen's Avatar
michaelrmgreen michaelrmgreen is offline
Member
 
Join Date: Nov 2008
Location: The Peoples Republic of Couch
Posts: 193
Thanks: 35
Thanked 15 Times in 13 Posts
Default

Hmmm, now I'm going to have to find another USB drive with a wonky filesystem to try that on.
Reply With Quote
  #4  
Old February 12th, 2010, 19:22
Ruler2112's Avatar
Ruler2112 Ruler2112 is offline
Member
 
Join Date: Sep 2009
Location: Michigan, USA
Posts: 408
Thanks: 11
Thanked 23 Times in 21 Posts
Default

Quote:
Originally Posted by killasmurf86 View Post
Why would one want to partition usb flash?
Simply run newfs_msdos /dev/da0, and it works well
I've seen a flash drive get a corrupted partition table before. No idea how it got that way, but the above is exactly how I was able to make it usable again. (After playing with it to recover the data off of it of course, but that's another discussion.)
Reply With Quote
  #5  
Old February 12th, 2010, 20:29
fronclynne's Avatar
fronclynne fronclynne is offline
Senior Member
 
Join Date: Feb 2009
Location: Lunch Time
Posts: 1,297
Thanks: 132
Thanked 166 Times in 143 Posts
Default not to have some secret install that I use for unsavoury activities

Quote:
Originally Posted by killasmurf86 View Post
Why would one want to partition usb flash?
Simply run newfs_msdos /dev/da0, and it works well
8g flash drive, don't need 8G of fat32 storage*, would like to also have a small install of freebsd (for testing, obviously).



*okay, I didn't need an 8G flash drive at all, but the dang thing was on sale for less than a 4G drive
__________________
Quid habemus reliquum?
Nutrimentum anatum!

Внимание: лифт вниз не поднимает
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] USB flash drive woes Eponasoft Peripheral Hardware 22 January 22nd, 2010 01:30
Installing on a USB Flash drive? diskman Installing & Upgrading 4 January 4th, 2010 17:18
Installing from USB flash drive. Barnon Installing & Upgrading 7 August 19th, 2009 16:09
Can't mount usb flash drive pigritia Multimedia 17 July 28th, 2009 00:18
usb flash drive and gam_server - can't umount arachnid Multimedia 2 November 16th, 2008 21:55


All times are GMT +1. The time now is 20:03.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0