LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 12-30-2008, 12:35 AM   #1
yzguy
LQ Newbie
 
Registered: Feb 2007
Distribution: xandros
Posts: 6

Rep: Reputation: 0
Exclamation Remove Linux Partition on USB Flash Drive?


I recently installed Fedora 9 on a 16GB Flash Drive to try it and now want to remove it. I am trying to remove the linux partition on my USB drive. The linux partition has no drive letter so windows doesn't recognize it. my drive shows that there is about 197MB free space out of 198MB total on drive F. So can someone please help my regain all 16GB of my drive.
Thanks
 
Old 12-30-2008, 02:59 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,496

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
you can use partitionmagic, or boot from a linux lice cd
 
Old 12-30-2008, 03:45 AM   #3
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
I normally wipe my flash drives when cleaning them up. Seeing as you have Xandros, run fdisk -l command as root with the pen drive plugged in to see which device it is. Let's say it is /dev/sdb, now use dd to wipe it of all data, partitions, and MBR information with command: dd if=/dev/zero of=/dev/sdb.
When it's done in half hour or so, boot into Windows and plug it in, it should show up as a drive but when you try to access it Windows will say it is not formatted and asks if you want to format it, go ahead and do it, give it a name in the label field. After formatting you will be left with a 16GB pen drive (minus space used for formatting) clean and ready to go.
 
Old 12-30-2008, 03:45 AM   #4
Tuttle
Senior Member
 
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,289

Rep: Reputation: 52
mmmm lice
 
Old 12-30-2008, 03:19 PM   #5
yzguy
LQ Newbie
 
Registered: Feb 2007
Distribution: xandros
Posts: 6

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by Junior Hacker View Post
I normally wipe my flash drives when cleaning them up. Seeing as you have Xandros, run fdisk -l command as root with the pen drive plugged in to see which device it is. Let's say it is /dev/sdb, now use dd to wipe it of all data, partitions, and MBR information with command: dd if=/dev/zero of=/dev/sdb.
When it's done in half hour or so, boot into Windows and plug it in, it should show up as a drive but when you try to access it Windows will say it is not formatted and asks if you want to format it, go ahead and do it, give it a name in the label field. After formatting you will be left with a 16GB pen drive (minus space used for formatting) clean and ready to go.
I am trying this right now.
Thanks
 
Old 12-30-2008, 04:28 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,093

Rep: Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978
That's one write per sector - an awful lot to waste on a USB. I might be inclined to limit it to a couple of hundred or so.
 
Old 12-30-2008, 07:49 PM   #7
yzguy
LQ Newbie
 
Registered: Feb 2007
Distribution: xandros
Posts: 6

Original Poster
Rep: Reputation: 0
Well, I did it but had no luck...
 
Old 12-30-2008, 09:00 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,800

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
FYI using the dd command as described will wipe out the partition table. You will need to create a new partition and format it.
 
Old 12-31-2008, 02:48 AM   #9
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
Quote:
Originally Posted by michaelk View Post
FYI using the dd command as described will wipe out the partition table. You will need to create a new partition and format it.
Yup, apparently there is something wrong with it as it appears to only be a few megs and it should be 16GB. So a new one needs to be created. I'm guessing it's a Volume group thing since Fedora was installed on it, and all that appears is a /boot partition.
Just plug the zeroed drive in Windows and one or two clicks later you have one clean, formatted, 16GB (a little less) partition and a good partition table. Which is what we're after.
Quote:
That's one write per sector - an awful lot to waste on a USB. I might be inclined to limit it to a couple of hundred or so.
I agree, but I'm being lazy here, trying save on typing. I usually have dcfldd installed and issue that same command starting with dcfldd which defaults to block/cluster size rather than one sector which is dd's default. (If that's what you're implying). I guess one could run an extra command to find the block size and use that for a bs value, blame it on the laziness.
Quote:
Well, I did it but had no luck...
That's odd...can you elaborate?

I hope you checked with fdisk -l command first to find which is the USB flash drive. If you used my example without checking, you may have got a null response or wiped your second hard drive.

My mother always sends me power point presentations with nice pictures and asks me to extract the pictures individually. Since I have all the data recovery tools in my VM Debian, I wipe my 128MB flash drive this way, recreate and format the partition (same amount of time in Windows whether there is an existing partition or not), copy and paste the power point presentation in it and run foremost to extract the .jpg photos. And I don't have to sift through tons of .jpg photos from residual data because I cleaned it off first.
I once extracted them with gimp or open office impress (forget which one), but don't install them anymore.
I do this at least once a month average.
 
Old 12-31-2008, 03:10 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,093

Rep: Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978
Quote:
Originally Posted by Junior Hacker View Post
.. defaults to block/cluster size rather than one sector which is dd's default. (If that's what you're implying).
Sorta - the underlying blocksize is basically irrelevant when using /dev/zero as a source. I use a count of a couple of hundred to ensure the "important" bits are blatted, but I haven't found a real need to over-write the entire device.

As usual, YMMV (general statement, not specifically directed at Junior Hacker)
 
Old 12-31-2008, 05:29 AM   #11
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
Quote:
Originally Posted by syg00 View Post
but I haven't found a real need to over-write the entire device.
You probably haven't done any data recovery, I do. Oh! the stories I can tell about the contents of the drives I came across, which is why I adopted this "clean it up is a good thing" approach.

I don't have to meet the owner to tell you what they look like, where they come from, where their going, their habits, desires, fetishes, children's names, vital personal information, etc. are. And based on my experience, the majority of computer users are very complacent in this area.

I guess, for some users, just overwriting the MBR would suffice: dd if=/dev/zero of=/dev/sdb bs=512 count=1
But I recommend taking a bath once and a while.
 
Old 12-31-2008, 05:38 AM   #12
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,093

Rep: Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978Reputation: 978
It was the OP's own USB key - he probably already knows what secrets lurk there. Anything sufficiently secret would justify physical destruction of a key; even 16 Gig.

And one sector is never enough - I've found you need (at least) to scrub the first couple of "cylinders" at a minimum.
 
Old 01-02-2009, 10:50 AM   #13
yzguy
LQ Newbie
 
Registered: Feb 2007
Distribution: xandros
Posts: 6

Original Poster
Rep: Reputation: 0
I found the device and ran dd if=/dev/zero of=/dev/sdb1. It took some time then when done I went into windows to format it and under capacity it was still 198mb.

Last edited by yzguy; 01-02-2009 at 10:51 AM.
 
Old 01-03-2009, 07:17 PM   #14
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
Well, there was a spark when I just read that.
I remember a similar situation in an older thread where there were encrypted or locked partitions on a USB pen drive that someone got from his/her boss or something that were giving them issues like this. And offhand, I'm not sure what became of that particular thread at the moment. There might be some brain activity in the future, I'll report back if so.
 
Old 01-11-2010, 02:52 PM   #15
cteyul
LQ Newbie
 
Registered: Jan 2010
Posts: 2

Rep: Reputation: 0
same problem

i ahve the same problem i tried it but it gives me a message sayin that there is no space left on device. any suggestions
 
  


Reply

Tags
delete, help, partition, usb


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a usb thumb drive or flash drive as a swap partition. stevenjoseph Linux - Hardware 8 01-16-2012 12:09 PM
How to remove grub + linux partition from drive? No longer needed. Boggit Linux - General 7 11-09-2008 12:29 AM
How to delete a ISOFS partition from an USB flash drive scrat75 Linux - Software 3 09-23-2008 02:33 PM
Linux On Flash USB Drive eng_muhammad Linux - Distributions 7 10-03-2007 11:26 PM
Safely remove USB Flash drive? Guitarist88 Linux - Newbie 3 05-26-2004 03:35 PM


All times are GMT -5. The time now is 08:45 AM.

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