Why does not fdisk save (w) save cahnges to partition

Kernels & Hardware, configuring network, installing services

Why does not fdisk save (w) save cahnges to partition

Postby andredahl » 2021-01-05 18:19

Trying to build up a sd card that lost its FAT og partitions. The have been 64 Gb but ended up as a 121 Mb card after an installation.

Here is the commands which seemed to work but:

Disk /dev/sdd: 121.3 MiB, 127139840 bytes, 248320 sectors
Disk model: STORAGE DEVICE
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@ad-pc:/home/ad# sudo fdisk /dev/sdd

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

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x335bcc0a.

Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (1-4, default 1):
First sector (2048-248319, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-248319, default 248319):

Created a new partition 1 of type 'Linux' and of size 120.3 MiB.

Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): b
Changed type of partition 'Linux' to 'W95 FAT32'.

Command (m for help): p
Disk /dev/sdd: 121.3 MiB, 127139840 bytes, 248320 sectors
Disk model: STORAGE DEVICE
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x335bcc0a

Device Boot Start End Sectors Size Id Type
/dev/sdd1 2048 248319 246272 120.3M b W95 FAT32

Command (m for help): a
Selected partition 1
The bootable flag on partition 1 is enabled now.

Command (m for help): p
Disk /dev/sdd: 121.3 MiB, 127139840 bytes, 248320 sectors
Disk model: STORAGE DEVICE
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x335bcc0a

Device Boot Start End Sectors Size Id Type
/dev/sdd1 * 2048 248319 246272 120.3M b W95 FAT32


Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

root@ad-pc:/home/ad# partprobe
root@ad-pc:/home/ad# partprobe /dev/sdd
root@ad-pc:/home/ad# mkfs -t vfat /dev/sdd1
mkfs.fat 4.1 (2017-01-24)
mkfs.vfat: unable to open /dev/sdd1: No such file or directory

At the end the sdd1 is not found, why is this happening ?
andredahl
 
Posts: 36
Joined: 2020-10-26 17:55

Re: Why does not fdisk save (w) save cahnges to partition

Postby Head_on_a_Stick » 2021-01-05 20:37

Please use code tags when posting terminal output, it greatly aids readability.

What does dmesg say about the card after you insert it into the reader?
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13041
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Why does not fdisk save (w) save cahnges to partition

Postby andredahl » 2021-01-06 05:57

Yes I can see that it is hard to read, but I am not sure on how to use code tags to make readers understand what actually happens during the terminal work.

I will run the process once more and use dmesg to see what the respons are.
andredahl
 
Posts: 36
Joined: 2020-10-26 17:55

Re: Why does not fdisk save (w) save cahnges to partition

Postby andredahl » 2021-01-06 10:31

Results from dmesg

5759.234822] scsi host6: usb-storage 4-1:1.0
[ 5759.234964] usbcore: registered new interface driver usb-storage
[ 5759.244198] usbcore: registered new interface driver uas
[ 5760.248545] scsi 6:0:0:0: Direct-Access Generic STORAGE DEVICE 1206 PQ: 0 ANSI: 6
[ 5760.249402] scsi 6:0:0:1: Direct-Access Generic STORAGE DEVICE 1206 PQ: 0 ANSI: 6
[ 5760.250452] scsi 6:0:0:2: Direct-Access Generic STORAGE DEVICE 1206 PQ: 0 ANSI: 6
[ 5760.251641] scsi 6:0:0:3: Direct-Access Generic STORAGE DEVICE 1206 PQ: 0 ANSI: 6
[ 5760.252803] scsi 6:0:0:4: Direct-Access Generic STORAGE DEVICE 1206 PQ: 0 ANSI: 6
[ 5760.253431] sd 6:0:0:0: Attached scsi generic sg2 type 0
[ 5760.253982] sd 6:0:0:1: Attached scsi generic sg3 type 0
[ 5760.254463] sd 6:0:0:2: Attached scsi generic sg4 type 0
[ 5760.254921] sd 6:0:0:3: Attached scsi generic sg5 type 0
[ 5760.255278] sd 6:0:0:4: Attached scsi generic sg6 type 0
[ 5761.398074] sd 6:0:0:2: [sdd] 248320 512-byte logical blocks: (127 MB/121 MiB)
[ 5761.398955] sd 6:0:0:0: [sdb] Attached SCSI removable disk
[ 5761.401760] sd 6:0:0:1: [sdc] Attached SCSI removable disk
[ 5761.404948] sd 6:0:0:2: [sdd] Write Protect is off
[ 5761.404952] sd 6:0:0:2: [sdd] Mode Sense: 21 00 00 00
[ 5761.406679] sd 6:0:0:4: [sdf] Attached SCSI removable disk
[ 5761.409464] sd 6:0:0:3: [sde] Attached SCSI removable disk
[ 5761.412552] sd 6:0:0:2: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 5761.465850] sd 6:0:0:2: [sdd] Attached SCSI removable disk
[ 6501.587521] perf: interrupt took too long (2504 > 2500), lowering kernel.perf_event_max_sample_rate to 79750

I have not a clue about what this is telling ??????
andredahl
 
Posts: 36
Joined: 2020-10-26 17:55

Re: Why does not fdisk save (w) save cahnges to partition

Postby LE_746F6D617A7A69 » 2021-01-07 21:14

@andredahl:
The reported device capacity has changed from 64GB to 120MB.
This basically means, that the hidden partition which is holding the firmware for the SD Card controller MCU has been damaged, and it's nearly impossible to recover the data -> because that would require to have the firmware image for that specific SD Card controller.
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
LE_746F6D617A7A69
 
Posts: 421
Joined: 2020-05-03 14:16


Return to System configuration

Who is online

Users browsing this forum: No registered users and 10 guests

fashionable