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 ?