LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-26-2014, 10:03 PM   #1
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 1,701

Rep: Reputation: 136Reputation: 136
how to delete contents of a flash drive using Xubuntu


I have a 3GB Verbatim flash drive that has Xubuntu 13.10 on it. I just got 14.04 so I would like to delete what I have on the flash drive so that I can use it again. What I would have done is just select all the files and delete them, but when I looked on-line about deleting the contents of a flash drive in Linux there were all these using-the-terminal, complicated ways of doing it that psyched me out from doing anything. I don't know if I have to reformat the drive or whatever. (Assume that I know nothing--lol--it's pretty true!) Thanks!
 
Old 04-26-2014, 11:27 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 7,377

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
To be extra cautious, not knowing how many drives you have, you could boot Xubuntu and run: sudo fdisk -l(Lower Case Letter L in the command) and look at the output. It will show drives as sda, sdb, sdc, etc and the numbers after are the partitions. Do this before you put the flash drive in and repeat it with the flash attached. The flash is the one you didn't see on the first run. If you have gparted on Xubuntu, just use it to format the partition on the flash to the filesystem you want. Typing sudo gparted in a terminal gets you GParted in graphical interface. It's easy to use and there are lots of tutorials online.
 
Old 04-27-2014, 12:39 AM   #3
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,910

Rep: Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999
Unless you want to "securely erase" the data on the drive then jstu install the latest version of Ubuntu onto it, allowing it to use the whole drive.
 
Old 04-27-2014, 01:17 AM   #4
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 1,701

Original Poster
Rep: Reputation: 136Reputation: 136
Quote:
Originally Posted by yancek View Post
To be extra cautious, not knowing how many drives you have, you could boot Xubuntu and run: sudo fdisk -l(Lower Case Letter L in the command) and look at the output. It will show drives as sda, sdb, sdc, etc and the numbers after are the partitions. Do this before you put the flash drive in and repeat it with the flash attached. The flash is the one you didn't see on the first run. If you have gparted on Xubuntu, just use it to format the partition on the flash to the filesystem you want. Typing sudo gparted in a terminal gets you GParted in graphical interface. It's easy to use and there are lots of tutorials online.
Thanks yancek, but your way seems complicated too. I'm sure it would work and I'd learn a lot doing it, but I'm not really up for tutorials on just clearing a flash drive. How about if I'm not extra cautious? Is there a middle ground kind of way of doing this?
 
Old 04-27-2014, 01:19 AM   #5
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 1,701

Original Poster
Rep: Reputation: 136Reputation: 136
Quote:
Originally Posted by 273 View Post
Unless you want to "securely erase" the data on the drive then jstu install the latest version of Ubuntu onto it, allowing it to use the whole drive.
Thanks 273. Maybe I misrepresented what I was after (or I'm misunderstanding what you're saying) because I want the flash drive to be free to be used for storing other files. Why would I install Ubuntu on it?
 
Old 04-27-2014, 01:22 PM   #6
Jeays
LQ Newbie
 
Registered: May 2011
Location: Carleton Place, Ontario, Canada
Distribution: Mint, Ubuntu, Linux lite
Posts: 13

Rep: Reputation: Disabled
The command mkdosfs will replace everything on the drive with a new, empty,
ms-dos file system. For example: sudo mkdosfs /dev/yourdevice.

Make *absolutely sure* you specify the right device. If you do this on
your system device by mistake, you are well and truly hosed.

Try man mkdosfs for more information.
 
1 members found this post helpful.
Old 04-27-2014, 01:36 PM   #7
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,910

Rep: Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999Reputation: 1999
Quote:
Originally Posted by Gregg Bell View Post
Thanks 273. Maybe I misrepresented what I was after (or I'm misunderstanding what you're saying) because I want the flash drive to be free to be used for storing other files. Why would I install Ubuntu on it?
In that case then you can just delete the files as you suggested. The command line solutions you have seen are probably to either format the drive or somehow "securely erase" the data.
 
1 members found this post helpful.
Old 04-29-2014, 08:45 PM   #8
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 1,701

Original Poster
Rep: Reputation: 136Reputation: 136
Quote:
Originally Posted by 273 View Post
In that case then you can just delete the files as you suggested. The command line solutions you have seen are probably to either format the drive or somehow "securely erase" the data.
Thanks 273. I just deleted the files and the flash drive is working fine. Appreciate your help.
 
  


Reply

Tags
delete, flash drive, format


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you REALLY delete images from a flash drive (such as for a digital camera) Quon Linux - Newbie 11 02-02-2013 06:23 AM
cant install kubuntu/xubuntu via usb flash drive Kyle4433 Ubuntu 1 04-03-2011 08:25 PM
How to delete a ISOFS partition from an USB flash drive scrat75 Linux - Software 3 09-23-2008 03:33 PM
I'd Like To Have 64 Bit Xubuntu On A Flash Drive Mark7 Ubuntu 3 12-22-2007 04:54 PM
cannot delete drive from root desktop - cannot mount usb flash drive - openSuSE 10.2 bluecog6 Linux - General 6 01-29-2007 04:18 PM

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

All times are GMT -5. The time now is 12:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration