LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't erase my Sdcard... (https://www.linuxquestions.org/questions/linux-newbie-8/cant-erase-my-sdcard-4175572610/)

clg 02-18-2016 02:00 PM

Can't erase my Sdcard...
 
Hi guys

I have a SDcard sitting in a USB card reader...
I have this in /etc/fstab :
/dev/sdc1 /media/claude/SDCARD vfat rw,user,auto,exec,gid=100,uid=1000,umask=002,utf8,codepage=850,shortname=mixed 0 0

so it is mounted in /media/claude/SDCARD...
I have those rights:
drwxrwxr-x 11 claude users 16384 janv. 1 1970 SDCARD

So far, so good...but I can't erase anything ( files/directories ) on this memory...)
When I launch a rm -R * command, everything seems to be erased but , next time I'll plug the Sd card, all the supposedly erased files are still there...which, to be honest, confuse ma a lot ( I'm the owner, I'm root...and I can't erase this memory)

2 quickies
1) what am I missing ?
2) what to be done to completely clean this SD memory
(FYI, I've tried erasing under Seven..lifting the perms, erasing..but same stuff, data still present...

Completely lost...help greatly appreciated !!!
rgds

suicidaleggroll 02-18-2016 02:07 PM

How are you removing the card? Are you using umount and sync or just unplugging it?

Many (all?) SD cards also have a physical switch on the side that switches them to read-only, have you played with that?

Soadyheid 02-18-2016 02:08 PM

You've checked the write protect switch on the SD card...? :)

Play Bonny!

:hattip:

clg 02-18-2016 02:30 PM

Hi
I'm doing an umount and then unplug...(sync ? dunno what it is...)
of course, The card is not write protected by the lateral slider...

As mentionned above, I can acces SDCARD...I see all the files/directories and throw rm command...it seems to erase the whole thing...
I have the feeling, but dunno if it is true...
I'm not erasing the card...but a copy of it !!!

drives me nuts this thing !!!

BW-userx 02-18-2016 05:02 PM

oh I don't know
did you try using gparted?
just unmount it
delete it the partition
reastablish it in the format you want
then click the arrow bada bing bada boom

dont for get that if you start it off the command line you got a be root.

clg 02-19-2016 10:12 AM

Hi

I've tried Gparted but almost everything is greyed out...
I came to the conclusion that the part id dead...I've tried to write on it...no success, then tried to kind of format it using dd...no success !!!
You may read, but not write which is pretty ennoying ( but hopefully, I've got a spare 32Gb which is working fine)

Anyway, many thks for yr concern and yr support
Cheers

BW-userx 02-19-2016 10:20 AM

Quote:

Originally Posted by clg (Post 5502885)

I've tried Gparted but almost everything is greyed out...

did you try right click on grey area and maybe select "new" ? then take it from there.....

looking up in the right side ensuring you have the right device first... of course you knew that part ;)

clg 02-19-2016 10:53 AM

Can't access my partition...
I see it, half full but the Partition menu does not give me any access ( resize,format...).everything greyed, "new" has no action...
Dead !!!

BW-userx 02-19-2016 11:08 AM

Quote:

Originally Posted by clg (Post 5502905)
Can't access my partition...
I see it, half full but the Partition menu does not give me any access ( resize,format...).everything greyed, "new" has no action...
Dead !!!

are you running it i user mode? got a be in root to have permissions to play with partitions.

command line starting.
Code:

$sudo gparted
#or
$su
password
#gparted


BW-userx 02-19-2016 11:17 AM

o Tay if that does not work for ya then try this next

Code:

sudo blkid
get the address to your sd /dev/xxx
then
Code:

sudo cfdisk /dev/sdx
where x = whatever it is.

when cfdisk opens up you'll see it then you can delete, create new, and set type, and other things off the command line (terminal). make sure you select write, when you are done, it will then ask for confirmation , type 'yes' so it sticks then quit.

example:

Code:


11:26 AM ~$ blkid
/dev/mmcblk0: UUID="2015-10-09-07-32-35-00" LABEL="VOID_LIVE" TYPE="iso9660" PTUUID="07e07223" PTTYPE="dos"



/dev/sda1: UUID="f79f684e-c079-4daa-8eb7-570890855ef9" TYPE="swap" PARTUUID="6147b2c4-01"
/dev/sda2: UUID="aa6520d6-bf65-4039-abd1-4b55bf95b551" TYPE="ext4" PARTUUID="6147b2c4-02"
/dev/sda3: UUID="cd01a154-f459-4b13-b867-1e4dbc86d677" TYPE="ext4" PARTUUID="6147b2c4-03"

/dev/mmcblk0p1: UUID="3b4605e3-2dba-40f4-acf6-b13da55d0868" TYPE="ext4" PARTUUID="07e07223-01"
/dev/mmcblk0p2: UUID="40cf62eb-8474-4a8a-a15c-c3910aff6fca" TYPE="ext4" PARTUUID="07e07223-02"

as you see I have three indecators for my SD Card, you need the device not the paritions.

that'd be the first one in this case.

Code:

sudo cfdisk /dev/mmcblk0
Code:

                                                          Disk: /dev/mmcblk0
                                          Size: 14.9 GiB, 16012804096 bytes, 31275008 sectors
                                                  Label: dos, identifier: 0x07e07223

    Device                  Boot                      Start              End          Sectors          Size        Id Type
>>  /dev/mmcblk0p1                                    2048          15888383          15886336          7.6G        83 Linux       
    /dev/mmcblk0p2                                15888384          31275007          15386624          7.3G        83 Linux





 ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
 │ Partition type: Linux (83)                                                                                                        │
 │    Filesystem: ext4                                                                                                              │
 │Filesystem UUID: 3b4605e3-2dba-40f4-acf6-b13da55d0868                                                                              │
 └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
                          [Bootable]  [ Delete ]  [  Quit  ]  [  Type  ]  [  Help  ]  [  Write ]  [  Dump  ]

that is what it looks like in cfdisk

I can delete everything then start over if I like.

using the arrow keys - first select the area partition raw area you want to work with then select what you want to do with it, then enter, type size if it asks you

10.7MB
or
10.3GB

the MB and GB being the most importaint so it knows what you are talking about.

formatting the new partitions may now be required,, I don't know everything :D

but when I open it up again in Gparted I get that little ! then I just tell it to format it then do it then the ! goes away.

clg 02-19-2016 02:28 PM

@BW_userx

Bad luck...sudo cfdisk /dev/sdc1 gives a fatal error. can't open disk...
Below, screen copy...
Thks anyway






Erreur fatale: Impossible d'ouvrir l'unité de disque
Appuyez sur n'importe quelle touche pour quitter cfdisk

BW-userx 02-19-2016 02:32 PM

Quote:

Originally Posted by clg (Post 5503011)
@BW_userx

Bad luck...sudo cfdisk /dev/sdc1 gives a fatal error. can't open disk...
Below, screen copy...
Thks anyway
Erreur fatale: Impossible d'ouvrir l'unité de disque
Appuyez sur n'importe quelle touche pour quitter cfdisk

DUDE I said not the partition

do this

again one more time...

Code:

sudo cfdisk /dev/sdc  <----- notice no 1
better yet, lets try this in google french

Quote:

DUDE je l'ai dit pas la partition

faire

encore une fois de plus...

Code:


sudo cfdisk /dev/sdc <----- Avis n° 1




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