0

I'm was trying to delete all partition in a usb drive(a sd card with 64Gb storge), and by lsblk it showed that there is 12 partition and
pretty much correct total disk size(59.5/64)

NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda           8:0    1 59.5G  0 disk 
├─sda1        8:1    1  3.5G  0 part /media/james/STATE
├─sda2        8:2    1   16M  0 part 
├─sda3        8:3    1  420M  0 part /media/james/ROOT-A
├─sda4        8:4    1   16M  0 part 
├─sda5        8:5    1    2M  0 part 
├─sda6        8:6    1  512B  0 part 
├─sda7        8:7    1  512B  0 part 
├─sda8        8:8    1   16M  0 part /media/james/OEM
├─sda9        8:9    1  512B  0 part 
├─sda10       8:10   1  512B  0 part 
├─sda11       8:11   1    8M  0 part 
└─sda12       8:12   1   32M  0 part /media/james/EFI-SYSTEM
mmcblk2     179:0    0 29.7G  0 disk 
└─mmcblk2p1 179:1    0 29.4G  0 part /var/log.hdd
                                     /
zram0       251:0    0  1.9G  0 disk [SWAP]
zram1       251:1    0   50M  0 disk /var/log
zram2       251:2    0    0B  0 disk 

but when i try to delete all of them by fdisk it returns a error suggest there is no partition exist

# fdisk /dev/sda

Welcome to fdisk (util-linux 2.38.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.

The device contains 'ext4' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.

Device does not contain a recognized partition table. Created a new DOS (MBR) disklabel with disk identifier 0xe34eee2c.

Command (m for help): d No partition is defined yet!

then the same thing happened with gParted(which suggest total drive size is only 1.8GB, and there is only 1.8Gb of unlocated space) sorry for my english

james
  • 1
  • 1
  • 59.5 Gibibytes is the same as 64 Gigabytes so there is no mystery there. What are you hoping to do with the card? As suggested below try writing a new GPT table rather than deleting partitions. It should achieve the same thing – PonJar Dec 23 '23 at 13:27
  • I'm just trying to format everything, and make it a normal usb drive – james Dec 23 '23 at 17:00
  • 1
    Not good news, I hope it's not the case, I have seen similar devices with modified partition table that looked and reported like that (especially on a FAT filesystem) so that they will report more size than what they actually have i.e. a 2GB drive sold as a fake 64GB for higher price ... Have you just bought this drive? – Raffa Dec 26 '23 at 13:17
  • You can analyze the problem according to this link and if you are lucky, find a solution. – sudodus Dec 26 '23 at 13:36

2 Answers2

1

you formatted your partition table fully into ext4, this should not be done it into table area. do cfdisk /dev/sda , when you entered pseudo graphical UI, you would format its table type, you can use GPT table, but it would be fine when you check MS-DOS format for it. After generating this table, you should add partition from UI, and this will be /dev/sda1, after that, fsck.vfat /dev/sda1 to make fat partition.


Many thanks, Yunjin Lee

  • looks like it has created a new gpt table, however it can only detect 1.8Gb space, while the drive acually have 64Gb – james Dec 23 '23 at 17:13
  • And the wrong partitions in lsblk is still not gone as well – james Dec 23 '23 at 17:13
0

Then you may format /dev/sda, this is wrong format but this would eliminate previous datas. Then you can regenerate gpt partition table, and create the big one as linux partition, and try to format with ext4 fs. Ext4 is also good for fsck command