0

A little funny problem I'm curious about the reason.

I found an old SD Card, I even don't remember that it was used for. So I want to remove the old partitions and use it for some of my devices.

And now the magic begins.

[root@localhost /]# parted /dev/mmcblk0
GNU Parted 3.4
Using /dev/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: SD 00000 (sd/mmc)
Disk /dev/mmcblk0: 16.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  256MB   255MB   primary  fat32        lba
 2      257MB   16.0GB  15.8GB  primary  ext4

(parted) rm 2                                                             
(parted) p                                                                
Model: SD 00000 (sd/mmc)
Disk /dev/mmcblk0: 16.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  256MB  255MB  primary  fat32        lba

(parted) rm 1                                                             
(parted) p                                                                
Model: SD 00000 (sd/mmc)
Disk /dev/mmcblk0: 16.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start  End  Size  Type  File system  Flags

(parted) quit                                                             
Information: You may need to update /etc/fstab.

[root@localhost /]# parted /dev/mmcblk0                                   
GNU Parted 3.4
Using /dev/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: SD 00000 (sd/mmc)
Disk /dev/mmcblk0: 16.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  256MB   255MB   primary  fat32        lba
 2      257MB   16.0GB  15.8GB  primary  ext4

(parted)

So basically, I remove the partitions, everything seems ok, when I quit parted the partitions came back.

Of course, it's the same situation if I use gparted or fdisk. The removed partitions come back once I exit the utility.

I'm very curious that is the explanation ? I never seen something like this before.

Paul Zakharov
  • 141
  • 1
  • 5
  • Probably card is faulty and doesn't really record anything to the flash storage. Or it doesn't record the partition table, which is a feature. Anyway, this is off topic on ServerFault. – Nikita Kipriyanov Aug 23 '23 at 15:19

1 Answers1

1

There are a lot of weird SD card devices out there. There are - for example - cards that have WLAN connectivity and can upload the files stored on them to an FTP server (which is really nice for digital cameras).

Having said that, maybe you have one of those SD cards that is not just a data store, but provides some extra functionality. Usually these functions work by reading/writing specific files on a specific partition, so the card ignores writes to the partition table area.

Andreas Rogge
  • 2,853
  • 11
  • 24
  • Thanks for replying. Globally it was also my guest, that the sd card is a little bit special. I saw a lot of usb-flash in my job. But for the moment I'm not sure that this is the explanation as it's my personal sd card and normally it should be just a normal sd card. – Paul Zakharov Aug 23 '23 at 13:36