LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 12-29-2019, 11:38 AM   #1
techforay
LQ Newbie
 
Registered: Dec 2019
Posts: 28

Rep: Reputation: Disabled
I screwed up USB drive


I am an absolute newbee at linux. I was just trying to format some old usb drives that i dont need anymore with the command line. I did figure out how to do it but the first one i messed up. I think i deleted a partition but did not format it. Now it wont mount. I have spent a couple of hours trying to figure out how to fix it. If I do the dmesg command i see this. [ 2747.076160] usb 1-1.2: Manufacturer: LEXAR MEDIA
but it wont mount. I wanted to figure this out myself but have not been able to do it. It may be through using parted but i am so new to that also.
 
Old 12-29-2019, 12:34 PM   #2
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,484

Rep: Reputation: Disabled
At the command line, use sudo fdisk to create a partition, then use sudo mke2fs to put a filesystem on it.

(If you need to create a new MBR, it is the 'o' option in fdisk.)
 
2 members found this post helpful.
Old 12-29-2019, 12:43 PM   #3
/dev/random
Member
 
Registered: Aug 2012
Location: Ontario, Canada
Distribution: Slackware 14.2, LFS-current, NetBSD 6.1.3, OpenIndiana
Posts: 319

Rep: Reputation: 112Reputation: 112
You deleted the partition.

Unplug the USB and run the following commands as root:

Code:
tail -f /var/log/messages
If you are running a debian variant then
Code:
tail -f /var/log/syslog

While this is running plug the USB key into the port. the output from one of the last two commands should show you what device this usb is mapped to. Now that you know which device this is hit 'q' to exit tail, now create a partition for it (make sure you use the right partition type):
Code:
cfdisk /dev/<somedevice>
Now once you have that, recreate the filesystem like so:
Code:
mkfs.fvat /dev/<somedevice><partitionnumber>
sync
Now you should be able to pull out the USB key and reinsert it and it should be mountable.
 
2 members found this post helpful.
Old 12-30-2019, 12:29 AM   #4
techforay
LQ Newbie
 
Registered: Dec 2019
Posts: 28

Original Poster
Rep: Reputation: Disabled
Thank

Thank you. That was a great learning experience. Really appreciate both of your help.
 
1 members found this post helpful.
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Emergency ! Gparted screwed up my drive ... totally !! It says its no longer ntfs zonemikel Linux - Hardware 2 08-01-2009 03:59 AM
Windows Screwed me over - hard drive failure - any suggestions? the whte rbt Linux - Hardware 19 04-26-2006 06:56 PM
USB drive using different partitions (usb key thumb drive) Arodef Linux - Hardware 0 08-04-2004 06:36 PM
help, screwed up my cdrom drive... shadow.blue Linux - Newbie 4 04-15-2003 02:42 PM
Drive D is Screwed Do You Know Of Diagnostic Tool? nick Linux - General 4 11-23-2001 06:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:07 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