LinuxQuestions.org
Review your favorite Linux distribution.
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 08-04-2016, 10:42 AM   #1
iFunction
Member
 
Registered: Nov 2015
Posts: 248

Rep: Reputation: Disabled
Can't remove partition on sd card


Hi there,

trying to use fdisk to remove a partition on an sd card but it won't budge. I have a 32Gb sd card, that claims 28Gb free, so on typing df -h, there is an old partition I named "test" sitting there as a boot partition on the disk.

Run fdisk /dev/sda
d to delete partition
quit
and it's still there, I expected to get an error message saying it can't read an empty disk without a partition on it.

How do I get rid of this annoying part? I have 60 of these to reformat.

Regards
iFunc
 
Old 08-04-2016, 10:52 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,714

Rep: Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899Reputation: 5899
You need to write the changes to the drive i.e. the w command. In some cases the OS does not reread the drive so it still uses the old information.
 
Old 08-04-2016, 11:03 AM   #3
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You can go straight ahead and format them mkfs.ext4 /dev/sda, it will wipe the partition table and create a single filesystem on device.
 
1 members found this post helpful.
Old 08-04-2016, 11:09 AM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
You can also wipe out the partition table with dd (just be careful to get the device name correct)
Code:
dd if=/dev/zero of=/dev/sda bs=512 count=1
 
Old 08-04-2016, 12:11 PM   #5
iFunction
Member
 
Registered: Nov 2015
Posts: 248

Original Poster
Rep: Reputation: Disabled
Thanks guys, I'm going to go this Emerson's suggestion as I understand that one, it's something I have used before. I will look at the others a if I can't get it to work, but it I think it should.
 
Old 08-04-2016, 12:20 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by iFunction View Post
Thanks guys, I'm going to go this Emerson's suggestion as I understand that one
What in michaelk's response was not understandable? In fdisk, everything you do is temporary until you hit "w" to write the changes to the disk. If you make a bunch of changes and then just quit out of it, like you said you did in your OP, it won't do anything.
 
Old 08-04-2016, 05:49 PM   #7
iFunction
Member
 
Registered: Nov 2015
Posts: 248

Original Poster
Rep: Reputation: Disabled
Ah, ok, I didn't know that, that will be what the issue was then, will try tomorrow and feedback solution for any other newbies like meself. Thank you.
 
  


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
how linux handles sd card remove from usb card reader kewl_samurai Linux - General 20 09-12-2014 03:46 PM
wants to remove swap partition rajini23 Linux - Server 5 01-18-2013 05:22 AM
Remove Linux partition randyd Linux - Newbie 6 05-02-2012 07:48 AM
How to Remove ReiserFS Partition? 07mackenzie Linux - General 3 12-10-2006 11:01 AM
I am using windows and linux i one partition now ia m awnt remove the linux partition sathish80 Linux - Newbie 2 01-23-2006 10:55 PM

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

All times are GMT -5. The time now is 07:13 PM.

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